[asterisk-commits] branch oej/rtptiming r16464 - /team/oej/rtptiming/channel.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Mar 29 22:41:21 MST 2006


Author: oej
Date: Wed Mar 29 23:41:20 2006
New Revision: 16464

URL: http://svn.digium.com/view/asterisk?rev=16464&view=rev
Log:
Re-instate some old code for resetting phase lock mode

Modified:
    team/oej/rtptiming/channel.c

Modified: team/oej/rtptiming/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/rtptiming/channel.c?rev=16464&r1=16463&r2=16464&view=diff
==============================================================================
--- team/oej/rtptiming/channel.c (original)
+++ team/oej/rtptiming/channel.c Wed Mar 29 23:41:20 2006
@@ -1978,11 +1978,17 @@
 
 				/* Run generator sitting on the line if timing device not available
 				* and synchronous generation of outgoing frames is necessary       */
-				if (f && (f->frametype == AST_FRAME_VOICE) && chan->generatordata && !ast_internal_timing_enabled(chan)) {
+				if (chan->generatordata &&  !ast_internal_timing_enabled(chan)) {
 					void *tmp;
 					int res;
 					int (*generate)(struct ast_channel *chan, void *tmp, int datalen, int samples);
-					
+
+					if (chan->timingfunc) {
+						if (option_debug)
+							ast_log(LOG_DEBUG, "Generator got voice, switching to phase locked mode\n");
+						ast_settimeout(chan, 0, NULL, NULL);
+					}
+
 					tmp = chan->generatordata;
 					chan->generatordata = NULL;
 					generate = chan->generator->generate;
@@ -1993,6 +1999,7 @@
 							ast_log(LOG_DEBUG, "Auto-deactivating generator\n");
 						ast_deactivate_generator(chan);
 					}
+
 				} else if (f->frametype == AST_FRAME_CNG) {
 					if (chan->generator && !chan->timingfunc && (chan->timingfd > -1)) {
 						ast_log(LOG_DEBUG, "Generator got CNG, switching to timed mode\n");



More information about the asterisk-commits mailing list