[asterisk-commits] russell: branch 1.4 r61763 - /branches/1.4/main/channel.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Apr 23 10:57:33 MST 2007


Author: russell
Date: Mon Apr 23 12:57:32 2007
New Revision: 61763

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61763
Log:
Ensure that digits passing through Asterisk have a reasonable minimum length.
It is currently 100 ms.  If someone thinks this should be different, feel free
to speak up.  (related to issues #8944, #9250, and #9348)

Modified:
    branches/1.4/main/channel.c

Modified: branches/1.4/main/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/channel.c?view=diff&rev=61763&r1=61762&r2=61763
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Mon Apr 23 12:57:32 2007
@@ -2268,7 +2268,7 @@
 				ast_set_flag(chan, AST_FLAG_EMULATE_DTMF);
 				chan->emulate_dtmf_digit = f->subclass;
 				chan->dtmf_begin_tv = ast_tvnow();
-				if (f->len)
+				if (f->len && f->len > AST_DEFAULT_EMULATE_DTMF_DURATION)
 					chan->emulate_dtmf_duration = f->len;
 				else
 					chan->emulate_dtmf_duration = AST_DEFAULT_EMULATE_DTMF_DURATION;
@@ -2276,6 +2276,12 @@
 				ast_clear_flag(chan, AST_FLAG_IN_DTMF);
 				if (!f->len)
 					f->len = ast_tvdiff_ms(ast_tvnow(), chan->dtmf_begin_tv);
+				if (f->len < AST_DEFAULT_EMULATE_DTMF_DURATION) {
+					ast_set_flag(chan, AST_FLAG_EMULATE_DTMF);
+					chan->emulate_dtmf_digit = f->subclass;
+					chan->emulate_dtmf_duration = AST_DEFAULT_EMULATE_DTMF_DURATION - f->len;
+					f = &ast_null_frame;
+				}
 			}
 			break;
 		case AST_FRAME_DTMF_BEGIN:



More information about the asterisk-commits mailing list