mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
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/branches/1.4@47284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user