Phone Inventory

From KlavoWiki
Revision as of 00:20, 7 June 2012 by David (talk | contribs) (Created page with "To show a list of connected phones' IP addresses and Useragent. The Useragent will display the phone model number and firmware version. <pre> #!/bin/sh asterisk -rx "sip show...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

To show a list of connected phones' IP addresses and Useragent. The Useragent will display the phone model number and firmware version.

#!/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