dect
/
asterisk
Archived
13
0
Fork 0

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: http://svn.digium.com/svn/asterisk/trunk@47285 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
file 2006-11-07 20:12:30 +00:00
parent ff23e18b1e
commit 7f6ad058e5
1 changed files with 16 additions and 8 deletions

View File

@ -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;
}