
At Noble Solutions we have a pretty large amount of SIP peers and when we need to check them it can take a little while to look through them all using the asterisk command line interface. In our endless search for speed and efficiency we've come up with a quick and easy solution to help us check a single peer or a range of peers direct from the CentOS command line.
If you were in the Asterisk CLI you could just type 'sip show peers'. That command would return a long list of all the system's peers. The output is difficult to read through and it takes too long to find the peer you're after making it an inefficient method. Here at Noble Solutions we don't like the word 'inefficient' so that option is out.
A better solution is to run the command directly from CentOS and pipe the output to grep so that we get only the information that's relevant.
asterisk -r -x "sip show peers" | grep 'SIP Number'
Lets break that command down to easy chunks!
asterisk: obviously calls the asterisk binary!
-r: connects to asterisk on the local machine.
-x: execute a command within asterisk (only valid when used with -r).
"sip show peers": the command we want to run with the -x flag.
| grep: pipe (pass) the output to grep
'SIP Number': here you would add the peer's number, for example 201 would return information about peer 201 only!
And that's that, a quick simple way to get information relating only to a single peer or a range of peers direct from the CentOS command line.

We use and recommend Zen Business Broadband for the best possible call quality when using a VoIP phone system.