aboutsummaryrefslogtreecommitdiffstats
path: root/channels
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 /channels
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
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_local.c7
1 files changed, 5 insertions, 2 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 */