[asterisk-users] Counting calls in progress from AMI
Salman Zafar
msalman212 at gmail.com
Thu Oct 18 11:42:31 CDT 2012
Considering this your real question "I want to track the number of calls up
at any given time, through the AMI" ....
Comparable Command Exists !!
You can simply run CLI commands *through *AMI and receive the response.
Command used for this is itself "Command" in AMI. If you still want to do
it by counting the event stream then POE is the best solution if you know
PERL, but still why wasting resources in counting events.If you have other
plans like billing then it is understandable otherwise go easy way and add
a cron job or have a UI in php or whatever.
Manager Command:
Command command,all Execute Asterisk CLI Command
On Thu, Oct 18, 2012 at 8:53 AM, Aldo Bergamini <aaberga at gmail.com> wrote:
>
> On 18 Oct 2012, at 17:19, Michelle Dupuis wrote:
>
> > I need to do this from the AMI (not the CLI)...I don't *think* a
> comparable command exists from the AMI.
> >
> > As well, I don't want to poll the system for calls so I'm hoping to trap
> a call bridged,unbridged type event.
> >
>
>
> Michelle,
>
> if you do not want to poll Asterisk with an AMI 'Status' event (that
> returns a list of open channels) counting the bridged, unbridged events is
> possible, but not that easy..
>
> There are two gotchas around this:
>
> One is that a single call, depending of what the dialplan is doing, can
> involve several bridged, unbridged events;
>
> The second is that some kind of calls (I call them 'one legged calls':
> anything resembling an IVR or a call to get voicemail) do not get any
> bridged, unbridged events, at all. The same applies for calls that are sent
> to a MeetMe conference: there you see specific MeetMe events for conference
> rooms.
>
> If you have access to the dialplan (that is if you are in charge of it and
> you can modify it) you could add some user defined events, to mark the
> 'rising' of a call and its connection to the far side. The dialplan can
> send pretty much what you like by using UserEvent.
>
> As an example:
>
> exten => _00.,n,UserEvent(DNIS-Ext,Exten: ${EXTEN},CallerID:
> "${CALLERID(num)}",DNID: "${CALLERID(dnid)}",DisplayID:
> "${PersonalID_Num}",ChannelID: "${CHANNEL}",RDNIS: "${RDNIS}")
>
>
> The first string (DNIS-Ext) is a marker: anything that you want to receive
> that 'brands' the user event to your suiting.
>
> The rest is a list of (name, value) pairs, giving the details you might
> need on the AMI processing side.
>
> Beware of any loop in the dialplan: it might be that you will get multiple
> copies of the same event, if the dialplan execution is such that the same
> extension is visited more than once during the processing of a call.
>
>
> HTH,
> Aldo
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
> http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
--
Regards
**************************
Muhammad Salman
***************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20121018/256718ca/attachment.htm>
More information about the asterisk-users
mailing list