[asterisk-commits] oej: trunk r338623 - /trunk/main/features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 30 08:21:21 CDT 2011


Author: oej
Date: Fri Sep 30 08:21:17 2011
New Revision: 338623

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=338623
Log:
Preserve DTMF length in main/features.c

Review: https://reviewboard.asterisk.org/r/1463/

A small part of much larger work with DTMF duration in Asterisk, 
funded  by IPvision AS in Denmark.

Thanks to irroot for the review!


Modified:
    trunk/main/features.c

Modified: trunk/main/features.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/features.c?view=diff&rev=338623&r1=338622&r2=338623
==============================================================================
--- trunk/main/features.c (original)
+++ trunk/main/features.c Fri Sep 30 08:21:17 2011
@@ -3908,11 +3908,11 @@
 					   digits to come in for features. */
 					ast_debug(1, "Timed out for feature!\n");
 					if (!ast_strlen_zero(peer_featurecode)) {
-						ast_dtmf_stream(chan, peer, peer_featurecode, 0, 0);
+						ast_dtmf_stream(chan, peer, peer_featurecode, 0, f->len);
 						memset(peer_featurecode, 0, sizeof(peer_featurecode));
 					}
 					if (!ast_strlen_zero(chan_featurecode)) {
-						ast_dtmf_stream(peer, chan, chan_featurecode, 0, 0);
+						ast_dtmf_stream(peer, chan, chan_featurecode, 0, f->len);
 						memset(chan_featurecode, 0, sizeof(chan_featurecode));
 					}
 					if (f)
@@ -4039,6 +4039,7 @@
 		} else if (f->frametype == AST_FRAME_DTMF_END) {
 			char *featurecode;
 			int sense;
+			unsigned int dtmfduration = f->len;
 
 			hadfeatures = hasfeatures;
 			/* This cannot overrun because the longest feature is one shorter than our buffer */
@@ -4072,7 +4073,7 @@
 				res = feature_interpret(chan, peer, config, featurecode, sense);
 				switch(res) {
 				case AST_FEATURE_RETURN_PASSDIGITS:
-					ast_dtmf_stream(other, who, featurecode, 0, 0);
+					ast_dtmf_stream(other, who, featurecode, 0, dtmfduration);
 					/* Fall through */
 				case AST_FEATURE_RETURN_SUCCESS:
 					memset(featurecode, 0, sizeof(chan_featurecode));




More information about the asterisk-commits mailing list