]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_dahdi: Fix analog dialtone detection.
authorRichard Mudgett <rmudgett@digium.com>
Fri, 16 May 2014 20:03:46 +0000 (20:03 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 16 May 2014 20:03:46 +0000 (20:03 +0000)
* 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/
........

Merged revisions 414067 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@414068 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c

index a07501598ad80dc6492ab4c7c345db32fac28bba..3a37087d9d193e5b159b62bb65a1c8aeaf095442 100644 (file)
@@ -2415,7 +2415,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;
        }
 
@@ -9418,7 +9418,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_channel_state(ast) != 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 */
                ) {