I wrote about some tests I ran with SIPp to load test the transcoding abilities of RTPengine a while back.
While SIPp allows you to create complex & powerful scenarios, sipcmd’s simple usage makes it great for quickly testing stuff.
apt-get install libopal-dev sip-dev libpt-dev libssl1.0-dev
Next up clone the GitHub repo and compile:
git clone https://github.com/tmakkonen/sipcmd cd sipcmd make
To be able to call sipcmd from anywhere, copy the binary to /usr/sbin/
cp sipcmd /usr/sbin/
Unlike SIPp, sipcmd has a much more simple syntax to allow you to follow basic call scenarios, like call a destination, wait a set time and then hangup, or answer an incoming call and send a DTMF digit and wait for the called party to hangup.
So let’s get the most basic thing we can set, SIP Registration and Authentication.
sipcmd -P sip -u "nick" -c "mypassword" -w "192.168.190.129"
Now sipcmd will register on that host (192.168.190.129) with username nick and password mypassword.
And it works!
Next we’ll add a basic call scenario, call 123 wait 2 seconds (2000 ms) and then hangup.
./sipcmd -P sip -u "nick" -c "mypassword" -w "192.168.190.129" -x "c123;w2000;h"
And there you have it, simple as that, we’ve made a test call, waited a set time and then hung up.
We can even combine this with monitoring / NMS systems like Nagios to run tests against the network continually.
For more advanced scenarios I’d recommend using SIPp, but for simple testing, particularly from a command line, sipcmd is a simple easy place to start.
2 thoughts on “Automated SIP testing with sipcmd”
sipcmd has a lot of problems to call.
I test sipcmd is fairly simple
How to dial out directly with invite without registering sip server?
How to use the -R parameter?
Are there any parameters that are not registered?