aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-29 18:15:41 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-29 18:15:41 +0000
commit3f0fabf74a536f59982f60d0c46eb15b8fdefcbb (patch)
treec6db6753f5efeb37e39a2db0529caf161f3faaa1
parent8eed7c59770bd210d358040fd9c967d11e46fe45 (diff)
Merged revisions 226532 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r226532 | file | 2009-10-29 15:13:42 -0300 (Thu, 29 Oct 2009) | 13 lines Merged revisions 226531 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r226531 | file | 2009-10-29 15:11:26 -0300 (Thu, 29 Oct 2009) | 6 lines 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.6.1@226534 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_local.c8
-rw-r--r--doc/tex/localchannel.tex4
2 files changed, 10 insertions, 2 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 65f9578ac..141f89f5b 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -119,6 +119,7 @@ struct local_pvt {
#define LOCAL_LAUNCHED_PBX (1 << 3) /*!< PBX was launched */
#define LOCAL_NO_OPTIMIZATION (1 << 4) /*!< Do not optimize using masquerading */
#define LOCAL_BRIDGE (1 << 5) /*!< Report back the "true" channel as being bridged to */
+#define LOCAL_MOH_PASSTHRU (1 << 6) /*!< Pass through music on hold start/stop frames */
static AST_LIST_HEAD_STATIC(locals, local_pvt);
@@ -406,9 +407,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 */
@@ -677,6 +678,9 @@ static struct local_pvt *local_alloc(const char *data, int format)
if (strchr(opts, 'b')) {
ast_set_flag(tmp, LOCAL_BRIDGE);
}
+ if (strchr(opts, 'm')) {
+ ast_set_flag(tmp, LOCAL_MOH_PASSTHRU);
+ }
}
/* Look for a context */
diff --git a/doc/tex/localchannel.tex b/doc/tex/localchannel.tex
index 528421e0b..c8f6efb62 100644
--- a/doc/tex/localchannel.tex
+++ b/doc/tex/localchannel.tex
@@ -27,6 +27,10 @@ audio that it receives from the channel that called the local channel. This is
especially in the case of putting chan\_local in between an incoming SIP call
and Asterisk applications, so that the incoming audio will be de-jittered.
+Using the "m" option 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.
+
\subsection{Purpose}
The Local channel construct can be used to establish dialing into any part of