Asterisk scripts
From KlavoWiki
List online useragent strings
#!/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
List Offline Phones
#!/bin/sh asterisk -rx "sip show peers"| grep -vP '(5060|Unmonitored)' | cut -f1 -d/ | grep -P '\d\d\d.*' | while read PEER do asterisk -rx "sip show peer ${PEER}" | grep -P "(Callerid)" 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