[svn-commits] file: branch file/bridging r106996 - /team/file/bridging/main/bridging.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Mar 8 11:42:32 CST 2008


Author: file
Date: Sat Mar  8 11:42:31 2008
New Revision: 106996

URL: http://svn.digium.com/view/asterisk?view=rev&rev=106996
Log:
When executing a feature hook callback temporarily stop a generator if present and restore it once complete.

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=106996&r1=106995&r2=106996
==============================================================================
--- team/file/bridging/main/bridging.c (original)
+++ team/file/bridging/main/bridging.c Sat Mar  8 11:42:31 2008
@@ -670,9 +670,17 @@
 	struct ast_bridge_features_hook *hook = NULL;
 	char dtmf[8] = "";
 	int look_for_dtmf = 1;
+	void *generatordata;
+	struct ast_generator *generator;
 
 	/* Don't bother with the bridge anymore, it's not going to go away */
 	ast_mutex_unlock(&bridge->lock);
+
+	/* Store any generator information before gathering DTMF and executing the hook */
+	generatordata = bridge_channel->chan->generatordata;
+	generator = bridge_channel->chan->generator;
+	bridge_channel->chan->generatordata = NULL;
+	bridge_channel->chan->generator = NULL;
 
 	/* The channel is now under our control and we don't really want any begin frames to do our DTMF matching so disable 'em at the core level */
 	ast_set_flag(bridge_channel->chan, AST_FLAG_END_DTMF_ONLY);
@@ -720,6 +728,10 @@
 		ast_bridge_dtmf_stream(bridge, dtmf, bridge_channel->chan);
 		bridge_channel->state = AST_BRIDGE_CHANNEL_STATE_WAIT;
 	}
+
+	/* Restore generator if present */
+	bridge_channel->chan->generatordata = generatordata;
+	bridge_channel->chan->generator = generator;
 
 	/* And back into the groove... */
 	ast_mutex_lock(&bridge->lock);




More information about the svn-commits mailing list