[svn-commits] russell: branch group/vldtmf r40482 - /team/group/vldtmf/channel.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Aug 18 19:50:32 MST 2006


Author: russell
Date: Fri Aug 18 21:50:32 2006
New Revision: 40482

URL: http://svn.digium.com/view/asterisk?rev=40482&view=rev
Log:
ensure there is one voice frame in between emulated DTMF, so that digits
converted into inband are properly recreated as multiple digits as opposed
to one continuous tone

Modified:
    team/group/vldtmf/channel.c

Modified: team/group/vldtmf/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf/channel.c?rev=40482&r1=40481&r2=40482&view=diff
==============================================================================
--- team/group/vldtmf/channel.c (original)
+++ team/group/vldtmf/channel.c Fri Aug 18 21:50:32 2006
@@ -2060,13 +2060,19 @@
 			ast_set_flag(chan, AST_FLAG_IN_DTMF);
 			break;
 		case AST_FRAME_VOICE:
+			/* The EMULATE_DTMF flag must be cleared here as opposed to when the samples
+			 * first get to zero, because we want to make sure we pass at least one
+			 * voice frame through before starting the next digit, to ensure a gap
+			 * between DTMF digits. */
+			if (ast_test_flag(chan, AST_FLAG_EMULATE_DTMF) && !chan->emulate_dtmf_samples)
+				ast_clear_flag(chan, AST_FLAG_EMULATE_DTMF);
+
 			if (dropaudio || ast_test_flag(chan, AST_FLAG_IN_DTMF)) {
 				ast_frfree(f);
 				f = &ast_null_frame;
 			} else if (ast_test_flag(chan, AST_FLAG_EMULATE_DTMF)) {
 				if (f->samples >= chan->emulate_dtmf_samples) {
 					chan->emulate_dtmf_samples = 0;
-					ast_clear_flag(chan, AST_FLAG_EMULATE_DTMF);
 				} else
 					chan->emulate_dtmf_samples -= f->samples;
 				ast_frfree(f);



More information about the svn-commits mailing list