Asterisk scripts: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
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..."
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
= List online useragent srings =
= List online useragent strings =
<pre>
<pre>
#!/bin/sh
#!/bin/sh
Line 11: Line 11:
     grep -P "(Useragent|Contact)"
     grep -P "(Useragent|Contact)"
     echo "===="
     echo "===="
done
</pre>
= List Offline Phones =
<pre>
#!/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
done
</pre>
</pre>
Line 28: Line 41:
done
done
</pre>
</pre>


[[Category : Asterisk]]
[[Category : Asterisk]]

Latest revision as of 04:36, 9 June 2015

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