{"id":182,"date":"2013-03-11T12:02:00","date_gmt":"2013-03-11T08:02:00","guid":{"rendered":"http:\/\/xxxl.co.za\/?p=182"},"modified":"2023-03-14T18:55:22","modified_gmt":"2023-03-14T14:55:22","slug":"asterisk-stuff-i-use-from-time-to-time-for-troubleshooting","status":"publish","type":"post","link":"https:\/\/xxxl.co.za\/?p=182","title":{"rendered":"Asterisk stuff i use from time to time for troubleshooting."},"content":{"rendered":"<p>Ok, so from time to time you need to get some stuff out of asterisk.<\/p>\n<p>Here is one to show useragents of registered phones:<br \/>\n<code><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">for a in `asterisk -rx &quot;sip show peers&quot;|cut -f1 -d\/` ;do asterisk -rx &quot;sip show peer $a&quot;;done|grep Useragent<\/pre>\n<p><\/code><br \/>\nWill provide IP address and peers as well:<br \/>\n<code><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">for a in `asterisk -rx &quot;sip show peers&quot; | grep -v &#039;Monitored\\|Name\\|Unspecified&#039; | cut -d &#039;\/&#039; -f1` ;do echo $a; asterisk -rx &quot;sip show peer $a&quot; | grep &#039;Useragent\\|Addr-&gt;IP&#039;;done<\/pre>\n<p><\/code><\/p>\n<p>This one will show registered ip&#8217;s and contact<br \/>\n<code><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">for a in `asterisk -rx &quot;sip show peers&quot;|cut -f1 -d\/` ;do asterisk -rx &quot;sip show peer $a&quot;;done|grep Contact<\/pre>\n<p><\/code><\/p>\n<p>This one will show phones that have become lagged:<br \/>\n<code><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">cat \/var\/log\/asterisk\/full |grep NOTICE |grep Lagged | awk &#039;{print $6}&#039; | sort -n | uniq<\/pre>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ok, so from time to time you need to get some stuff out of asterisk. Here is one to show useragents of registered phones: for a in `asterisk -rx &quot;sip show peers&quot;|cut -f1 -d\/` ;do asterisk -rx &quot;sip show peer $a&quot;;done|grep Useragent Will provide IP address and peers as well: for a in `asterisk -rx &hellip; <a href=\"https:\/\/xxxl.co.za\/?p=182\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Asterisk stuff i use from time to time for troubleshooting.<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-182","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/xxxl.co.za\/index.php?rest_route=\/wp\/v2\/posts\/182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xxxl.co.za\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xxxl.co.za\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xxxl.co.za\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xxxl.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=182"}],"version-history":[{"count":13,"href":"https:\/\/xxxl.co.za\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":335,"href":"https:\/\/xxxl.co.za\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions\/335"}],"wp:attachment":[{"href":"https:\/\/xxxl.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xxxl.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xxxl.co.za\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}