summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2007-05-22 18:52:59 +0000
committerRussell Bryant <russell@russellbryant.com>2007-05-22 18:52:59 +0000
commit90d688570194d418d27a9c1f241f79d3c207d805 (patch)
tree0b80c8fbda6ded9579e3eb8fe8e9928fc7a8d1e3 /main/channel.c
parentd3ee0176822a0d8e9591d51b4c26fa8f1b72ff75 (diff)
Add a new feature for Music on Hold. If you set the "digit" option for a
class in musiconhold.conf, a caller on hold may press this digit to switch to listening to that music class. This involved adding a new callback for generators, which allow generators to get notified of DTMF from the channel they are running on. Then, a callback was implemented for the music on hold generators. (patch from bbryant) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@65505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index 6ada60798..8303ce8c6 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2420,6 +2420,9 @@ static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
chan->fin = FRAMECOUNT_INC(chan->fin);
done:
+ if (chan->music_state && chan->generator && chan->generator->digit && f && f->frametype == AST_FRAME_DTMF_END)
+ chan->generator->digit(chan, f->subclass);
+
ast_channel_unlock(chan);
return f;
}