[asterisk-commits] AMI: Fixed OriginateResponse message (asterisk[11])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 15 21:12:33 CST 2015


Matt Jordan has submitted this change and it was merged.

Change subject: AMI: Fixed OriginateResponse message
......................................................................


AMI: Fixed OriginateResponse message

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
---
M main/manager.c
1 file changed, 39 insertions(+), 16 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved



diff --git a/main/manager.c b/main/manager.c
index 19c00b3..e588c21 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -499,6 +499,8 @@
 				<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 @@
 	}
 	/* 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) {

-- 
To view, visit https://gerrit.asterisk.org/1816
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8fb6bc533d7f812c66a24cc2b0354ddb09d0f640
Gerrit-PatchSet: 11
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: sungtae kim <pchero21 at gmail.com>



More information about the asterisk-commits mailing list