[Home]

Summary:ASTERISK-27805: PauseMonitor Disconnects Call when using MixMonitor in Pre-Dial Handlers
Reporter:Ross Beer (rossbeer)Labels:pjsip
Date Opened:2018-04-16 09:16:30Date Closed:2019-03-26 13:58:27
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/app_mixmonitor pjproject/pjsip
Versions:13.20.0 GIT Frequency of
Occurrence
Constant
Related
Issues:
Environment:Fedora 23Attachments:
Description:If MixMonitor is set within a pre-dial handler and dynamic features are set in the preceding dialplan, the call is hung up when performing a PauseMonitor feature call.

[predial]
exten => _X.,1,MixMonitor(<Settings>)
Comments:By: Asterisk Team (asteriskteam) 2018-04-16 09:16:31.698-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Kevin Harwell (kharwell) 2018-04-17 10:22:13.117-0500

Set the following in _features.conf_:
{noformat}
[applicationmap]
pauseMonitor   => #1,self/callee,Pausemonitor
unpauseMonitor => #3,self/callee,UnPauseMonitor
{noformat}
Also something like the following in _extensions.conf_:
{noformat}
[default]
exten => predial_outbound,1,NoOp()
same => n,MixMonitor(/tmp/mixmonitor.wav)
same => n,Return()

exten => _1XX,1,NoOp()
same => n,Set(__DYNAMIC_FEATURES=pauseMonitor#unpauseMonitor)
same => n,Dial(PJSIP/${EXTEN},,b(default^predial_outbound^1))
same => n,Hangup()
{noformat}
Then have something like endpoint 101 dial endpoint 102. After answering, when 102 presses '#1' on their phone the call is hung up. I was also able to duplicate this by not even having the predial handler attached at all. Just set the features, call, press the feature code, and then it hangs up.

By: Richard Mudgett (rmudgett) 2018-04-17 11:43:00.078-0500

* This is mixing functions and applications between MixMonitor and Monitor.  PauseMonitor/UnpauseMonitor are for use with Monitor not MixMonitor.  The MixMonitor documentation should remove references to those two Monitor applications as they do not apply to MixMonitor.
* The other thing is PauseMonitor and UnpauseMonitor are stupidly returning non-zero when Monitor is not used on the channel thus causing the channel to hangup.  Those two applications should always return zero so as not to hangup the call.

By: Ross Beer (rossbeer) 2018-04-17 11:59:41.078-0500

If PauseMonitor and UnpauseMonitor are on Monitor only, what are the correct applications to pause MixMonitor?

Would you use StopMixMonitor and then restart MixMonitor with the append option?

By: Richard Mudgett (rmudgett) 2018-04-17 12:23:55.020-0500

Stopping and then restarting with append makes the most sense to me.

By: Ross Beer (rossbeer) 2018-04-18 03:29:49.722-0500

Ok, StopMixMonitor doesn't stop MixMonitor when in a pre-dial handler. When restarting MixMonitor the filename doesn't carry over even if the variable is prefixed with '__' for variable inheritance.

By: Richard Mudgett (rmudgett) 2018-04-18 08:28:00.234-0500

MixMonitor like Monitor operates on a *channel* and the recording is associated with that channel.  If you start it on PJSIP/100 then you need to stop it on PJSIP/100.  PJSIP/200 doesn't know anything about MixMonitor on PJSIP/100.

{noformat}
exten = 100,1,NoOp()
; Start recording the incoming channel wherever the channel goes.
same = n,MixMonitor(incoming_channel_recording)
same = n,Dial(PJSIP/200,,b(predial_outgoing,1))
same = n,Hangup()

; This predial_outgoing routine operates on PJSIP/200 that the Dial above is getting ready to dial.
exten = predial_outgoing,1,NoOp()
; Start recording the outgoing channel wherever the channel goes.
same = n,MixMonitor(outgoing_channel_recording)
same = n,Return()
{noformat}

By: Sean Bright (seanbright) 2019-03-26 13:58:27.374-0500

This doesn't appear to be a bug in Asterisk. If you feel differently, please re-open by commenting on this ticket.