summaryrefslogtreecommitdiff
path: root/channels/sig_pri.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-09-06 22:14:52 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-09-06 22:14:52 +0000
commit8b933196e91498b18bbd9619a664fcee72f26283 (patch)
tree359809943d0fbcb35609ed4066f758ffbeae2bee /channels/sig_pri.c
parent0090fb558d05d17bae2d4831b2eb3f660b386594 (diff)
Fix loss of MOH on an ISDN channel when parking a call for the second time.
Using the AMI redirect action to take an ISDN call out of a parking lot causes the MOH state to get confused. The redirect action does not take the call off of hold. When the call is subsequently parked again, the call no longer hears MOH. * Make chan_dahdi/sig_pri restart MOH on repeated AST_CONTROL_HOLD frames if it is already in a state where it is supposed to be sending MOH. The MOH may have been stopped by other means. (Such as killing the generator.) This simple fix is done rather than making the AMI redirect action post an AST_CONTROL_UNHOLD unconditionally when it redirects a channel and thus potentially breaking something with an unexpected AST_CONTROL_UNHOLD. (closes issue ABE-2873) Patches: jira_abe_2873_c.3_bier.patch (license #5621) patch uploaded by rmudgett ........ Merged revisions 372521 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier ........ Merged revisions 372522 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372523 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_pri.c')
-rw-r--r--channels/sig_pri.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index da60e7edf..bf73ced37 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -4752,6 +4752,12 @@ static enum sig_pri_moh_state sig_pri_moh_fsm_notify(struct ast_channel *chan, s
next_state = pvt->moh_state;
switch (event) {
+ case SIG_PRI_MOH_EVENT_HOLD:
+ if (strcasecmp(pvt->mohinterpret, "passthrough")) {
+ /* Restart MOH in case it was stopped by other means. */
+ ast_moh_start(chan, pvt->moh_suggested, pvt->mohinterpret);
+ }
+ break;
case SIG_PRI_MOH_EVENT_UNHOLD:
pri_notify(pvt->pri->pri, pvt->call, pvt->prioffset, PRI_NOTIFY_REMOTE_RETRIEVAL);
/* Fall through */
@@ -4786,6 +4792,10 @@ static enum sig_pri_moh_state sig_pri_moh_fsm_moh(struct ast_channel *chan, stru
next_state = pvt->moh_state;
switch (event) {
+ case SIG_PRI_MOH_EVENT_HOLD:
+ /* Restart MOH in case it was stopped by other means. */
+ ast_moh_start(chan, pvt->moh_suggested, pvt->mohinterpret);
+ break;
case SIG_PRI_MOH_EVENT_RESET:
case SIG_PRI_MOH_EVENT_UNHOLD:
ast_moh_stop(chan);