[asterisk-commits] file: branch file/bridging r106322 - /team/file/bridging/main/bridging.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 5 19:54:34 CST 2008


Author: file
Date: Wed Mar  5 19:54:33 2008
New Revision: 106322

URL: http://svn.digium.com/view/asterisk?view=rev&rev=106322
Log:
Knock another item off my list. Make sure formats are returned to what they were after executing a feature hook callback.

Modified:
    team/file/bridging/main/bridging.c

Modified: team/file/bridging/main/bridging.c
URL: http://svn.digium.com/view/asterisk/team/file/bridging/main/bridging.c?view=diff&rev=106322&r1=106321&r2=106322
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Wed Mar  5 19:54:33 2008
@@ -705,7 +705,11 @@
 
 	/* If a hook was actually matched execute it on this channel, otherwise stream up the DTMF to the other channels */
 	if (hook) {
+		int formats[2] = {bridge_channel->chan->readformat, bridge_channel->chan->writeformat};
 		hook->callback(bridge, bridge_channel);
+		/* Ensure that formats are restored to the expected ones after this feature hook executes */
+		ast_set_read_format(bridge_channel->chan, formats[0]);
+		ast_set_write_format(bridge_channel->chan, formats[1]);
 	} else {
 		ast_bridge_dtmf_stream(bridge, dtmf, bridge_channel->chan);
 		bridge_channel->state = AST_BRIDGE_CHANNEL_STATE_WAIT;




More information about the asterisk-commits mailing list