StopMixMonitor destroy call

Hello. I have asterisk 16 and would like to implement stop/resume recording on demand(feature code)
added 2 features code to features.conf:

pauseMonitor => #2,self/both,GoSub(sub-pause-recording,s,1)     ;Allow the callee to pause monitoring
unpauseMonitor => #3,self/both,GoSub(sub-unpause-recording,s,1)
exten => s,1,Verbose(Stopping Recording)
exten => s,n,StopMixMonitor()
exten => s,n,Set(__callWasAlreadyPaused=1)
exten => s,n,Return()

exten => s,1,Verbose(Resuming Recording)
exten => s,n,GoSub(sub-monitor,s,1(${EXTEN})))
exten => s,n,Return()

exten => s,1,NoOp(sub-monitor)
exten => s,n(append),MixMonitor(${WAV}.wav,a,${action})
exten => s,n,Return()
exten => s,n(standartMonitor),MixMonitor(${WAV}.wav,,${action})
exten => s,n(skipRecording),Return()

and it’s work for inbound call redirected to queue

but when I tried to add this to outbound call:

exten => s,n,Set(__DYNAMIC_FEATURES=pauseMonitor#unpauseMonitor)
exten => s,n,Dial(PJSIP/+${toClientNumber}@${trunk},90,TU(sub-monitor,s,1))

when pause of recording actions executed - call destroyed:

Channel PJSIP/ left 'simple_bridge' basic-bridge <d542aac6-ba15-487a-8f18-24e0e58c2f1e>
  == MixMonitor close filestream (mixed)
    -- Channel PJSIP/utdnvxscoj-000001dd left 'simple_bridge' basic-bridge <d542aac6-ba15-487a-8f18-24e0e58c2f1e>

Please help how to stop record without destroying channels.

You might try changing that to:

exten => s,n,Gosub(sub-monitor,s,1)
exten => s,n,Dial(PJSIP/+${toClientNumber}@${trunk},90)

Or check into the T option to your Dial() invocation because it might be that # key is initiating the transfer before the pause/unpause feature ie. Asterisk is matching just # not #2 or #3.

Another option is to change the #2 and #3 to *2 and *3 respectively.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.