Considering this your real question "<font color="#000000" face="Tahoma">I want to track the number of calls up at any given time, through the AMI</font>" ....<br><br>Comparable Command Exists !!<br><br>You can simply run CLI commands <b>through </b>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.<br><br>Manager Command:<br><pre class="screen">Command command,all Execute Asterisk CLI Command </pre><br><br><div class="gmail_quote">On Thu, Oct 18, 2012 at 8:53 AM, Aldo Bergamini <span dir="ltr"><<a href="mailto:aaberga@gmail.com" target="_blank">aaberga@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On 18 Oct 2012, at 17:19, Michelle Dupuis wrote:<br>
<br>
> I need to do this from the AMI (not the CLI)...I don't *think* a comparable command exists from the AMI.<br>
><br>
> As well, I don't want to poll the system for calls so I'm hoping to trap a call bridged,unbridged type event.<br>
><br>
<br>
<br>
</div>Michelle,<br>
<br>
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..<br>
<br>
There are two gotchas around this:<br>
<br>
One is that a single call, depending of what the dialplan is doing, can involve several bridged, unbridged events;<br>
<br>
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.<br>
<br>
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.<br>
<br>
As an example:<br>
<br>
exten => _00.,n,UserEvent(DNIS-Ext,Exten: ${EXTEN},CallerID: "${CALLERID(num)}",DNID: "${CALLERID(dnid)}",DisplayID: "${PersonalID_Num}",ChannelID: "${CHANNEL}",RDNIS: "${RDNIS}")<br>
<br>
<br>
The first string (DNIS-Ext) is a marker: anything that you want to receive that 'brands' the user event to your suiting.<br>
<br>
The rest is a list of (name, value) pairs, giving the details you might need on the AMI processing side.<br>
<br>
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.<br>
<br>
<br>
HTH,<br>
Aldo<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><font face="'times new roman', serif">Regards</font><div><font face="'times new roman', serif"><br></font><div><pre cols="72"><font face="'times new roman', serif">**************************
Muhammad Salman
***************************</font>
</pre></div></div><br>