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
Have you looked at soft hangup????> -----Original Message----- > From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users- > bounces at lists.digium.com] On Behalf Of Tim Nelson > Sent: Monday, February 09, 2009 3:29 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: [asterisk-users] Hangup extensions via CLI? > > 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
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 <tnelson at 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
>
>
--
Loway - home of QueueMetrics - http://queuemetrics.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20090211/b1ff3cce/attachment-0001.htm
> asterisk -rx "soft hangup $(asterisk -rx 'core show channels' | grep SIP/7000Hi, I used this way of processing output from asterisk 1.2 and found out that it is not 100% safe because there can appear unprintable characters in the output. This will cause the following grep command to show message similar to "Binary content: matched" instead of expected line. It is necessary to use "strings -a" to filter output. So your example should be: asterisk -rx 'core show channels' | strings -a | grep SIP/7000 Hope it helps Lukas