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

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


Author: dvossel
Date: Tue Mar 22 15:49:58 2011
New Revision: 311552

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=311552
Log:
Confbridge start and end AMI 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=311552&r1=311551&r2=311552
==============================================================================
--- team/dvossel/hd_confbridge/apps/app_confbridge.c (original)
+++ team/dvossel/hd_confbridge/apps/app_confbridge.c Tue Mar 22 15:49:58 2011
@@ -406,6 +406,48 @@
 	return 0;
 }
 
+static void send_conf_start_event(const char *conf_name)
+{
+	manager_event(EVENT_FLAG_CALL, "ConfbridgeStart", "Conference: %s\r\n", conf_name);
+}
+
+static void send_conf_end_event(const char *conf_name)
+{
+	manager_event(EVENT_FLAG_CALL, "ConfbridgeEnd", "Conference: %s\r\n", conf_name);
+}
+
+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 Announce number of users in the conference bridge to the caller
  *
@@ -684,6 +726,7 @@
 		if (ast_test_flag(&conference_bridge->b_profile, BRIDGE_OPT_RECORD_CONFERENCE)) {
 			start_record = 1;
 		}
+		send_conf_start_event(conference_bridge->name);
 		ast_debug(1, "Created conference bridge '%s' and linked to container '%p'\n", name, conference_bridges);
 	}
 
@@ -792,6 +835,7 @@
 		ast_devstate_changed(AST_DEVICE_NOT_INUSE, "confbridge:%s", conference_bridge->name);
 
 		ao2_unlink(conference_bridges, conference_bridge);
+		send_conf_end_event(conference_bridge->name);
 	}
 
 	/* Done mucking with the conference bridge, huzzah */
@@ -954,38 +998,6 @@
 		return -1;
 	}
 	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 */




More information about the asterisk-commits mailing list