[asterisk-commits] file: trunk r78276 - in /trunk: ./ main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 6 16:43:10 CDT 2007


Author: file
Date: Mon Aug  6 16:43:09 2007
New Revision: 78276

URL: http://svn.digium.com/view/asterisk?view=rev&rev=78276
Log:
Merged revisions 78275 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r78275 | file | 2007-08-06 18:41:13 -0300 (Mon, 06 Aug 2007) | 2 lines

Add additional DTMF log messages to help when debugging issues.

........

Modified:
    trunk/   (props changed)
    trunk/main/channel.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=78276&r1=78275&r2=78276
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Mon Aug  6 16:43:09 2007
@@ -2277,9 +2277,10 @@
 			 * However, only let emulation be forced if the other end cares about BEGIN frames */
 			if ( ast_test_flag(chan, AST_FLAG_DEFER_DTMF) ||
 				(ast_test_flag(chan, AST_FLAG_EMULATE_DTMF) && !ast_test_flag(chan, AST_FLAG_END_DTMF_ONLY)) ) {
-				if (strlen(chan->dtmfq) < sizeof(chan->dtmfq) - 2)
+				if (strlen(chan->dtmfq) < sizeof(chan->dtmfq) - 2) {
+					ast_log(LOG_DTMF, "DTMF end '%c' put into dtmf queue on %s\n", f->subclass, chan->name);
 					chan->dtmfq[strlen(chan->dtmfq)] = f->subclass;
-				else
+				} else
 					ast_log(LOG_WARNING, "Dropping deferred DTMF digits on %s\n", chan->name);
 				ast_frfree(f);
 				f = &ast_null_frame;
@@ -2287,9 +2288,10 @@
 				if (!ast_tvzero(chan->dtmf_tv) && 
 				    ast_tvdiff_ms(ast_tvnow(), chan->dtmf_tv) < AST_MIN_DTMF_GAP) {
 					/* If it hasn't been long enough, defer this digit */
-					if (strlen(chan->dtmfq) < sizeof(chan->dtmfq) - 2)
+					if (strlen(chan->dtmfq) < sizeof(chan->dtmfq) - 2) {
+						ast_log(LOG_DTMF, "DTMF end '%c' put into dtmf queue on %s\n", f->subclass, chan->name);
 						chan->dtmfq[strlen(chan->dtmfq)] = f->subclass;
-					else
+					} else
 						ast_log(LOG_WARNING, "Dropping deferred DTMF digits on %s\n", chan->name);
 					ast_frfree(f);
 					f = &ast_null_frame;
@@ -2311,18 +2313,24 @@
 			} else {
 				struct timeval now = ast_tvnow();
 				if (ast_test_flag(chan, AST_FLAG_IN_DTMF)) {
+					ast_log(LOG_DTMF, "DTMF end accepted with begin '%c' on %s\n", f->subclass, chan->name);
 					ast_clear_flag(chan, AST_FLAG_IN_DTMF);
 					if (!f->len)
 						f->len = ast_tvdiff_ms(now, chan->dtmf_tv);
-				} else if (!f->len)
+				} else if (!f->len) {
+					ast_log(LOG_DTMF, "DTMF end accepted without begin '%c' on %s\n", f->subclass, chan->name);
 					f->len = AST_MIN_DTMF_DURATION;
+				}
 				if (f->len < AST_MIN_DTMF_DURATION) {
+					ast_log(LOG_DTMF, "DTMF end '%c' has duration %ld but want minimum %d, emulating on %s\n", f->subclass, f->len, AST_MIN_DTMF_DURATION, chan->name);
 					ast_set_flag(chan, AST_FLAG_EMULATE_DTMF);
 					chan->emulate_dtmf_digit = f->subclass;
 					chan->emulate_dtmf_duration = AST_MIN_DTMF_DURATION - f->len;
 					f = &ast_null_frame;
-				} else
+				} else {
+					ast_log(LOG_DTMF, "DTMF end passthrough '%c' on %s\n", f->subclass, chan->name);
 					chan->dtmf_tv = now;
+				}
 			}
 			break;
 		case AST_FRAME_DTMF_BEGIN:
@@ -2333,9 +2341,11 @@
 			      ast_tvdiff_ms(ast_tvnow(), chan->dtmf_tv) < AST_MIN_DTMF_GAP) ) {
 				ast_frfree(f);
 				f = &ast_null_frame;
+				ast_log(LOG_DTMF, "DTMF begin ignored '%c' on %s\n", f->subclass, chan->name);
 			} else {
 				ast_set_flag(chan, AST_FLAG_IN_DTMF);
 				chan->dtmf_tv = ast_tvnow();
+				ast_log(LOG_DTMF, "DTMF begin passthrough '%c' on %s\n", f->subclass, chan->name);
 			}
 			break;
 		case AST_FRAME_NULL:




More information about the asterisk-commits mailing list