[asterisk-commits] file: trunk r47285 - in /trunk: ./ channels/chan_local.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Nov 7 13:12:30 MST 2006


Author: file
Date: Tue Nov  7 14:12:30 2006
New Revision: 47285

URL: http://svn.digium.com/view/asterisk?rev=47285&view=rev
Log:
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)

........

Modified:
    trunk/   (props changed)
    trunk/channels/chan_local.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_local.c?rev=47285&r1=47284&r2=47285&view=diff
==============================================================================
--- trunk/channels/chan_local.c (original)
+++ trunk/channels/chan_local.c Tue Nov  7 14:12:30 2006
@@ -317,14 +317,22 @@
 	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;
 }
 



More information about the asterisk-commits mailing list