Merged revisions 186719 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Tue, 7 Apr 2009 20:46:18 +0000 (20:46 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 7 Apr 2009 20:46:18 +0000 (20:46 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186719 | mmichelson | 2009-04-07 15:43:49 -0500 (Tue, 07 Apr 2009) | 6 lines

  Ensure that \r\n is printed after the ActionID in an OriginateResponse.

  (closes issue #14847)
  Reported by: kobaz
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186720 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/manager.c

index 2220de2..8987034 100644 (file)
@@ -2344,7 +2344,7 @@ static void *fast_originate(void *data)
                snprintf(requested_channel, AST_CHANNEL_NAME, "%s/%s", in->tech, in->data);     
        /* Tell the manager what happened with the channel */
        manager_event(EVENT_FLAG_CALL, "OriginateResponse",
-               "%s"
+               "%s%s"
                "Response: %s\r\n"
                "Channel: %s\r\n"
                "Context: %s\r\n"
@@ -2353,7 +2353,8 @@ static void *fast_originate(void *data)
                "Uniqueid: %s\r\n"
                "CallerIDNum: %s\r\n"
                "CallerIDName: %s\r\n",
-               in->idtext, res ? "Failure" : "Success", chan ? chan->name : requested_channel, in->context, in->exten, reason, 
+               in->idtext, ast_strlen_zero(in->idtext) ? "" : "\r\n", res ? "Failure" : "Success", 
+               chan ? chan->name : requested_channel, in->context, in->exten, reason, 
                chan ? chan->uniqueid : "<null>",
                S_OR(in->cid_num, "<unknown>"),
                S_OR(in->cid_name, "<unknown>")
@@ -2451,7 +2452,7 @@ static int action_originate(struct mansession *s, const struct message *m)
                        res = -1;
                } else {
                        if (!ast_strlen_zero(id))
-                               snprintf(fast->idtext, sizeof(fast->idtext), "ActionID: %s\r\n", id);
+                               snprintf(fast->idtext, sizeof(fast->idtext), "ActionID: %s", id);
                        ast_copy_string(fast->tech, tech, sizeof(fast->tech));
                        ast_copy_string(fast->data, data, sizeof(fast->data));
                        ast_copy_string(fast->app, app, sizeof(fast->app));