]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix a case where DTMF could bypass audiohooks.
authorRussell Bryant <russell@russellbryant.com>
Wed, 1 Apr 2009 13:47:30 +0000 (13:47 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 1 Apr 2009 13:47:30 +0000 (13:47 +0000)
This change fixes a situation where an audiohook that wants DTMF would not
actually get it.  This is in the code path where we end DTMF digit length
emulation while handling a NULL frame.

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

main/channel.c

index 5d3eb9b358017c926d0db0da3d425139af06edc8..32e5bf2cb749e70e69609191615205e7a4cb7de8 100644 (file)
@@ -2328,6 +2328,13 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
                                        ast_clear_flag(chan, AST_FLAG_EMULATE_DTMF);
                                        chan->emulate_dtmf_digit = 0;
                                        ast_log(LOG_DTMF, "DTMF end emulation of '%c' queued on %s\n", f->subclass, chan->name);
+                                       if (chan->audiohooks) {
+                                               struct ast_frame *old_frame = f;
+                                               f = ast_audiohook_write_list(chan, chan->audiohooks, AST_AUDIOHOOK_DIRECTION_READ, f);
+                                               if (old_frame != f) {
+                                                       ast_frfree(old_frame);
+                                               }
+                                       }
                                }
                        }
                        break;