On Fri, Feb 13, 2009 at 06:08:45PM +0800, Dinesh Nair wrote:
> On Wed, 11 Feb 2009 12:34:12 +0100, Lenz Emilitri wrote:
> 
> > This is a bit of trickery, but could not resist :)
> > 
> > This will kill a channel that is connected to SIP/201
> > 
> >  asterisk -rx "soft hangup $(asterisk -rx 'show channels' | grep SIP/201
> > | awk '{ print $1 '} )"

Useless use of grep:

asterisk -rx "soft hangup $(asterisk -rx 'show channels' | awk '/SIP\/201/ 
{print $1}' )"

> 
> what if there're also channels sip/201, sip/2011, sip/2012, sip/2013 et
> al ?

asterisk -rx "soft hangup $(asterisk -rx 'show channels' | awk '/SIP\/201\>/ 
{print $1}' )"


-- 
               Tzafrir Cohen
icq#16849755              jabber:[email protected]
+972-50-7952406           mailto:[email protected]
http://www.xorcom.com  iax:[email protected]/tzafrir

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Reply via email to