[Asterisk-code-review] Fixed OriginateResponse message (asterisk[13])

sungtae kim asteriskteam at digium.com
Sat Dec 12 08:25:54 CST 2015


sungtae kim has uploaded a new change for review.

  https://gerrit.asterisk.org/1805

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

Fixed OriginateResponse message

When the asterisk sending OriginateResponse message,
it doesn't set the "Uniqueid".
And it didn't support correct response message for
Application originate.

ASTERISK-25624

Change-Id: I26f54f677ccfb0b7cfd4967a844a1657fd69b74d
---
M main/manager.c
1 file changed, 33 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/05/1805/1

diff --git a/main/manager.c b/main/manager.c
index 99c5502..020a2ff 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -4969,22 +4969,39 @@
 	}
 	/* 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) : in->channelid,
+			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) : in->channelid,
+			S_OR(in->cid_num, "<unknown>"),
+			S_OR(in->cid_name, "<unknown>"));
+	}
 
 	/* Locked and ref'd by ast_pbx_outgoing_exten or ast_pbx_outgoing_app */
 	if (chan) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26f54f677ccfb0b7cfd4967a844a1657fd69b74d
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>



More information about the asterisk-code-review mailing list