summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2006-11-07 20:12:30 +0000
committerJoshua Colp <jcolp@digium.com>2006-11-07 20:12:30 +0000
commit66d3792f1114ababd389a1326965704cf4913e34 (patch)
treec43e3fecb6743fdedeac2e12d7fb913f0bd8399a /channels
parent8b8d8d0b24e44ca4e9851fadc926c0996bb0ffe0 (diff)
Merged revisions 47284 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r47284 | file | 2006-11-07 15:08:52 -0500 (Tue, 07 Nov 2006) | 2 lines Make MOH work as it did before in chan_local, without this then it can go funky when transfers and MOH are involved. (issue #7671 reported by jmls) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_local.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 863820586..aea21f49f 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -317,14 +317,22 @@ static int local_indicate(struct ast_channel *ast, int condition, const void *da
struct ast_frame f = { AST_FRAME_CONTROL, };
int isoutbound;
- /* Queue up a frame representing the indication as a control frame */
- ast_mutex_lock(&p->lock);
- isoutbound = IS_OUTBOUND(ast, p);
- f.subclass = condition;
- f.data = (void*)data;
- f.datalen = datalen;
- res = local_queue_frame(p, isoutbound, &f, ast);
- ast_mutex_unlock(&p->lock);
+ /* If this is an MOH hold or unhold, do it on the Local channel versus real channel */
+ if (condition == AST_CONTROL_HOLD) {
+ ast_moh_start(ast, data, NULL);
+ } else if (condition == AST_CONTROL_UNHOLD) {
+ ast_moh_stop(ast);
+ } else {
+ /* Queue up a frame representing the indication as a control frame */
+ ast_mutex_lock(&p->lock);
+ isoutbound = IS_OUTBOUND(ast, p);
+ f.subclass = condition;
+ f.data = (void*)data;
+ f.datalen = datalen;
+ res = local_queue_frame(p, isoutbound, &f, ast);
+ ast_mutex_unlock(&p->lock);
+ }
+
return res;
}