[asterisk-commits] file: branch 1.4 r78275 - /branches/1.4/main/channel.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Aug 6 16:41:14 CDT 2007
Author: file
Date: Mon Aug 6 16:41:13 2007
New Revision: 78275
URL: http://svn.digium.com/view/asterisk?view=rev&rev=78275
Log:
Add additional DTMF log messages to help when debugging issues.
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=78275&r1=78274&r2=78275
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Mon Aug 6 16:41:13 2007
@@ -2348,9 +2348,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;
@@ -2358,9 +2359,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;
@@ -2382,18 +2384,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:
@@ -2403,9 +2411,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