[asterisk-commits] dvossel: branch dvossel/hd_confbridge r311551 - /team/dvossel/hd_confbridge/a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 22 15:42:36 CDT 2011


Author: dvossel
Date: Tue Mar 22 15:42:33 2011
New Revision: 311551

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=311551
Log:
Confbridge AMI join and leave events

Modified:
    team/dvossel/hd_confbridge/apps/app_confbridge.c

Modified: team/dvossel/hd_confbridge/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/hd_confbridge/apps/app_confbridge.c?view=diff&rev=311551&r1=311550&r2=311551
==============================================================================
--- team/dvossel/hd_confbridge/apps/app_confbridge.c (original)
+++ team/dvossel/hd_confbridge/apps/app_confbridge.c Tue Mar 22 15:42:33 2011
@@ -956,6 +956,38 @@
 	return 0;
 }
 
+static void send_join_event(struct ast_channel *chan, const char *conf_name)
+{
+	ast_manager_event(chan, EVENT_FLAG_CALL, "ConfbridgeJoin",
+		"Channel: %s\r\n"
+		"Uniqueid: %s\r\n"
+		"Conference: %s\r\n"
+		"CallerIDnum: %s\r\n"
+		"CallerIDname: %s\r\n",
+		chan->name,
+		chan->uniqueid,
+		conf_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>")
+	);
+}
+
+static void send_leave_event(struct ast_channel *chan, const char *conf_name)
+{
+	ast_manager_event(chan, EVENT_FLAG_CALL, "ConfbridgeLeave",
+		"Channel: %s\r\n"
+		"Uniqueid: %s\r\n"
+		"Conference: %s\r\n"
+		"CallerIDnum: %s\r\n"
+		"CallerIDname: %s\r\n",
+		chan->name,
+		chan->uniqueid,
+		conf_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>")
+	);
+}
+
 /*! \brief The ConfBridge application */
 static int confbridge_exec(struct ast_channel *chan, const char *data)
 {
@@ -1102,11 +1134,13 @@
 	}
 
 	/* Join our conference bridge for real */
+	send_join_event(conference_bridge_user.chan, conference_bridge->name);
 	ast_bridge_join(conference_bridge->bridge,
 		chan,
 		NULL,
 		&conference_bridge_user.features,
 		&conference_bridge_user.tech_args);
+	send_leave_event(conference_bridge_user.chan, conference_bridge->name);
 
 	/* if this user has a intro, play it when leaving */
 	if (!quiet && !ast_strlen_zero(conference_bridge_user.name_rec_location)) {




More information about the asterisk-commits mailing list