[asterisk-commits] mmichelson: branch mmichelson/more_transfer r387871 - /team/mmichelson/more_t...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 7 17:27:42 CDT 2013


Author: mmichelson
Date: Tue May  7 17:27:40 2013
New Revision: 387871

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387871
Log:
Restore a manager response to the bridge action.


Modified:
    team/mmichelson/more_transfer/main/features.c

Modified: team/mmichelson/more_transfer/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/more_transfer/main/features.c?view=diff&rev=387871&r1=387870&r2=387871
==============================================================================
--- team/mmichelson/more_transfer/main/features.c (original)
+++ team/mmichelson/more_transfer/main/features.c Tue May  7 17:27:40 2013
@@ -7213,6 +7213,8 @@
 	const char *playtone = astman_get_header(m, "Tone");
 	RAII_VAR(struct ast_channel *, chana, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_channel *, chanb, NULL, ao2_cleanup);
+	const char *chana_name;
+	const char *chanb_name;
 	struct ast_bridge *bridge;
 	char buf[256];
 
@@ -7229,6 +7231,7 @@
 		astman_send_error(s, m, buf);
 		return 0;
 	}
+	chana_name = ast_strdupa(ast_channel_name(chana));
 
 	chanb = ast_channel_get_by_name_prefix(channelb, strlen(channelb));
 	if (!chanb) {
@@ -7236,6 +7239,7 @@
 		astman_send_error(s, m, buf);
 		return 0;
 	}
+	chanb_name = ast_strdupa(ast_channel_name(chanb));
 
 	bridge = ast_bridge_basic_new();
 	if (!bridge) {
@@ -7244,20 +7248,17 @@
 	}
 
 	if (add_to_bridge(bridge, chana, NULL, ast_true(playtone))) {
-		snprintf(buf, sizeof(buf), "Unable to add Channel1 to bridge: %s", channela);
+		snprintf(buf, sizeof(buf), "Unable to add Channel1 to bridge: %s", ast_channel_name(chana));
 		astman_send_error(s, m, buf);
 		return 0;
 	}
 
 	if (add_to_bridge(bridge, chanb, NULL, ast_true(playtone))) {
-		snprintf(buf, sizeof(buf), "Unable to add Channel2 to bridge: %s", channelb);
+		snprintf(buf, sizeof(buf), "Unable to add Channel2 to bridge: %s", ast_channel_name(chanb));
 		astman_send_error(s, m, buf);
 		return 0;
 	}
 
-#if 0
-	chans[0] = tmpchana;
-	chans[1] = tmpchanb;
 	/*** DOCUMENTATION
 		<managerEventInstance>
 			<synopsis>Raised when a bridge is successfully created due to a manager action.</synopsis>
@@ -7274,11 +7275,10 @@
 			</see-also>
 		</managerEventInstance>
 	***/
-	ast_manager_event_multichan(EVENT_FLAG_CALL, "BridgeAction", 2, chans,
+	manager_event(EVENT_FLAG_CALL, "BridgeAction",
 				"Response: Success\r\n"
 				"Channel1: %s\r\n"
-				"Channel2: %s\r\n", ast_channel_name(tmpchana), ast_channel_name(tmpchanb));
-#endif
+				"Channel2: %s\r\n", chana_name, chanb_name);
 
 	astman_send_ack(s, m, "Launched bridge thread with success");
 




More information about the asterisk-commits mailing list