Re: [asterisk-users] Dialplan Gurus? Can Asterisk 1.4x CHANNEL function be used to retrieve info about OTHER channels?

2010-06-22 Thread Tiago Geada
Hi!

If it was me, I would create a bash script calling asterisk -vrx core show
commands

something like:

for chan in $(asterisk -vrx core show channels concise);
do
asterisk -vrx core show channel $(echo $chan|cut -d \! -f1)|grep -i
native;
done

On 21 June 2010 16:08, bruce bruce bruceb...@gmail.com wrote:

 Hi Everyone,

 I want to know if a specific codec type is used at least one. For example,
 I want to know if out of the 100 calls on the system if there is a 1 channel
 that is running G.729 codec right now. If using dial-plan and I dial in, I
 can use this to obtain information about CURRENT channel. But it won't allow
 me to obtain information about OTHER channels and that is what I want to do.
 I want a search for all channels and an output spit out as g729 or TRUE or
 FALSE if there is a g729 channel.

 exten = s,1,Answer()
 exten = s,n,Set(foo=${CHANNEL(audioreadformat)})
 exten = s,n,NoOp(${foo})

 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.

 Thanks,

 Bruce


 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Dialplan Gurus? Can Asterisk 1.4x CHANNEL function be used to retrieve info about OTHER channels?

2010-06-22 Thread Tzafrir Cohen
On Tue, Jun 22, 2010 at 11:25:29AM +0100, Tiago Geada wrote:
 Hi!
 
 If it was me, I would create a bash script calling asterisk -vrx core show
 commands
 
 something like:
 
 for chan in $(asterisk -vrx core show channels concise);
 do
 asterisk -vrx core show channel $(echo $chan|cut -d \! -f1)|grep -i
 native;
 done

The overhead of each 'asterisk -rx' command is noticable. If you have 10
calls or more, this can have an odd effect.

Not to mention that the fact that it is so slow exposes its raciness[1].

 
 On 21 June 2010 16:08, bruce bruce bruceb...@gmail.com wrote:
 
  Hi Everyone,
 
  I want to know if a specific codec type is used at least one. For example,
  I want to know if out of the 100 calls on the system if there is a 1 channel
  that is running G.729 codec right now. If using dial-plan and I dial in, I
  can use this to obtain information about CURRENT channel. But it won't allow
  me to obtain information about OTHER channels and that is what I want to do.
  I want a search for all channels and an output spit out as g729 or TRUE or
  FALSE if there is a g729 channel.
 
  exten = s,1,Answer()
  exten = s,n,Set(foo=${CHANNEL(audioreadformat)})
  exten = s,n,NoOp(${foo})
 
  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.
 
  Thanks,
 
  Bruce

[1] Which should naturally be fixed using locks :-)

-- 
   Tzafrir Cohen
icq#16849755  jabber:tzafrir.co...@xorcom.com
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Dialplan Gurus? Can Asterisk 1.4x CHANNEL function be used to retrieve info about OTHER channels?

2010-06-22 Thread bruce bruce
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.

So what is the solution guys?

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.

Any more Gurus want to weigh in more?


On Tue, Jun 22, 2010 at 6:42 AM, Tzafrir Cohen tzafrir.co...@xorcom.comwrote:

 On Tue, Jun 22, 2010 at 11:25:29AM +0100, Tiago Geada wrote:
  Hi!
 
  If it was me, I would create a bash script calling asterisk -vrx core
 show
  commands
 
  something like:
 
  for chan in $(asterisk -vrx core show channels concise);
  do
  asterisk -vrx core show channel $(echo $chan|cut -d \! -f1)|grep -i
  native;
  done

 The overhead of each 'asterisk -rx' command is noticable. If you have 10
 calls or more, this can have an odd effect.

 Not to mention that the fact that it is so slow exposes its raciness[1].

 
  On 21 June 2010 16:08, bruce bruce bruceb...@gmail.com wrote:
 
   Hi Everyone,
  
   I want to know if a specific codec type is used at least one. For
 example,
   I want to know if out of the 100 calls on the system if there is a 1
 channel
   that is running G.729 codec right now. If using dial-plan and I dial
 in, I
   can use this to obtain information about CURRENT channel. But it won't
 allow
   me to obtain information about OTHER channels and that is what I want
 to do.
   I want a search for all channels and an output spit out as g729 or TRUE
 or
   FALSE if there is a g729 channel.
  
   exten = s,1,Answer()
   exten = s,n,Set(foo=${CHANNEL(audioreadformat)})
   exten = s,n,NoOp(${foo})
  
   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.
  
   Thanks,
  
   Bruce

 [1] Which should naturally be fixed using locks :-)

 --
   Tzafrir Cohen
 icq#16849755  
 jabber:tzafrir.co...@xorcom.comjabber%3atzafrir.co...@xorcom.com
 +972-50-7952406   mailto:tzafrir.co...@xorcom.com
 http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Dialplan Gurus? Can Asterisk 1.4x CHANNEL function be used to retrieve info about OTHER channels?

2010-06-22 Thread Elliot Otchet
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.

http://phpagi.sourceforge.net/phpagi2/docs/phpAGI/AGI_AsteriskManager.html

other thoughtsIf 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.  /other thoughts

-Elliot

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of bruce bruce
Sent: Tuesday, June 22, 2010 1:32 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dialplan Gurus? Can Asterisk 1.4x CHANNEL 
function be used to retrieve info about OTHER channels?

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.

So what is the solution guys?

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.

Any more Gurus want to weigh in more?

On Tue, Jun 22, 2010 at 6:42 AM, Tzafrir Cohen 
tzafrir.co...@xorcom.commailto:tzafrir.co...@xorcom.com wrote:
On Tue, Jun 22, 2010 at 11:25:29AM +0100, Tiago Geada wrote:
 Hi!

 If it was me, I would create a bash script calling asterisk -vrx core show
 commands

 something like:

 for chan in $(asterisk -vrx core show channels concise);
 do
 asterisk -vrx core show channel $(echo $chan|cut -d \! -f1)|grep -i
 native;
 done
The overhead of each 'asterisk -rx' command is noticable. If you have 10
calls or more, this can have an odd effect.

Not to mention that the fact that it is so slow exposes its raciness[1].


 On 21 June 2010 16:08, bruce bruce 
 bruceb...@gmail.commailto:bruceb...@gmail.com wrote:

  Hi Everyone,
 
  I want to know if a specific codec type is used at least one. For example,
  I want to know if out of the 100 calls on the system if there is a 1 channel
  that is running G.729 codec right now. If using dial-plan and I dial in, I
  can use this to obtain information about CURRENT channel. But it won't allow
  me to obtain information about OTHER channels and that is what I want to do.
  I want a search for all channels and an output spit out as g729 or TRUE or
  FALSE if there is a g729 channel.
 
  exten = s,1,Answer()
  exten = s,n,Set(foo=${CHANNEL(audioreadformat)})
  exten = s,n,NoOp(${foo})
 
  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.
 
  Thanks,
 
  Bruce
[1] Which should naturally be fixed using locks :-)

--
  Tzafrir Cohen
icq#16849755  
jabber:tzafrir.co...@xorcom.commailto:jabber%3atzafrir.co...@xorcom.com
+972-50-7952406   
mailto:tzafrir.co...@xorcom.commailto:tzafrir.co...@xorcom.com
http://www.xorcom.com  
iax:gu...@local.xorcom.com/tzafrirhttp://iax:gu...@local.xorcom.com/tzafrir

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users



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.
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Dialplan Gurus? Can Asterisk 1.4x CHANNEL function be used to retrieve info about OTHER channels?

2010-06-22 Thread bruce bruce
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?

On Tue, Jun 22, 2010 at 4:01 PM, Elliot Otchet 
elliot.otc...@callingcircles.com wrote:

  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.



 http://phpagi.sourceforge.net/phpagi2/docs/phpAGI/AGI_AsteriskManager.html



 other thoughtsIf 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.  /other
 thoughts



 -Elliot



 *From:* asterisk-users-boun...@lists.digium.com [mailto:
 asterisk-users-boun...@lists.digium.com] *On Behalf Of *bruce bruce
 *Sent:* Tuesday, June 22, 2010 1:32 PM
 *To:* Asterisk Users Mailing List - Non-Commercial Discussion
 *Subject:* Re: [asterisk-users] Dialplan Gurus? Can Asterisk 1.4x CHANNEL
 function be used to retrieve info about OTHER channels?



 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.



 So what is the solution guys?



 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.



 Any more Gurus want to weigh in more?



 On Tue, Jun 22, 2010 at 6:42 AM, Tzafrir Cohen tzafrir.co...@xorcom.com
 wrote:

 On Tue, Jun 22, 2010 at 11:25:29AM +0100, Tiago Geada wrote:
  Hi!
 
  If it was me, I would create a bash script calling asterisk -vrx core
 show
  commands
 
  something like:
 
  for chan in $(asterisk -vrx core show channels concise);
  do
  asterisk -vrx core show channel $(echo $chan|cut -d \! -f1)|grep -i
  native;
  done

 The overhead of each 'asterisk -rx' command is noticable. If you have 10
 calls or more, this can have an odd effect.

 Not to mention that the fact that it is so slow exposes its raciness[1].


 
  On 21 June 2010 16:08, bruce bruce bruceb...@gmail.com wrote:
 
   Hi Everyone,
  
   I want to know if a specific codec type is used at least one. For
 example,
   I want to know if out of the 100 calls on the system if there is a 1
 channel
   that is running G.729 codec right now. If using dial-plan and I dial
 in, I
   can use this to obtain information about CURRENT channel. But it won't
 allow
   me to obtain information about OTHER channels and that is what I want
 to do.
   I want a search for all channels and an output spit out as g729 or TRUE
 or
   FALSE if there is a g729 channel.
  
   exten = s,1,Answer()
   exten = s,n,Set(foo=${CHANNEL(audioreadformat)})
   exten = s,n,NoOp(${foo})
  
   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.
  
   Thanks,
  
   Bruce

 [1] Which should naturally be fixed using locks :-)


 --
   Tzafrir Cohen
 icq#16849755  
 jabber:tzafrir.co...@xorcom.comjabber%3atzafrir.co...@xorcom.com
 +972-50-7952406   mailto:tzafrir.co...@xorcom.com
 http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

 --
 _

 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users



 --
 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.

 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

[asterisk-users] Dialplan Gurus? Can Asterisk 1.4x CHANNEL function be used to retrieve info about OTHER channels?

2010-06-21 Thread bruce bruce
Hi Everyone,

I want to know if a specific codec type is used at least one. For example, I
want to know if out of the 100 calls on the system if there is a 1 channel
that is running G.729 codec right now. If using dial-plan and I dial in, I
can use this to obtain information about CURRENT channel. But it won't allow
me to obtain information about OTHER channels and that is what I want to do.
I want a search for all channels and an output spit out as g729 or TRUE or
FALSE if there is a g729 channel.

exten = s,1,Answer()
exten = s,n,Set(foo=${CHANNEL(audioreadformat)})
exten = s,n,NoOp(${foo})

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.

Thanks,

Bruce
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users