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's not very responsive at time.<div><br></div><div>So what is the solution guys?</div>
<div><br></div><div>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't be hasty and suggest GROUP_COUNT to me as I can not use that because I can only see the calls by "sip show peers" or "core show channels" and "group show channels" doesn't show me any channels because I do not have control over the calls place as they are placed by A2Billing.</div>
<div><br></div><div>Any more Gurus want to weigh in more?</div><div><br><br><div class="gmail_quote">On Tue, Jun 22, 2010 at 6:42 AM, Tzafrir Cohen <span dir="ltr"><<a href="mailto:tzafrir.cohen@xorcom.com">tzafrir.cohen@xorcom.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">On Tue, Jun 22, 2010 at 11:25:29AM +0100, Tiago Geada wrote:<br>
> Hi!<br>
><br>
> If it was me, I would create a bash script calling asterisk -vrx "core show<br>
> commands"<br>
><br>
> something like:<br>
><br>
> for chan in $(asterisk -vrx "core show channels concise");<br>
> do<br>
> asterisk -vrx "core show channel $(echo $chan|cut -d \! -f1)"|grep -i<br>
> native;<br>
> done<br>
<br>
</div>The overhead of each 'asterisk -rx' 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].<br>
<div class="im"><br>
><br>
> On 21 June 2010 16:08, bruce bruce <<a href="mailto:bruceb444@gmail.com">bruceb444@gmail.com</a>> wrote:<br>
><br>
> > Hi Everyone,<br>
> ><br>
> > I want to know if a specific codec type is used at least one. For example,<br>
> > I want to know if out of the 100 calls on the system if there is a 1 channel<br>
> > that is running G.729 codec right now. If using dial-plan and I dial in, I<br>
> > can use this to obtain information about CURRENT channel. But it won't allow<br>
> > me to obtain information about OTHER channels and that is what I want to do.<br>
> > I want a search for all channels and an output spit out as g729 or TRUE or<br>
> > FALSE if there is a g729 channel.<br>
> ><br>
> > exten => s,1,Answer()<br>
> > exten => s,n,Set(foo=${CHANNEL(audioreadformat)})<br>
> > exten => s,n,NoOp(${foo})<br>
> ><br>
> > 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>
> ><br>
> > Thanks,<br>
> ><br>
> > Bruce<br>
<br>
</div>[1] Which should naturally be fixed using locks :-)<br>
<div class="im"><br>
--<br>
Tzafrir Cohen<br>
icq#16849755 <a href="mailto:jabber%3Atzafrir.cohen@xorcom.com">jabber:tzafrir.cohen@xorcom.com</a><br>
+972-50-7952406 mailto:<a href="mailto:tzafrir.cohen@xorcom.com">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>
_____________________________________________________________________<br>
</div><div><div></div><div class="h5">-- 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></div>