aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-29 18:11:26 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-29 18:11:26 +0000
commitb9c82e8f661222ca33115188c776735e4c2bd8c3 (patch)
tree49b6cd37cd9c7dc3b27fb1c33e25766065f779ca
parent845b8285cdaca19264bb8de9fda05294143b518e (diff)
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 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@226531 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_local.c7
-rw-r--r--doc/localchannel.txt4
2 files changed, 8 insertions, 3 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 9c2f7e600..58692899c 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -120,6 +120,7 @@ struct local_pvt {
#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 @@ static int local_indicate(struct ast_channel *ast, int condition, const void *da
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 @@ static struct local_pvt *local_alloc(const char *data, int format)
*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 */
diff --git a/doc/localchannel.txt b/doc/localchannel.txt
index ccedbebed..33b9fbc2f 100644
--- a/doc/localchannel.txt
+++ b/doc/localchannel.txt
@@ -5,10 +5,12 @@ chan_local is a pseudo-channel. Use of this channel simply loops calls back into
* Syntax:
- Local/extension@context[/n]
+ Local/extension@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:
The Local channel construct can be used to establish dialing into any part of the dialplan.