Asterisk scripts

From KlavoWiki
Revision as of 00:49, 26 May 2015 by David (Sọ̀rọ̀ | contribs) (Created page with "= List online useragent srings = <pre> #!/bin/sh asterisk -rx "sip show peers"| grep -vP '(UNKNOWN|Unmonitored)' | cut -f1 -d/ | grep -P '\d\d\d.*' | while read PEER do ec...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

List online useragent srings

#!/bin/sh
asterisk -rx "sip show peers"|
grep -vP '(UNKNOWN|Unmonitored)' |
cut -f1 -d/ | grep -P '\d\d\d.*' |
while read PEER
do
    echo "  "$PEER
    asterisk -rx "sip show peer ${PEER}" |
    grep -P "(Useragent|Contact)"
    echo "===="
done

Reboot all Polycom Phones

#!/bin/sh
asterisk -rx "sip show peers"|
grep -vP '(UNKNOWN|Unmonitored)' |
cut -f1 -d/ | grep -P '\d\d\d.*' |
while read PEER
do
    echo "  "$PEER
    asterisk -rx "sip notify polycom-check-cfg ${PEER}" |
    grep -P "(Useragent|Contact)"
    echo "===="
done