[asterisk-commits] russell: branch group/vldtmf r40486 - in /team/group/vldtmf: ./ include/aster...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Aug 18 20:23:40 MST 2006


Author: russell
Date: Fri Aug 18 22:23:39 2006
New Revision: 40486

URL: http://svn.digium.com/view/asterisk?rev=40486&view=rev
Log:
actually send a DTMF_END when doing DTMF compensation

Modified:
    team/group/vldtmf/.cleancount
    team/group/vldtmf/channel.c
    team/group/vldtmf/include/asterisk/channel.h

Modified: team/group/vldtmf/.cleancount
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf/.cleancount?rev=40486&r1=40485&r2=40486&view=diff
==============================================================================
--- team/group/vldtmf/.cleancount (original)
+++ team/group/vldtmf/.cleancount Fri Aug 18 22:23:39 2006
@@ -1,1 +1,1 @@
-22
+23

Modified: team/group/vldtmf/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf/channel.c?rev=40486&r1=40485&r2=40486&view=diff
==============================================================================
--- team/group/vldtmf/channel.c (original)
+++ team/group/vldtmf/channel.c Fri Aug 18 22:23:39 2006
@@ -1921,6 +1921,7 @@
 		memmove(chan->dtmfq, chan->dtmfq + 1, sizeof(chan->dtmfq) - 1);
 		f = &chan->dtmff;
 		ast_set_flag(chan, AST_FLAG_EMULATE_DTMF);
+		chan->emulate_dtmf_digit = f->subclass;
 		chan->emulate_dtmf_samples = AST_DEFAULT_EMULATE_DTMF_SAMPLES;
 		goto done;
 	}
@@ -2047,6 +2048,7 @@
 			} else if (!ast_test_flag(chan, AST_FLAG_IN_DTMF)) {
 				f->frametype = AST_FRAME_DTMF_BEGIN;
 				ast_set_flag(chan, AST_FLAG_EMULATE_DTMF);
+				chan->emulate_dtmf_digit = f->subclass;
 				if (f->samples)
 					chan->emulate_dtmf_samples = f->samples;
 				else
@@ -2063,8 +2065,10 @@
 			 * 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)
+			if (ast_test_flag(chan, AST_FLAG_EMULATE_DTMF) && !chan->emulate_dtmf_samples) {
 				ast_clear_flag(chan, AST_FLAG_EMULATE_DTMF);
+				chan->emulate_dtmf_digit = 0;
+			}
 
 			if (dropaudio || ast_test_flag(chan, AST_FLAG_IN_DTMF)) {
 				ast_frfree(f);
@@ -2072,10 +2076,13 @@
 			} else if (ast_test_flag(chan, AST_FLAG_EMULATE_DTMF)) {
 				if (f->samples >= chan->emulate_dtmf_samples) {
 					chan->emulate_dtmf_samples = 0;
-				} else
+					f->frametype = AST_FRAME_DTMF_END;
+					f->subclass = chan->emulate_dtmf_digit;
+				} else {
 					chan->emulate_dtmf_samples -= f->samples;
-				ast_frfree(f);
-				f = &ast_null_frame;
+					ast_frfree(f);
+					f = &ast_null_frame;
+				}
 			} else if (!(f->subclass & chan->nativeformats)) {
 				/* This frame can't be from the current native formats -- drop it on the
 				   floor */

Modified: team/group/vldtmf/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/group/vldtmf/include/asterisk/channel.h?rev=40486&r1=40485&r2=40486&view=diff
==============================================================================
--- team/group/vldtmf/include/asterisk/channel.h (original)
+++ team/group/vldtmf/include/asterisk/channel.h Fri Aug 18 22:23:39 2006
@@ -425,6 +425,7 @@
 	
 	struct ast_jb jb;				/*!< The jitterbuffer state  */
 
+	char emulate_dtmf_digit;			/*!< Digit being emulated */
 	unsigned int emulate_dtmf_samples;		/*!< Number of samples left to emulate DTMF for */
 
 	/*! \brief Data stores on the channel */



More information about the asterisk-commits mailing list