[asterisk-commits] kmoore: trunk r395270 - /trunk/main/manager_bridging.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 24 12:49:58 CDT 2013


Author: kmoore
Date: Wed Jul 24 12:49:56 2013
New Revision: 395270

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395270
Log:
Make AMI BridgeInfo action more verbose

Ensure that the BridgeInfo command provides adequate state information
about channels by publishing the full channel snapshot for
BridgeInfoChannel subevents. This prevents a two-stage lookup since
most consumers will be keying on channel names instead of uniqueids.

(closes issue ASTERISK-22140)

Modified:
    trunk/main/manager_bridging.c

Modified: trunk/main/manager_bridging.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager_bridging.c?view=diff&rev=395270&r1=395269&r2=395270
==============================================================================
--- trunk/main/manager_bridging.c (original)
+++ trunk/main/manager_bridging.c Wed Jul 24 12:49:56 2013
@@ -381,6 +381,7 @@
 	char *id_text = data;
 	RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
 	struct ast_channel_snapshot *snapshot;
+	RAII_VAR(struct ast_str *, channel_text, NULL, ast_free);
 	msg = stasis_cache_get(ast_channel_topic_all_cached(),
 		ast_channel_snapshot_type(), uniqueid);
 
@@ -393,12 +394,17 @@
 		return 0;
 	}
 
+	channel_text = ast_manager_build_channel_state_string(snapshot);
+	if (!channel_text) {
+		return 0;
+	}
+
 	astman_append(s,
 		"Event: BridgeInfoChannel\r\n"
-		"Uniqueid: %s\r\n"
+		"%s"
 		"%s"
 		"\r\n",
-		uniqueid,
+		ast_str_buffer(channel_text),
 		id_text);
 	return 0;
 }




More information about the asterisk-commits mailing list