[svn-commits] file: branch 1.4 r226531 - in /branches/1.4: channels/ doc/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 29 13:11:31 CDT 2009


Author: file
Date: Thu Oct 29 13:11:26 2009
New Revision: 226531

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=226531
Log:
Add an option to enabling passing music on hold start and stop requests through instead of
acting on them in chan_local.

(closes issue #14709)
Reported by: dimas

Modified:
    branches/1.4/channels/chan_local.c
    branches/1.4/doc/localchannel.txt

Modified: branches/1.4/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/channels/chan_local.c?view=diff&rev=226531&r1=226530&r2=226531
==============================================================================
--- branches/1.4/channels/chan_local.c (original)
+++ branches/1.4/channels/chan_local.c Thu Oct 29 13:11:26 2009
@@ -120,6 +120,7 @@
 #define LOCAL_ALREADY_MASQED  (1 << 2) /*!< Already masqueraded */
 #define LOCAL_LAUNCHED_PBX    (1 << 3) /*!< PBX was launched */
 #define LOCAL_NO_OPTIMIZATION (1 << 4) /*!< Do not optimize using masquerading */
+#define LOCAL_MOH_PASSTHRU    (1 << 5) /*!< Pass through music on hold start/stop frames */
 
 static AST_LIST_HEAD_STATIC(locals, local_pvt);
 
@@ -374,9 +375,9 @@
 		return -1;
 
 	/* If this is an MOH hold or unhold, do it on the Local channel versus real channel */
-	if (condition == AST_CONTROL_HOLD) {
+	if (!ast_test_flag(p, LOCAL_MOH_PASSTHRU) && condition == AST_CONTROL_HOLD) {
 		ast_moh_start(ast, data, NULL);
-	} else if (condition == AST_CONTROL_UNHOLD) {
+	} else if (!ast_test_flag(p, LOCAL_MOH_PASSTHRU) && condition == AST_CONTROL_UNHOLD) {
 		ast_moh_stop(ast);
 	} else {
 		/* Queue up a frame representing the indication as a control frame */
@@ -634,6 +635,8 @@
 		*opts++ = '\0';
 		if (strchr(opts, 'n'))
 			ast_set_flag(tmp, LOCAL_NO_OPTIMIZATION);
+		if (strchr(opts, 'm'))
+			ast_set_flag(tmp, LOCAL_MOH_PASSTHRU);
 	}
 
 	/* Look for a context */

Modified: branches/1.4/doc/localchannel.txt
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/doc/localchannel.txt?view=diff&rev=226531&r1=226530&r2=226531
==============================================================================
--- branches/1.4/doc/localchannel.txt (original)
+++ branches/1.4/doc/localchannel.txt Thu Oct 29 13:11:26 2009
@@ -5,9 +5,11 @@
 
 * Syntax:
 
- Local/extension at context[/n]
+ Local/extension at context[/nm]
 
 Adding "/n" at the end of the string will make the Local channel not do a native transfer (the "n" stands for "n"o release) upon the remote end answering the line. This is an esoteric, but important feature if you expect the Local channel to handle calls exactly like a normal channel. If you do not have the "no release" feature set, then as soon as the destination (inside of the Local channel) answers the line and one audio frame passes, the variables and dial plan will revert back to that of the original call, and the Local channel will become a zombie and be removed from the active channels list. This is desirable in some circumstances, but can result in unexpected dialplan behavior if you are doing fancy things with variables in your call handling.
+
+Adding "/m" at the end will cause chan_local to forward music on hold start and stop requests. Normally chan_local acts on them and it is started or stopped on the Local channel itself.
 
 * Purpose:
 




More information about the svn-commits mailing list