[asterisk-commits] oej: branch oej/bring-in-the-early-media-1.8 r314046 - in /team/oej/bring-in-...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 18 09:26:12 CDT 2011


Author: oej
Date: Mon Apr 18 09:26:10 2011
New Revision: 314046

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=314046
Log:
manager progress events for 1.8

Modified:
    team/oej/bring-in-the-early-media-1.8/apps/app_dial.c
    team/oej/bring-in-the-early-media-1.8/main/pbx.c

Modified: team/oej/bring-in-the-early-media-1.8/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/bring-in-the-early-media-1.8/apps/app_dial.c?view=diff&rev=314046&r1=314045&r2=314046
==============================================================================
--- team/oej/bring-in-the-early-media-1.8/apps/app_dial.c (original)
+++ team/oej/bring-in-the-early-media-1.8/apps/app_dial.c Mon Apr 18 09:26:10 2011
@@ -786,6 +786,26 @@
 		"UniqueID: %s\r\n"
 		"DialStatus: %s\r\n",
 		src->name, src->uniqueid, dialstatus);
+}
+
+/*! \brief Send manager progress event */
+static void dial_manager_progress_event(struct ast_channel *chan)
+{
+	if (chan->_state == AST_STATE_UP) {
+		return;
+	}
+
+	manager_event(EVENT_FLAG_CALL,
+      		"Newstate",
+     		"Channel: %s\r\n"
+      		"State: progress\r\n"
+      		"CallerID: %s\r\n"
+      		"CallerIDName: %s\r\n"
+      		"Uniqueid: %s\r\n",
+      		chan->name, 
+		S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"),
+		S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, "<unknown>"),
+      		chan->uniqueid);
 }
 
 /*!
@@ -1241,6 +1261,8 @@
 					break;
 				case AST_CONTROL_PROGRESS:
 					ast_verb(3, "%s is making progress passing it to %s\n", c->name, in->name);
+					dial_manager_progress_event(c);
+					dial_manager_progress_event(in);
 					/* Setup early media if appropriate */
 					if (single && CAN_EARLY_BRIDGE(peerflags, in, c))
 						ast_channel_early_bridge(in, c);

Modified: team/oej/bring-in-the-early-media-1.8/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/bring-in-the-early-media-1.8/main/pbx.c?view=diff&rev=314046&r1=314045&r2=314046
==============================================================================
--- team/oej/bring-in-the-early-media-1.8/main/pbx.c (original)
+++ team/oej/bring-in-the-early-media-1.8/main/pbx.c Mon Apr 18 09:26:10 2011
@@ -8912,6 +8912,20 @@
  */
 static int pbx_builtin_progress(struct ast_channel *chan, const char *data)
 {
+	if (chan->_state != AST_STATE_UP) {
+		manager_event(EVENT_FLAG_CALL,
+			"Newstate",
+			"Channel: %s\r\n"
+			"State: Progress\r\n"
+			"CallerID: %s\r\n"
+			"CallerIDName: %s\r\n"
+		      	"Uniqueid: %s\r\n",
+		      	chan->name, 
+			S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, "<unknown>"),
+			S_COR(chan->caller.id.name.valid, chan->caller.id.name.str, "<unknown>"),
+		      	chan->uniqueid);
+	}
+
 	ast_indicate(chan, AST_CONTROL_PROGRESS);
 	return 0;
 }




More information about the asterisk-commits mailing list