How to monitor call realtime using AGI?

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

How to monitor call realtime using AGI?

Postby sktanmoy » Sat Dec 12, 2015 8:53 pm

Firstly, I'm completely new in Asterisk/Freepbx and this forum. So please direct me if do mistake in posting.

I'm developing a custom AGI script for limiting call. I was successful to restrict/permit user for outbound call. Now I need to monitor call, realtime. In every 30 sec probably. I need to check every 30 sec if the user has enough credit. Is there any AGI event for that?

I'm currently monitoring outgoing call using this dialplan
Code: Select all
exten => _+880XXXXXXXXXX,1,AGI(/var/lib/asterisk/agi-bin/test.php)


Is there any event which simultaneously passing call data or status?

Thanks in advanced.
sktanmoy
Newsterisk
 
Posts: 4
Joined: Sat Dec 12, 2015 8:38 pm

Re: How to monitor call realtime using AGI?

Postby jcolp » Mon Dec 14, 2015 7:59 am

There is no mechanism from the dialplan to have something periodically invoked. You'd have to listen on AMI to know when stuff is happening and control it.
Joshua Colp
Digium, Inc. | Senior Software Developer
jcolp
Oldsterisk
 
Posts: 248
Joined: Tue May 19, 2015 6:59 am

Re: How to monitor call realtime using AGI?

Postby ambiorixg12 » Mon Dec 14, 2015 10:39 am

Even though you use AMI, there is no such event on AMI. If you are trying to build a prepaid calling system using PHP, there are other mechanism to achieve this goal
ambiorixg12
Astmaster
 
Posts: 967
Joined: Sun Mar 04, 2007 9:32 pm
Location: Dominican Republic

Re: How to monitor call realtime using AGI?

Postby sktanmoy » Wed Dec 30, 2015 7:00 am

I've achieved in a complex way. I hear DIALSTATUS to update/decide billing matters of an user. And set auto hangup time before originating a call.
However thanks for your comments.
sktanmoy
Newsterisk
 
Posts: 4
Joined: Sat Dec 12, 2015 8:38 pm


Return to Asterisk Support

Who is online

Users browsing this forum: MSN [Bot] and 1 guest