aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-07 20:08:52 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-07 20:08:52 +0000
commitbd88fc8b8c74d0e90f07f98009d5712220a361cb (patch)
treedaa738db5e3d49bee7e6ab56b01f329c89411caa /channels/chan_local.c
parent837b83a1871e49fdf0b1980b40139c9736cb3cda (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@47284 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-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;
}