]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
AMI: Fixed OriginateResponse message 16/1816/11
authorpchero <pchero21@gmail.com>
Wed, 9 Dec 2015 23:23:59 +0000 (00:23 +0100)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 16 Dec 2015 02:19:24 +0000 (20:19 -0600)
When asterisk sends the OriginateResponse event message, it
doesn't send the correct information for origination to an
application.

ASTERISK-25624 #close

Change-Id: I8fb6bc533d7f812c66a24cc2b0354ddb09d0f640

main/manager.c

index 19c00b35bd9be9ff26bf492261e6a081a55ea768..e588c219f6cfa0c89bd38d59619a78ee7ef1bba0 100644 (file)
@@ -499,6 +499,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
                                <parameter name="Channel"/>
                                <parameter name="Context"/>
                                <parameter name="Exten"/>
+                               <parameter name="Application"/>
+                               <parameter name="Data"/>
                                <parameter name="Reason"/>
                                <parameter name="Uniqueid"/>
                                <parameter name="CallerIDNum"/>
@@ -4146,22 +4148,43 @@ static void *fast_originate(void *data)
        }
        /* Tell the manager what happened with the channel */
        chans[0] = chan;
-       ast_manager_event_multichan(EVENT_FLAG_CALL, "OriginateResponse", chan ? 1 : 0, chans,
-               "%s"
-               "Response: %s\r\n"
-               "Channel: %s\r\n"
-               "Context: %s\r\n"
-               "Exten: %s\r\n"
-               "Reason: %d\r\n"
-               "Uniqueid: %s\r\n"
-               "CallerIDNum: %s\r\n"
-               "CallerIDName: %s\r\n",
-               in->idtext, res ? "Failure" : "Success",
-               chan ? ast_channel_name(chan) : requested_channel, in->context, in->exten, reason,
-               chan ? ast_channel_uniqueid(chan) : "<null>",
-               S_OR(in->cid_num, "<unknown>"),
-               S_OR(in->cid_name, "<unknown>")
-               );
+       if (!ast_strlen_zero(in->app)) {
+               ast_manager_event_multichan(EVENT_FLAG_CALL, "OriginateResponse", chan ? 1 : 0, chans,
+                               "%s"
+                               "Response: %s\r\n"
+                               "Channel: %s\r\n"
+                               "Application: %s\r\n"
+                               "Data: %s\r\n"
+                               "Reason: %d\r\n"
+                               "Uniqueid: %s\r\n"
+                               "CallerIDNum: %s\r\n"
+                               "CallerIDName: %s\r\n",
+                               in->idtext, res ? "Failure" : "Success",
+                               chan ? ast_channel_name(chan) : requested_channel,
+                               in->app, in->appdata, reason,
+                               chan ? ast_channel_uniqueid(chan) : "<null>",
+                               S_OR(in->cid_num, "<unknown>"),
+                               S_OR(in->cid_name, "<unknown>")
+                               );
+       } else {
+               ast_manager_event_multichan(EVENT_FLAG_CALL, "OriginateResponse", chan ? 1 : 0, chans,
+                               "%s"
+                               "Response: %s\r\n"
+                               "Channel: %s\r\n"
+                               "Context: %s\r\n"
+                               "Exten: %s\r\n"
+                               "Reason: %d\r\n"
+                               "Uniqueid: %s\r\n"
+                               "CallerIDNum: %s\r\n"
+                               "CallerIDName: %s\r\n",
+                               in->idtext, res ? "Failure" : "Success",
+                               chan ? ast_channel_name(chan) : requested_channel,
+                               in->context, in->exten, reason,
+                               chan ? ast_channel_uniqueid(chan) : "<null>",
+                               S_OR(in->cid_num, "<unknown>"),
+                               S_OR(in->cid_name, "<unknown>")
+                               );
+       }
 
        /* Locked by ast_pbx_outgoing_exten or ast_pbx_outgoing_app */
        if (chan) {