VoIPowering Your Office: Cool Tools for SipX

SipX, in keeping with its overall theme of making life easy for the VoIP server
admin, has the SipXtools package for keeping an eye on server activity from
the command line. The same information is available from the Web interface,
and while it’s still a bit rough around the edges, it won’t hurt to get acquainted
with it. If you find yourself in a situation where the Web interface is not
available, SipXtools will save the day.

Installing SipXtools
If you installed SipX from the installation CD, which includes Fedora Linux, this is so easy it will be like a vacation. First install the configuration file for the SipX software repository:

[[email protected] sipxpbx]# wget -P /etc/yum.repos.d http://www.sipfoundry.org/pub/sipX/sipx-fc.repo

Then install SipXtools:

[[email protected] sipxpbx]# yum install --enablerepo=sipx-development sipxtools

On Red Hat Enterprise Linux and CentOS, download the RPM from www.sipfoundry.org/temp/sipX/main/FC/5/RPM/. Then install it manually:

[[email protected] sipxpbx]# rpm -ivh sipxtools-3.7.0-009131.i386.rpm

You’ll end up with following executables, which you can see with the rpm -ql sipxtools command:


Running any of these with the -h option will display a Help dialog.

What it all means
expire-spread tracks subscriptions and registrations over time. This is helpful for getting a picture of peak use times. Run it like this to see all data:

[[email protected] sipxpbx]# expire-spread

You can also view results from selected databases from /var/sipxdata/sipdb with the –db option:

[[email protected] sipxpbx]# expire-spread --db /var/sipxdata/sipdb/permission.xml
[[email protected] sipxpbx]# expire-spread --db /var/sipxdata/sipdb/registration.xml

sipdb-dump digs through SipX’s services files to give you a snapshot of current status. For example, you can see the expired status of all phones. This example changes to the /var/sipxdata/sipdb directory, then dumps the contents of registration.xml:

[[email protected] sipxpbx]# cd /var/sipxdata/sipdb
[[email protected] sipdb]# sipdb-dump registration.xml
[email protected] cseq=3565 primary=
uri=sip:[email protected] contact="carla schroder"<sip:[email protected];transport=udp>
contact_host= qvalue= expires=1174606170 expired=trueinstance_id= gruu=

That’s the output of a single registration, so you can imagine how it looks when there is a lot of activity. This command whittles the output to show expired status and IP address:

[[email protected] sipdb]#  sipdb-dump registration.xml | awk -Ft '{print $9 " " $6}' | sort

This command finds just the active registrations:

[[email protected] sipdb]# sipdb-dump registration.xml | awk -Ft '/expired=false/ {print $9 " " $6}'

This command finds expired subscriptions:

[[email protected] sipdb]# sipdb-dump subscription.xml | awk -Ft '/expired=true/ { print $10 }'

This one shows all aliases nicely sorted in numerical order:

[[email protected] sipdb]# sipdb-dump alias.xml | awk -Ft '/contact=sip:*/ {print}'|sort

You can pluck out aliases by domain:

[[email protected] sipdb]# sipdb-dump alias.xml | grep 'alrac.net'
identity=*[email protected]  contact=sip:*[email protected]:5130     contact_host=sipx.alrac.net
identity=*[email protected]  contact=sip:*[email protected]:5130     contact_host=sipx.alrac.net

The sipx-stats command presents logfiles in a nice table format:

[[email protected] sipxpbx]# cd /var/log/sipxpbx
[[email protected] sipdb]# sipx-stats sipxpresence.log sipxpresence.log.1

You can store the output in a text file:

[[email protected] sipdb]# sipx-stats < sipxpresence.log sipxpresence.log.1 > log.txt

You may use this on any number of logfiles, from a single one to several. Older logfiles are compressed, so you’ll need to unzip them first:

[[email protected] sipdb]# gunzip sipxpresence.log.3.gz

sipxproc displays and manages SipX processes. This is a great little command, because trying to use the traditional ps ax command to dig out the SipX processes will make you crazy. sipxproc displays the current status of all SipX processes:

[[email protected] sipdb]# sipxproc
warning: peer certificate won't be verified in this SSL session
SIPStatus Started
MediaServer Started
SIPRegistrar Started
SIPAuthProxy Started
KeepAlive Started
ParkServer Started
PresenceServer Started
ConfigAgent Started
CallResolver Started
ConfigServer Started
SIPProxy Started

Ignore the SSL warning; it just means there is no peer to verify, since you’re running commands on the server.

The most useful option is you can restart individual processes without bringing down the whole server:

[[email protected] sipdb]# sipxproc  -r ConfigServer
[[email protected] sipdb]# sipxproc  -r SIPProxy

The -s option starts a service, and -k stops it. -h displays help.

sipxcar is an interesting command for comparing your configuration files to an archive of default files. This one lists changed files:

[[email protected] ~]# sipxcar -m
M /etc/sipxpbx/config.defs
? /etc/sipxpbx/authproxy-config.in

M means the file has been modified from the defaults, and the question mark means the file has been deleted.

This shows the changes in the files, using standard diff notation:

[[email protected] ~]# sipxcar -d
--- /tmp/config.defs.5954.0     2007-03-23 10:18:27.000000000 -0700
+++ /etc/sipxpbx/config.defs    2007-02-16 11:37:32.000000000 -0800
@@ -14,7 +14,7 @@
 # to domain name (e.g. domain.com), so comment out the assignment
 # below that uses -f and uncomment the one that uses -d:

If you get hopelessly horked and want to start over, run this command to reset the file to the defaults:

[[email protected] ~]# sipxcar --reset /etc/sipxpbx/config.defs 

You can also use sipxcar to apply patches to your configuration files, but that’s too geeky even for me. I’m OK with plain old editing in a text editor.

My favorite feature of the sipxcar command is using it to find the SipX RPM packages:

[[email protected] ~]# sipxcar

And then listing the configuration files for each package:

[[email protected] ~]# sipxcar -l sipxregistry

These are ordinary RPMs, so you can use the usual RPM commands to query them as well, like rpm -ql sipxregistry to list all the files in the package.

This Wiki page has more information on SipXtools
The SipX Wiki is a great resource for all things SipX
VoIPowering Your Office: Meet SipX, the SIP iPBX Server for Linux
VoIPowering Your Office: Installing SipX
VoIPowering Your Office: Recovering SipX Passwords and DNS Done Right
VoIPowering Your Office: SipX and IP Phones
VoIPowering Your Office: Connect SipX to Analog Phone Lines

Latest Articles

Follow Us On Social Media

Explore More