aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-01 13:47:30 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-04-01 13:47:30 +0000
commit7b4e800c5e221958b35d2b34afd1a798e6198176 (patch)
treec9e050b522f03a7f4fb58ad71913af04bdd13189
parentd8a684132def0321c72d965a45e5d06e73c69c4a (diff)
Fix a case where DTMF could bypass audiohooks.
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: http://svn.digium.com/svn/asterisk/branches/1.4@185771 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/channel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index 5d3eb9b35..32e5bf2cb 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -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;