[asterisk-users] PauseMonitor() Hanging Up Call

Mark Michelson mmichelson at digium.com
Mon May 11 11:33:40 CDT 2009


Jon Morgan wrote:
> Hi All,
> 
>  
> 
> I’m at the end of my tether here and would really appreciate some help.
> 
>  
> 
> I’m trying to implement DTMF based pause/resume of call recording.   I’m 
> using Asterisk 1.4.22.1.
> 
>  
> 
> Here’s the scenario:
> 
>  
> 
> The caller (SIP or ISDN, doesn’t matter) dials into the asterisk which 
> executes the following code:
> 
>  
> 
> exten => _X.,1,Monitor(wav,${CALLDIR}${UNIQUEID},mb)
> 
> exten => _X.,n,Set(__DYNAMIC_FEATURES=in-pauseMonitor#in-resumeMonitor)
> 
> exten => _X.,n,Dial(SIP/myphone,300,tTo)
> 
>  
> 
>  My [applicationmap] in features.conf is setup as follows:
> 
>  
> 
> in-pauseMonitor   => *7,self/callee,Macro,pause-record
> 
> in-resumeMonitor  => *9,self/callee,Macro,resume-record
> 
>  
> 
> I also have the following contexts setup in extensions.conf:
> 
>  
> 
> [macro-pause-record]
> 
> exten => s,1,Playback(sounds/recPaused)
> 
> exten => s,n,PauseMonitor()
> 
> exten => s,n,MacroExit
> 
>  
> 
> [macro-resume-record]
> 
> exten => s,1,Playback(sounds/recResumed)
> 
> exten => s,n,UnPauseMonitor()
> 
> exten => s,n,MacroExit
> 
>  
> 
> Now, if I setup the call and hit *7 on the callee phone, the call is 
> hungup every time!  No error message, just simply hangs up, as follows:
> 
>  
> 
>       Executing [s at macro-pause-record:2] 
> PauseMonitor("SIP/myphone-09d26e60", "") in new stack
> 
>       == Spawn extension (macro-pause-record, s, 2) exited non-zero on 
> 'SIP/myphone-09d26e60' in macro 'pause-record'
> 
>       == Auto fallthrough, channel 'SIP/xlite-09d18fc0' status is 'ANSWER'
> 
>  
> 
> If I change the [applicationmap] entries in features.conf to allow 
> pause/resume from the caller phone, e.g.:
> 
>  
> 
> in-pauseMonitor   => *7,self/*caller*,Macro,pause-record
> 
> in-resumeMonitor  => *9,self/*caller*,Macro,resume-record
> 
>  
> 
> Then it works like a charm!
> 
>  
> 
> Seems there’s an issue with pause/resume from callee side. 
> 
>  
> 
> Can anyone shed any light on what I’m doing wrong here please?
> 
>  
> 
> Regards,
> 
>  
> 
> Jon Morgan.

The problem is that the callee's channel does not have a monitor on it, just the 
caller's channel. The PauseMonitor application has the unfortunate effect that 
if the channel on which it is called has no monitor attached, then the 
application returns as if an error occurred and the dialplan stops. I 
unfortunately do not see a direct way to tell from the dialplan if a channel has 
a monitor attached (there is a MONITORED channel variable, but it will be true 
for both channels of a monitored call).

I can think of ways to work around the problem of the call being hung up, but 
the problem is that even with the workarounds in place, calling PauseMonitor on 
the callee's channel will not result in the monitor actually becoming paused 
since, once again, there is no monitor attached to the callee's channel.

So for the purposes of your setup, the only way you're going to be able to get 
what you want working, short of actually changing the source code, is to only 
allow the caller to be able to pause the monitor.

Mark Michelson



More information about the asterisk-users mailing list