<div dir="ltr">Thanks for the input. If this is doable via Asterisk AMI why not through dial-plan? I mean it only makes sense to be possible through dial-plan where all access is given as well just like the AMI. Am I wrong with this?<div>

<br><div class="gmail_quote">On Tue, Jun 22, 2010 at 4:01 PM, Elliot Otchet <span dir="ltr">&lt;<a href="mailto:elliot.otchet@callingcircles.com">elliot.otchet@callingcircles.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 lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Get it via the AMI.  If you’re already using PHPAGI, it is trivial to get this data.  You can even find an example of how to call “sip show peers” and output
 the resulting response.  You avoid using the (-rx) and you get the data you were looking for.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><a href="http://phpagi.sourceforge.net/phpagi2/docs/phpAGI/AGI_AsteriskManager.html" target="_blank">http://phpagi.sourceforge.net/phpagi2/docs/phpAGI/AGI_AsteriskManager.html</a></span></p>


<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">&lt;other thoughts&gt;If you’re already using PHPAGI often on a busy system, you might want to get more ram, use fastagi to move the PHP load to another system, or
 take Steve Edward’s standard advice and rewrite it in C.  &lt;/other thoughts&gt;</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">-Elliot</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt"> <a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a> [mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com" target="_blank">asterisk-users-bounces@lists.digium.com</a>]
<b>On Behalf Of </b>bruce bruce<br>
<b>Sent:</b> Tuesday, June 22, 2010 1:32 PM<br>
<b>To:</b> Asterisk Users Mailing List - Non-Commercial Discussion<br>
<b>Subject:</b> Re: [asterisk-users] Dialplan Gurus? Can Asterisk 1.4x CHANNEL function be used to retrieve info about OTHER channels?</span></p><div><div></div><div class="h5">
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks Tiago and Tzafrir. I agree with the heavy load that Tzafrir mentioned. I already made a phpagi that does a system() for asterisk -rx and it&#39;s not very responsive at time.</p>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">So what is the solution guys?</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">You see, I only want to know if g729 is being used because I want to determine if a trunk is being used or not. Now, don&#39;t be hasty and suggest GROUP_COUNT to me as I can not use that because I can only see the calls by &quot;sip show peers&quot;
 or &quot;core show channels&quot; and &quot;group show channels&quot; doesn&#39;t show me any channels because I do not have control over the calls place as they are placed by A2Billing.</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">Any more Gurus want to weigh in more?</p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> </p>
<div>
<p class="MsoNormal">On Tue, Jun 22, 2010 at 6:42 AM, Tzafrir Cohen &lt;<a href="mailto:tzafrir.cohen@xorcom.com" target="_blank">tzafrir.cohen@xorcom.com</a>&gt; wrote:</p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">On Tue, Jun 22, 2010 at 11:25:29AM +0100, Tiago Geada wrote:<br>
&gt; Hi!<br>
&gt;<br>
&gt; If it was me, I would create a bash script calling asterisk -vrx &quot;core show<br>
&gt; commands&quot;<br>
&gt;<br>
&gt; something like:<br>
&gt;<br>
&gt; for chan in $(asterisk -vrx &quot;core show channels concise&quot;);<br>
&gt; do<br>
&gt; asterisk -vrx &quot;core show channel $(echo $chan|cut -d \! -f1)&quot;|grep -i<br>
&gt; native;<br>
&gt; done</p>
</div>
<p class="MsoNormal">The overhead of each &#39;asterisk -rx&#39; command is noticable. If you have 10<br>
calls or more, this can have an odd effect.<br>
<br>
Not to mention that the fact that it is so slow exposes its raciness[1].</p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
&gt;<br>
&gt; On 21 June 2010 16:08, bruce bruce &lt;<a href="mailto:bruceb444@gmail.com" target="_blank">bruceb444@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hi Everyone,<br>
&gt; &gt;<br>
&gt; &gt; I want to know if a specific codec type is used at least one. For example,<br>
&gt; &gt; I want to know if out of the 100 calls on the system if there is a 1 channel<br>
&gt; &gt; that is running G.729 codec right now. If using dial-plan and I dial in, I<br>
&gt; &gt; can use this to obtain information about CURRENT channel. But it won&#39;t allow<br>
&gt; &gt; me to obtain information about OTHER channels and that is what I want to do.<br>
&gt; &gt; I want a search for all channels and an output spit out as g729 or TRUE or<br>
&gt; &gt; FALSE if there is a g729 channel.<br>
&gt; &gt;<br>
&gt; &gt; exten =&gt; s,1,Answer()<br>
&gt; &gt; exten =&gt; s,n,Set(foo=${CHANNEL(audioreadformat)})<br>
&gt; &gt; exten =&gt; s,n,NoOp(${foo})<br>
&gt; &gt;<br>
&gt; &gt; Above ^^^^ NoOp spits out g729 if I call in with a g729 codec. But I want that to be about other channels and not the one I am calling into.<br>
&gt; &gt;<br>
&gt; &gt; Thanks,<br>
&gt; &gt;<br>
&gt; &gt; Bruce</p>
</div>
<p class="MsoNormal">[1] Which should naturally be fixed using locks :-)</p>
<div>
<p class="MsoNormal"><br>
--<br>
              Tzafrir Cohen<br>
icq#16849755              <a href="mailto:jabber%3Atzafrir.cohen@xorcom.com" target="_blank">jabber:tzafrir.cohen@xorcom.com</a><br>
+972-50-7952406           mailto:<a href="mailto:tzafrir.cohen@xorcom.com" target="_blank">tzafrir.cohen@xorcom.com</a><br>
<a href="http://www.xorcom.com" target="_blank">http://www.xorcom.com</a>  <a href="http://iax:guest@local.xorcom.com/tzafrir" target="_blank">iax:guest@local.xorcom.com/tzafrir</a><br>
<br>
--<br>
_____________________________________________________________________</p>
</div>
<div>
<div>
<p class="MsoNormal">-- 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></p>
</div>
</div>
</div>
<p class="MsoNormal"> </p>
</div>
</div></div></div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">This message is intended only for the use of the individual (s) or entity to which it is addressed and may contain information that is privileged, confidential, and/or proprietary to Calling Circles LLC and its affiliates.
 If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, forwarding or copying of this communication is prohibited without the express permission of the sender. If you have received this communication
 in error, please notify the sender immediately and delete the original message.<br>
</font>
</div>

<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></blockquote></div><br></div></div>