[asterisk-commits] oej: branch oej/moremanager r61757 - in /team/oej/moremanager: ./ apps/ chann...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Apr 22 01:48:06 MST 2007


Author: oej
Date: Sun Apr 22 03:48:03 2007
New Revision: 61757

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61757
Log:
- Starting a cleanup proposal of AMI for 1.6
- Adding and changing manager events, all documented in CHANGES.moremanager
- Based on 1.4 for testing, will be merged into trunk if accepted

This is not the BIG wonderful new manager, just a tiny cleanup so that a channel's name
is always reported as "Channel:" and nothing else.

Also, adding a few events to be able to follow channels better through the processing
and connecting a core call to a channel driver signalling channel (experimenting with
SIP of course).


Added:
    team/oej/moremanager/CHANGES.moremanager   (with props)
Modified:
    team/oej/moremanager/apps/app_dial.c
    team/oej/moremanager/channels/chan_sip.c
    team/oej/moremanager/main/cdr.c
    team/oej/moremanager/main/channel.c
    team/oej/moremanager/main/dnsmgr.c
    team/oej/moremanager/main/enum.c
    team/oej/moremanager/main/manager.c
    team/oej/moremanager/main/rtp.c

Added: team/oej/moremanager/CHANGES.moremanager
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/CHANGES.moremanager?view=auto&rev=61757
==============================================================================
--- team/oej/moremanager/CHANGES.moremanager (added)
+++ team/oej/moremanager/CHANGES.moremanager Sun Apr 22 03:48:03 2007
@@ -1,0 +1,35 @@
+- Manager events Newstate and Newchannel have changed headers
+	"State"		-> ChannelStateDesc	Text based channel state
+			-> ChannelState		Numeric channel state
+	- The events does not send "<unknown>" for unknown caller IDs just an empty field
+
+- Newstate now has "CalleridNum" for numeric caller id, like Newchannel
+	- The event does not send "<unknown>" for unknown caller IDs just an empty field
+
+- Event Dial has new headers, to comply with other events
+	- Source	-> Channel		Channel name (caller)
+	- SrcUniqueID	-> UniqueID		Uniqueid
+	(new)		-> Dialstring		Dialstring in app data
+
+- The "Link" and "Unlink" bridge events in channel.c are now renamed to "Bridge"
+	- The link state is in the bridgestate: header as "Link" or "Unlink"
+	- For channel.c bridges, "Bridgetype: core" is added. This opens up for
+	  bridge events in rtp.c 
+	- The RTP channel also reports Bridge: events with bridgetypes
+		- rtp-native	RTP native bridge
+		- rtp-direct	RTP peer-2-peer bridge (NAT support only)
+		- rtp-remote	Remote (re-invite) bridge. (Not reported yet)
+
+- The "Rename" manager event has a renamed header, to use the same
+	terminology for the current channel as other events
+	- Oldname	-> Channel		
+
+- The "NewCallerID" manager event has a renamed header
+	- CallerID	-> CallerIDnum
+	- The event does not send "<unknown>" for unknown caller IDs just an empty field
+	
+- The "Reload" event sent at manager reload now has a new header
+	(new)		-> Module: manager | CDR | DNSmgr | RTP | ENUM
+	(new)		-> Status: enabled | disabled
+	- To support reload events from other modules too
+		- cdr module added

Propchange: team/oej/moremanager/CHANGES.moremanager
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/oej/moremanager/CHANGES.moremanager
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/oej/moremanager/CHANGES.moremanager
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: team/oej/moremanager/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/apps/app_dial.c?view=diff&rev=61757&r1=61756&r2=61757
==============================================================================
--- team/oej/moremanager/apps/app_dial.c (original)
+++ team/oej/moremanager/apps/app_dial.c Sun Apr 22 03:48:03 2007
@@ -374,19 +374,20 @@
 	return ast_get_hint(NULL, 0, name, namelen, chan, context, exten) ? name : "";
 }
 
-static void senddialevent(struct ast_channel *src, struct ast_channel *dst)
+static void senddialevent(struct ast_channel *src, struct ast_channel *dst, char *dialstring)
 {
 	/* XXX do we need also CallerIDnum ? */
 	manager_event(EVENT_FLAG_CALL, "Dial", 
-			   "Source: %s\r\n"
+			   "Channel: %s\r\n"
 			   "Destination: %s\r\n"
 			   "CallerID: %s\r\n"
 			   "CallerIDName: %s\r\n"
-			   "SrcUniqueID: %s\r\n"
-			   "DestUniqueID: %s\r\n",
+			   "UniqueID: %s\r\n"
+			   "DestUniqueID: %s\r\n"
+			   "Dialstring: %s\r\n",
 			   src->name, dst->name, S_OR(src->cid.cid_num, "<unknown>"),
 			   S_OR(src->cid.cid_name, "<unknown>"), src->uniqueid,
-			   dst->uniqueid);
+			   dst->uniqueid, dialstring ? dialstring : "");
 }
 
 static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_localuser *outgoing, int *to, struct ast_flags *peerflags, int *sentringing, char *status, size_t statussize, int busystart, int nochanstart, int congestionstart, int priority_jump, int *result)
@@ -546,7 +547,7 @@
 						c = o->chan = NULL;
 						numnochan++;
 					} else {
-						senddialevent(in, c);
+						senddialevent(in, c, stuff);
 						/* After calling, set callerid to extension */
 						if (!ast_test_flag(peerflags, OPT_ORIGINAL_CLID)) {
 							char cidname[AST_MAX_EXTENSION];
@@ -1223,7 +1224,7 @@
 			free(tmp);
 			continue;
 		} else {
-			senddialevent(chan, tmp->chan);
+			senddialevent(chan, tmp->chan, numsubst);
 			if (option_verbose > 2)
 				ast_verbose(VERBOSE_PREFIX_3 "Called %s\n", numsubst);
 			if (!ast_test_flag(peerflags, OPT_ORIGINAL_CLID))

Modified: team/oej/moremanager/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/channels/chan_sip.c?view=diff&rev=61757&r1=61756&r2=61757
==============================================================================
--- team/oej/moremanager/channels/chan_sip.c (original)
+++ team/oej/moremanager/channels/chan_sip.c Sun Apr 22 03:48:03 2007
@@ -3469,6 +3469,9 @@
 			res = transmit_response_with_t38_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL);
 		} else 
 			res = transmit_response_with_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL);
+		manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
+			"Channel: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\n",
+			ast->name, "SIP", p->callid, p->fullcontact);
 	}
 	ast_mutex_unlock(&p->lock);
 	return res;
@@ -11811,6 +11814,9 @@
 		if (!ast_test_flag(req, SIP_PKT_IGNORE) && p->owner) {
 			if (!reinvite) {
 				ast_queue_control(p->owner, AST_CONTROL_ANSWER);
+				manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
+					"Channel: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
+					p->owner->name, "SIP", p->callid, p->fullcontact, p->peername);
 			} else {	/* RE-invite */
 				ast_queue_frame(p->owner, &ast_null_frame);
 			}
@@ -15438,6 +15444,9 @@
 	p->prefcodec = oldformat;				/* Format for this call */
 	ast_mutex_lock(&p->lock);
 	tmpc = sip_new(p, AST_STATE_DOWN, host);	/* Place the call */
+	manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
+		"Channel: %s\r\nChanneltype: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
+		p->owner? p->owner->name : "", "SIP", p->callid, p->fullcontact, p->peername);
 	ast_mutex_unlock(&p->lock);
 	if (!tmpc)
 		sip_destroy(p);

Modified: team/oej/moremanager/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/main/cdr.c?view=diff&rev=61757&r1=61756&r2=61757
==============================================================================
--- team/oej/moremanager/main/cdr.c (original)
+++ team/oej/moremanager/main/cdr.c Sun Apr 22 03:48:03 2007
@@ -46,6 +46,7 @@
 #include "asterisk/cdr.h"
 #include "asterisk/logger.h"
 #include "asterisk/callerid.h"
+#include "asterisk/manager.h"
 #include "asterisk/causes.h"
 #include "asterisk/options.h"
 #include "asterisk/linkedlists.h"
@@ -1323,6 +1324,7 @@
 
 	ast_mutex_unlock(&cdr_batch_lock);
 	ast_config_destroy(config);
+	manager_event(EVENT_FLAG_SYSTEM, "Reload", "Module: CDR\r\nMessage: CDR subsystem reload requested\r\n");
 
 	return res;
 }

Modified: team/oej/moremanager/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/main/channel.c?view=diff&rev=61757&r1=61756&r2=61757
==============================================================================
--- team/oej/moremanager/main/channel.c (original)
+++ team/oej/moremanager/main/channel.c Sun Apr 22 03:48:03 2007
@@ -813,13 +813,14 @@
 		 */
 		manager_event(EVENT_FLAG_CALL, "Newchannel",
 			      "Channel: %s\r\n"
-			      "State: %s\r\n"
+			      "ChannelState: %d\r\n"
+			      "ChannelStateDesc: %s\r\n"
 			      "CallerIDNum: %s\r\n"
 			      "CallerIDName: %s\r\n"
 			      "Uniqueid: %s\r\n",
-			      tmp->name, ast_state2str(state),
-			      S_OR(cid_num, "<unknown>"),
-			      S_OR(cid_name, "<unknown>"),
+			      tmp->name, state, ast_state2str(state),
+			      S_OR(cid_num, ""),
+			      S_OR(cid_name, ""),
 			      tmp->uniqueid);
 	}
 
@@ -3297,7 +3298,7 @@
 
 void ast_change_name(struct ast_channel *chan, char *newname)
 {
-	manager_event(EVENT_FLAG_CALL, "Rename", "Oldname: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", chan->name, newname, chan->uniqueid);
+	manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", chan->name, newname, chan->uniqueid);
 	ast_string_field_set(chan, name, newname);
 }
 
@@ -3441,8 +3442,8 @@
 	ast_string_field_set(clone, name, masqn);
 	
 	/* Notify any managers of the change, first the masq then the other */
-	manager_event(EVENT_FLAG_CALL, "Rename", "Oldname: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", newn, masqn, clone->uniqueid);
-	manager_event(EVENT_FLAG_CALL, "Rename", "Oldname: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", orig, newn, original->uniqueid);
+	manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", newn, masqn, clone->uniqueid);
+	manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", orig, newn, original->uniqueid);
 
 	/* Swap the technologies */	
 	t = original->tech;
@@ -3546,7 +3547,7 @@
 	snprintf(zombn, sizeof(zombn), "%s<ZOMBIE>", orig);
 	/* Mangle the name of the clone channel */
 	ast_string_field_set(clone, name, zombn);
-	manager_event(EVENT_FLAG_CALL, "Rename", "Oldname: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", masqn, zombn, clone->uniqueid);
+	manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", masqn, zombn, clone->uniqueid);
 
 	/* Update the type. */
 	t_pvt = original->monitor;
@@ -3686,13 +3687,13 @@
 		ast_cdr_setcid(chan->cdr, chan);
 	manager_event(EVENT_FLAG_CALL, "Newcallerid",
 				"Channel: %s\r\n"
-				"CallerID: %s\r\n"
-				"CallerIDName: %s\r\n"
+				"CallerIDnum: %s\r\n"
+				"CallerIDname: %s\r\n"
 				"Uniqueid: %s\r\n"
 				"CID-CallingPres: %d (%s)\r\n",
 				chan->name,
-				S_OR(chan->cid.cid_num, "<Unknown>"),
-				S_OR(chan->cid.cid_name, "<Unknown>"),
+		      		S_OR(chan->cid.cid_num, ""),
+		      		S_OR(chan->cid.cid_name, ""),
 				chan->uniqueid,
 				chan->cid.cid_pres,
 				ast_describe_caller_presentation(chan->cid.cid_pres)
@@ -3707,19 +3708,20 @@
 		return 0;
 
 	chan->_state = state;
+	/* setstate used to conditionally report Newchannel; this is no more */
+	manager_event(EVENT_FLAG_CALL, "Newstate",
+		      "Channel: %s\r\n"
+		      "ChannelState: %d\r\n"
+		      "ChannelStateDesc: %s\r\n"
+		      "CallerIDnum: %s\r\n"
+		      "CallerIDname: %s\r\n"
+		      "Uniqueid: %s\r\n",
+		      chan->name, state, ast_state2str(state),
+		      S_OR(chan->cid.cid_num, ""),
+		      S_OR(chan->cid.cid_name, ""),
+		      chan->uniqueid);
+
 	ast_device_state_changed_literal(chan->name);
-	/* setstate used to conditionally report Newchannel; this is no more */
-	manager_event(EVENT_FLAG_CALL,
-		      "Newstate",
-		      "Channel: %s\r\n"
-		      "State: %s\r\n"
-		      "CallerID: %s\r\n"
-		      "CallerIDName: %s\r\n"
-		      "Uniqueid: %s\r\n",
-		      chan->name, ast_state2str(chan->_state),
-		      S_OR(chan->cid.cid_num, "<unknown>"),
-		      S_OR(chan->cid.cid_name, "<unknown>"),
-		      chan->uniqueid);
 
 	return 0;
 }
@@ -3913,6 +3915,27 @@
 	return res;
 }
 
+/*! \brief Send manager event for bridge link and unlink events.
+	\param type	1 for core, 2 for native
+*/
+static void manager_bridge_event(int onoff, int type, struct ast_channel *c0, struct ast_channel *c1)
+{
+	manager_event(EVENT_FLAG_CALL, "Bridge",
+			"Bridgestate: %s\r\n"
+		     "Bridgetype: %s\r\n"
+		      "Channel1: %s\r\n"
+		      "Channel2: %s\r\n"
+		      "Uniqueid1: %s\r\n"
+		      "Uniqueid2: %s\r\n"
+		      "CallerID1: %s\r\n"
+		      "CallerID2: %s\r\n",
+			onoff ? "Link" : "Unlink",
+			type == 1 ? "core" : "native",
+			c0->name, c1->name, c0->uniqueid, c1->uniqueid, 
+			S_OR(c0->cid.cid_num, ""), 
+			S_OR(c1->cid.cid_num, ""));
+}
+
 /*! \brief Bridge two channels together */
 enum ast_bridge_result ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1,
 					  struct ast_bridge_config *config, struct ast_frame **fo, struct ast_channel **rc)
@@ -3966,15 +3989,6 @@
 	c0->_bridge = c1;
 	c1->_bridge = c0;
 
-	/* \todo  XXX here should check that cid_num is not NULL */
-	manager_event(EVENT_FLAG_CALL, "Link",
-		      "Channel1: %s\r\n"
-		      "Channel2: %s\r\n"
-		      "Uniqueid1: %s\r\n"
-		      "Uniqueid2: %s\r\n"
-		      "CallerID1: %s\r\n"
-		      "CallerID2: %s\r\n",
-		      c0->name, c1->name, c0->uniqueid, c1->uniqueid, c0->cid.cid_num, c1->cid.cid_num);
 
 	o0nativeformats = c0->nativeformats;
 	o1nativeformats = c1->nativeformats;
@@ -3991,6 +4005,7 @@
 		ast_set_flag(c1, AST_FLAG_END_DTMF_ONLY);
 	if (!c1->tech->send_digit_begin)
 		ast_set_flag(c0, AST_FLAG_END_DTMF_ONLY);
+	manager_bridge_event(1, 1, c0, c1);
 
 	for (/* ever */;;) {
 		struct timeval now = { 0, };
@@ -4081,15 +4096,7 @@
 			ast_set_flag(c0, AST_FLAG_NBRIDGE);
 			ast_set_flag(c1, AST_FLAG_NBRIDGE);
 			if ((res = c0->tech->bridge(c0, c1, config->flags, fo, rc, to)) == AST_BRIDGE_COMPLETE) {
-				/* \todo  XXX here should check that cid_num is not NULL */
-				manager_event(EVENT_FLAG_CALL, "Unlink",
-					      "Channel1: %s\r\n"
-					      "Channel2: %s\r\n"
-					      "Uniqueid1: %s\r\n"
-					      "Uniqueid2: %s\r\n"
-					      "CallerID1: %s\r\n"
-					      "CallerID2: %s\r\n",
-					      c0->name, c1->name, c0->uniqueid, c1->uniqueid, c0->cid.cid_num, c1->cid.cid_num);
+				manager_bridge_event(0, 2, c0, c1);
 				if (option_debug)
 					ast_log(LOG_DEBUG, "Returning from native bridge, channels: %s, %s\n", c0->name, c1->name);
 
@@ -4126,15 +4133,7 @@
 		    !(c0->generator || c1->generator)) {
 			if (ast_channel_make_compatible(c0, c1)) {
 				ast_log(LOG_WARNING, "Can't make %s and %s compatible\n", c0->name, c1->name);
-				/* \todo  XXX here should check that cid_num is not NULL */
-                                manager_event(EVENT_FLAG_CALL, "Unlink",
-					      "Channel1: %s\r\n"
-					      "Channel2: %s\r\n"
-					      "Uniqueid1: %s\r\n"
-					      "Uniqueid2: %s\r\n"
-					      "CallerID1: %s\r\n"
-					      "CallerID2: %s\r\n",
-					      c0->name, c1->name, c0->uniqueid, c1->uniqueid, c0->cid.cid_num, c1->cid.cid_num);
+				manager_bridge_event(0, 1, c0, c1);
 				return AST_BRIDGE_FAILED;
 			}
 			o0nativeformats = c0->nativeformats;
@@ -4152,14 +4151,7 @@
 	c1->_bridge = NULL;
 
 	/* \todo  XXX here should check that cid_num is not NULL */
-	manager_event(EVENT_FLAG_CALL, "Unlink",
-		      "Channel1: %s\r\n"
-		      "Channel2: %s\r\n"
-		      "Uniqueid1: %s\r\n"
-		      "Uniqueid2: %s\r\n"
-		      "CallerID1: %s\r\n"
-		      "CallerID2: %s\r\n",
-		      c0->name, c1->name, c0->uniqueid, c1->uniqueid, c0->cid.cid_num, c1->cid.cid_num);
+	manager_bridge_event(0, 0, c0, c1);
 	if (option_debug)
 		ast_log(LOG_DEBUG, "Bridge stops bridging channels %s and %s\n", c0->name, c1->name);
 

Modified: team/oej/moremanager/main/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/main/dnsmgr.c?view=diff&rev=61757&r1=61756&r2=61757
==============================================================================
--- team/oej/moremanager/main/dnsmgr.c (original)
+++ team/oej/moremanager/main/dnsmgr.c Sun Apr 22 03:48:03 2007
@@ -47,6 +47,7 @@
 #include "asterisk/sched.h"
 #include "asterisk/options.h"
 #include "asterisk/cli.h"
+#include "asterisk/manager.h"
 
 static struct sched_context *sched;
 static int refresh_sched = -1;
@@ -415,6 +416,7 @@
 		res = 0;
 
 	ast_mutex_unlock(&refresh_lock);
+	manager_event(EVENT_FLAG_SYSTEM, "Reload", "Module: DNSmgr\r\nStatus: %s\r/nMessage: DNSmgr reload Requested\r\n", enabled ? "Enabled" : "Disabled");
 
 	return res;
 }

Modified: team/oej/moremanager/main/enum.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/main/enum.c?view=diff&rev=61757&r1=61756&r2=61757
==============================================================================
--- team/oej/moremanager/main/enum.c (original)
+++ team/oej/moremanager/main/enum.c Sun Apr 22 03:48:03 2007
@@ -66,6 +66,7 @@
 #include "asterisk/channel.h"
 #include "asterisk/config.h"
 #include "asterisk/utils.h"
+#include "asterisk/manager.h"
 
 #ifdef __APPLE__
 #undef T_NAPTR
@@ -662,6 +663,7 @@
 	}
 	enumver++;
 	ast_mutex_unlock(&enumlock);
+	manager_event(EVENT_FLAG_SYSTEM, "Reload", "Module: Enum\r\nStatus: Enabled\r\nMessage: ENUM reload Requested\r\n");
 	return 0;
 }
 

Modified: team/oej/moremanager/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/main/manager.c?view=diff&rev=61757&r1=61756&r2=61757
==============================================================================
--- team/oej/moremanager/main/manager.c (original)
+++ team/oej/moremanager/main/manager.c Sun Apr 22 03:48:03 2007
@@ -2883,6 +2883,8 @@
 	if (newhttptimeout > 0)
 		httptimeout = newhttptimeout;
 
+	manager_event(EVENT_FLAG_SYSTEM, "Reload", "Module: Manager\r\nStatus: %s\r\nMessage: Manager reload Requested\r\n", enabled ? "Enabled" : "Disabled");
+
 	/* If not enabled, do nothing */
 	if (!enabled)
 		return 0;
@@ -2917,6 +2919,5 @@
 
 int reload_manager(void)
 {
-	manager_event(EVENT_FLAG_SYSTEM, "Reload", "Message: Reload Requested\r\n");
 	return init_manager();
 }

Modified: team/oej/moremanager/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/oej/moremanager/main/rtp.c?view=diff&rev=61757&r1=61756&r2=61757
==============================================================================
--- team/oej/moremanager/main/rtp.c (original)
+++ team/oej/moremanager/main/rtp.c Sun Apr 22 03:48:03 2007
@@ -56,6 +56,7 @@
 #include "asterisk/cli.h"
 #include "asterisk/unaligned.h"
 #include "asterisk/utils.h"
+#include "asterisk/manager.h"
 
 #define MAX_TIMESTAMP_SKEW	640
 
@@ -3163,6 +3164,28 @@
 	return res;
 }
 
+/*! \brief Send manager event for bridge link and unlink events.
+	\param type	3 for nativertp, 4 for p2p, 5 for remote (redirect)
+*/
+static void manager_bridge_event(int onoff, int type, struct ast_channel *c0, struct ast_channel *c1)
+{
+	manager_event(EVENT_FLAG_CALL, "Bridge",
+			"Bridgestate: %s\r\n"
+		     "Bridgetype: %s\r\n"
+		      "Channel1: %s\r\n"
+		      "Channel2: %s\r\n"
+		      "Uniqueid1: %s\r\n"
+		      "Uniqueid2: %s\r\n"
+		      "CallerID1: %s\r\n"
+		      "CallerID2: %s\r\n",
+			onoff ? "Link" : "Unlink",
+			type == 3 ? "rtp-native" : (type == 4 ? "rtp-direct" : "rtp-remote"),	
+			c0->name, c1->name, c0->uniqueid, c1->uniqueid, 
+			S_OR(c0->cid.cid_num, ""), 
+			S_OR(c1->cid.cid_num, ""));
+}
+
+
 /*! \brief Bridge calls. If possible and allowed, initiate
 	re-invite so the peers exchange media directly outside 
 	of Asterisk. */
@@ -3290,10 +3313,12 @@
 		}
 		if (option_verbose > 2)
 			ast_verbose(VERBOSE_PREFIX_3 "Packet2Packet bridging %s and %s\n", c0->name, c1->name);
+		manager_bridge_event(1, 4, c0, c1);
 		res = bridge_p2p_loop(c0, c1, p0, p1, timeoutms, flags, fo, rc, pvt0, pvt1);
 	} else {
 		if (option_verbose > 2) 
 			ast_verbose(VERBOSE_PREFIX_3 "Native bridging %s and %s\n", c0->name, c1->name);
+		manager_bridge_event(1, 3, c0, c1);
 		res = bridge_native_loop(c0, c1, p0, p1, vp0, vp1, pr0, pr1, codec0, codec1, timeoutms, flags, fo, rc, pvt0, pvt1);
 	}
 
@@ -3679,6 +3704,7 @@
 	}
 	if (option_verbose > 1)
 		ast_verbose(VERBOSE_PREFIX_2 "RTP Allocating from port range %d -> %d\n", rtpstart, rtpend);
+	manager_event(EVENT_FLAG_SYSTEM, "Reload", "Module: RTP\r\nStatus: Enabled\r\nMessage: RTP reload Requested\r\n");
 	return 0;
 }
 



More information about the asterisk-commits mailing list