This version will hang up the given extension even if it has multiple channels open: asterisk -rx "show channels" | perl -lane "print \"asterisk -rx \'soft hangup @F[0]\'\" if m.SIP/201." | bash perl is always your friend when needing some programming mischief :) l. 2009/2/12 Danny Nicholas <da...@debsinc.com>
> Here's an "improved hack" to this "bit of trickery": > > Exten => _86XXXX,1,system('/usr/sbin/asterisk -rx "soft hangup > $(/usr/sbin/asterisk -rx 'core show channels' | grep SIP/${EXTEN(2)| awk '{ > print $1 '} )") > > Where dialing 861234 would hangup extension 1234 > > If this needs refinement, will repost: > > > -----Original Message----- > From: asterisk-users-boun...@lists.digium.com > [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Helius > Ferreira > Sent: Thursday, February 12, 2009 4:42 AM > To: asterisk-users@lists.digium.com > Subject: Re: [asterisk-users] Hangup extensions via CLI? > > Asterisk 1.6 implements the "hangup" on the channel you just made the call > and I used it with this command (apparently) > > asterisk -rx "soft hangup $(asterisk -rx 'core show channels' | grep > SIP/7000| > awk '{ print $1 '} )" > > In my asterisk system: > > debian*CLI> core show channels > Channel Location State Application(Data) > SIP/7000-09c63a30 (None) Up AppDial((Outgoing Line)) > SIP/7777-09c59938 7...@internos:5 Up Dial(SIP/7000) > 2 active channels > 1 active call > 6 calls processed > debian*CLI> > > debian:~# asterisk -rx "soft hangup $(asterisk -rx 'core show channels' | > grep > SIP/7000|awk '{ print $1 '} )" > SIP/7000-09c63a30 > SIP/7777-09c59938 is not a known channel > > But, with the channel SIP/7777-09c59938 is OK. > > asterisk -rx "soft hangup $(asterisk -rx 'core show channels' | grep > SIP/7777| > awk '{ print $1 '} )" > Requested Hangup on channel 'SIP/7777-09c59938' > > I use asterisk 1.6.1 beta4 > > On Wed 11 Feb 2009 09:34:12 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 '} )" > > > > It basically calls *, gets the list of channels, filters them out to get > > the channel name and hangs it up. > > > > OK, using AMI and a real programming language and hadling multiple lines > > would be better. > > > > Thanks > > > > l. > > > > 2009/2/9 Tim Nelson <tnel...@rockbochs.com> > > > > > Greetings list- > > > > > > I'd like the ability to hangup all calls for a particular extension > from > > > the system CLI. I understand this can probably be scripted using the > AMI > > > but I'm not familiar on how to do it. Help! > > > > > > Tim Nelson > > > Systems/Network Support > > > Rockbochs Inc. > > > (218)727-4332 x105 > > > > _______________________________________________ > -- 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 > > > _______________________________________________ > -- 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 > -- Loway - home of QueueMetrics - http://queuemetrics.com
_______________________________________________ -- 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