Page 1 of 1

Pause/UnPauseMonitor

PostPosted: Thu Dec 03, 2015 7:29 am
by wonderwall
Dear All,

I am trying to Pause and unPause monitor for a live call. below is the code which i wrote in my agi file

$AGI->exec("Monitor wav|/var/spool/asterisk/monitor/MIX/$filename");

#### these lines are aded ####
$AGI->exec('Dial',"SIP/50022");
$AGI->exec("PauseMonitor");
$AGI->exec("Wait","10");
$AGI->exec("UnPauseMonitor");
$AGI->exec("Wait","10");

the problem is that once the Dial application starts running it does not go down. and without the Dial application the code runs fine but before the landing of the call. I do not know how to do it.

Launched AGI Script /var/lib/asterisk/agi-bin/agi-DID_route-test.agi
[Dec 3 17:03:26] -- AGI Script Executing Application: (Monitor) Options: (wav,/var/spool/asterisk/monitor/MIX/20151203170326_00922137131480_03405553096)
[Dec 3 17:03:26] -- AGI Script Executing Application: (PauseMonitor) Options: ()
[Dec 3 17:03:26] -- AGI Script Executing Application: (Wait) Options: (5)
[Dec 3 17:03:31] -- AGI Script Executing Application: (UnPauseMonitor) Options: ()
[Dec 3 17:03:31] -- AGI Script Executing Application: (Wait) Options: (5)
[Dec 3 17:03:36] -- <SIP/mppl-pri-00000093>AGI Script agi-DID_route-test.agi completed, returning 0
[Dec 3 17:03:36] -- Executing [50022@default:1] Dial("SIP/mppl-pri-00000093", "SIP/50022,60,") in new stack


newbie. Appreciate a response.

Re: Pause/UnPauseMonitor

PostPosted: Thu Dec 03, 2015 8:23 am
by mflorell
When executing a Dial, as long as the call is up it will stay in the Dial state.

You need to use the Manager API to do things to a call in the Dial state.

Re: Pause/UnPauseMonitor

PostPosted: Thu Dec 03, 2015 8:32 am
by wonderwall
thanks, I have found this

go*CLI> manager show command PauseMonitor
[Syntax]
Action: PauseMonitor
[ActionID:] <value>
Channel: <value>

but have no idea where to write this code and how to activate that code. Could you point me to a direction or may be share an intro with a small example.
thanks in advance.

Re: Pause/UnPauseMonitor

PostPosted: Thu Dec 03, 2015 12:12 pm
by mflorell
If you're using Vicidial all you have to do is insert a record into the vicidial_manager table and it will be processed.

Otherwise, you have to connect to port 5038 and send commands that way,
http://www.voip-info.org/wiki/view/Asterisk+manager+API