Considering this your real question &quot;<font color="#000000" face="Tahoma">I want to track the number of calls up at any given time, through the AMI</font>&quot; ....<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 &quot;Command&quot; 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">&lt;<a href="mailto:aaberga@gmail.com" target="_blank">aaberga@gmail.com</a>&gt;</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>
&gt; I need to do this from the AMI (not the CLI)...I don&#39;t *think* a comparable command exists from the AMI.<br>
&gt;<br>
&gt; As well, I don&#39;t want to poll the system for calls so I&#39;m hoping to trap a call bridged,unbridged type event.<br>
&gt;<br>
<br>
<br>
</div>Michelle,<br>
<br>
if you do not want to poll Asterisk with an AMI &#39;Status&#39; 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 &#39;one legged calls&#39;: 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 &#39;rising&#39; 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 =&gt; _00.,n,UserEvent(DNIS-Ext,Exten: ${EXTEN},CallerID: &quot;${CALLERID(num)}&quot;,DNID: &quot;${CALLERID(dnid)}&quot;,DisplayID: &quot;${PersonalID_Num}&quot;,ChannelID: &quot;${CHANNEL}&quot;,RDNIS: &quot;${RDNIS}&quot;)<br>

<br>
<br>
The first string (DNIS-Ext) is a marker: anything that you want to receive that &#39;brands&#39; 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="&#39;times new roman&#39;, serif">Regards</font><div><font face="&#39;times new roman&#39;, serif"><br></font><div><pre cols="72"><font face="&#39;times new roman&#39;, serif">**************************
Muhammad Salman
***************************</font>
</pre></div></div><br>