[asterisk-users] Hangup extensions via CLI?

Lukas Rypl rypl at marconi.ttc.cz
Thu Feb 12 09:42:00 CST 2009


> asterisk -rx "soft hangup $(asterisk -rx 'core show channels' | grep SIP/7000


 Hi,

 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





More information about the asterisk-users mailing list