Thanks for the input.
I have already used system() in phpagi to do an "asterisk -rx" and the "sip show channels" and "grep -c" for g729 and that works kind of. But as I said, it's not very responsive and it hangs sometimes. It probably be the same results even if I used some php-agi parameter to harvest the info I want. Overall, it's not as clean of a method as a dialplan method would be if it was doable. I am amazed that there is no easy dial-plan method to tell if a trunk is being used or if a codec is being used. P.S. GROUP_COUNT seems to be useless in my case as well. Thanks > Date: Sun, 20 Jun 2010 20:44:53 -0400 > From: j...@netdirect.ca > To: het...@hotmail.com > CC: asterisk@uc.org > Subject: Re: [on-asterisk] How to check in dial-plan for a specific codec if > it's being used? > > > > I have a need to check and see if a G.729 channel is up and running > > > and then to set a variable as FALSE and TRUE based on the outcome. > > > Can this be done with the dial-plan? > > > > > > > > > I can also live with a dial-plan code that check to see if a Trunk > > > is being used and if it is to set a variable to FALSE or TRUE based > > > on the condition. > > > > > > > > > I can also work with a method that can check to see if a number > > > dialed on the system start with 678 and if a call is on progress and > > > set a variable to TRUE or FALSE. > > > > > > > > > All of the above approaches are fine by me but I prefer the Trunk > > > option to be checked if it's used, and then the G.729 check option. > > > > > > > > > Any input is appreciated. > > > > > > > > > Running Asterisk v1.4.x > > > > > > > > > Note: I have used phpagi to do a system call for "asterisk -rx" and > > > that is not a good solution as the php file itself hangs sometimes > > > in Asterisk dial-plan. Something dial-plan native would make my life > > > much easier. > > Well "sip show channel" shows the codec in use for a given channel. I would > have said to use an AGI script for that, but you don't want to. How about > scanning logs, (although that could take time?) > > You could hack a variable into AGI command to specify the codec. There is a > var called ${SIP_CODEC} that says it's used to set the codec, maybe it shows > the codec too (long shot?) > > -- > John Van Ostrand > CTO, co-CEO > Net Direct Inc. > 564 Weber St. N. Unit 12, Waterloo, ON N2L 5C6 > Ph: 866-883-1172 x5102 > Fx: 519-883-8533 > > Linux Solutions / IBM Hardware > _________________________________________________________________ Turn down-time into play-time with Messenger games http://go.microsoft.com/?linkid=9734385