]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Do not attempt to do emulation if an END digit is received and the length is
authorRussell Bryant <russell@russellbryant.com>
Mon, 9 Jun 2008 16:35:40 +0000 (16:35 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 9 Jun 2008 16:35:40 +0000 (16:35 +0000)
less than the defined minimum digit length, and the other end only wants END
digits (SIP INFO, for example).

(closes issue #12778)
Reported by: tsearle
Patches:
      12778.rev1.txt uploaded by russell (license 2)
Tested by: tsearle

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

main/channel.c

index 392b0b113ef711e6a588e15c58e658e9924cd5ec..cafbfe9c562e1fa97ef11bf23fde13d953ec4dcb 100644 (file)
@@ -2168,7 +2168,7 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
                                        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) {
+                               if (f->len < AST_MIN_DTMF_DURATION && !ast_test_flag(chan, AST_FLAG_END_DTMF_ONLY)) {
                                        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;
@@ -2177,6 +2177,9 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
                                        f = &ast_null_frame;
                                } else {
                                        ast_log(LOG_DTMF, "DTMF end passthrough '%c' on %s\n", f->subclass, chan->name);
+                                       if (f->len < AST_MIN_DTMF_DURATION) {
+                                               f->len = AST_MIN_DTMF_DURATION;
+                                       }
                                        chan->dtmf_tv = now;
                                }
                                if (chan->audiohooks) {