From ffe97a9c8ff63e1759de01d1bfb5ce83866bc58c Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Fri, 16 May 2014 20:00:55 +0000 Subject: [PATCH] chan_dahdi: Fix analog dialtone detection. * Check if waitingfordt (waitfordialtone) is enabled in dahdi_read() to allow the DSP to operate early enough to detect dialtone. * Made use the correct variable in my_check_waitingfordt(). ASTERISK-23709 #close Reported by: Steve Davies Patches: dialtone_detect_fix (license #5012) patch uploaded by Steve Davies Review: https://reviewboard.asterisk.org/r/3534/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@414067 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_dahdi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 2043d6b11b..c198935c15 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -2355,7 +2355,7 @@ static int my_check_waitingfordt(void *pvt) { struct dahdi_pvt *p = pvt; - if (p->waitingfordt.tv_usec) { + if (p->waitingfordt.tv_sec) { return 1; } @@ -9246,7 +9246,7 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast) #if 0 ast_debug(1, "Read %d of voice on %s\n", p->subs[idx].f.datalen, ast->name); #endif - if (p->dialing || p->radio || /* Transmitting something */ + if ((p->dialing && !p->waitingfordt.tv_sec) || p->radio || /* Transmitting something */ (idx && (ast->_state != AST_STATE_UP)) || /* Three-way or callwait that isn't up */ ((idx == SUB_CALLWAIT) && !p->subs[SUB_CALLWAIT].inthreeway) /* Inactive and non-confed call-wait */ ) { -- 2.47.3