Recently the Mojo Lingo team has done a lot of work to improve the performance of Adhearsion, both internally to the project as well as when used in applications for some of our clients. The best way to observe the performance of something is to load it up and see where it falls down. In the telephony/VoIP world, load testing is often done with an Open Source tool known as SIPp. SIPp is truly great; I know of no other Open Source telephony testing tool that is as efficient at generating load and as flexible in what can be generated. For an introduction to load testing with SIPp, check out Luca’s great article on the subject.

SIPp is great, but…

As great as SIPp is however, it’s not the easiest thing to use. It requires test scenarios to be written in a fairly verbose XML format. But even if you love XML, the real pain is lining up the call media. In our world, load tests usually need to interact like a human caller might. This primarily means sending DTMF button presses to the voice application. SIPp doesn’t send media by default, and it gets upset if you try to re-use/loop a single silent audio file (at least, it does without a third-party patch). But even then, it’s very easy to sleep just a little too long and have your telephony engine hang up for lack of received media. Usually this forces us to record an interaction with the application, then use SIPp to play that interaction back. But that makes setting up new test scenarios rather time consuming. Wouldn’t it be great if we could just describe the interactions in a test format, and have something construct the media for us?

Enter Sippy Cup

Yes, that would be great! Enter Sippy Cup. Sippy Cup is designed to make creating SIPp scenarios as painless as possible. And after creating your scenario, it can even test and log the results for you. No more remembering the arcane command line options!

Sippy Cup Scenario Steps

The syntax for creating a test scenario is designed to be as friendly as possible. As of the v0.2.0 release, here are the commands you can use in your test runs:

sleep <seconds> Wait a specified number of seconds

Wait a specified number of seconds invite Send a SIP INVITE to the specified target

Send a SIP INVITE to the specified target receive_trying Expect to receive a 100 Trying response from the target

Expect to receive a response from the target receive_ringing Expect to receive a 180 Ringing response from the target

Expect to receive a response from the target receive_progress Expect to receive a 183 Progress response from the target

Expect to receive a response from the target receive_answer Expect to receive a 200 OK (answering the call) response from the target

Expect to receive a (answering the call) response from the target wait_for_answer Convenient shortcut for receive_trying; receive_ringing; receive_progress; receive_answer , with all but the answer marked as optional

Convenient shortcut for , with all but the marked as optional ack_answer Send an ACK in response to a 200 OK

Send an in response to a send_digits <string> Send a DTMF string. May send one or many digits, including 0-9 , * , # , and A-D

Send a DTMF string. May send one or many digits, including , , , and send_bye Send a BYE (hangup request)

Send a (hangup request) receive_bye Expect to receive a BYE from the target

Expect to receive a from the target ack_bye Send an ACK in response to a BYE

Send an in response to a wait_for_hangup Convenient shortcut for receive_bye; ack_bye

Running Sippy Cup

Given some basic information about the test, including the source and destination addresses, the number of calls to send, and these instructions, we can generate a SIPp scenario and accompanying audio file in PCAP format. Here’s a complete example:

$ cat my_scenario.yml --- source: 192.0.2.15 destination: 192.0.2.200 max_concurrent: 10 calls_per_second: 5 number_of_calls: 20 steps: - invite - wait_for_answer - ack_answer - sleep 3 - send_digits '3125551234' - sleep 5 - send_digits '#' - wait_for_bye $ sippy_cup -c my_scenario.yml Compiling media to my_test_scenario.pcap...done. Compiling scenario to my_test_scenario.xml...done.

Now you can take the my_test_scenario.xml and run it with SIPp. Or, you can let Sippy Cup do it for you:

$ sippy_cup -r my_scenario.yml Preparing to run SIPp command: "sudo sipp -i 192.0.2.15 -p 8836 -sf /Users/bklang/src/sippy_cup/my_test_scenario.xml -l 10 -m 20 -r 5 -s 1 > /dev/null 2>&1" # test run output removed

Get Started!

For more information on the Sippy Cup project, check out the Sippy Cup home page or check out the code on Github. And get to testing those voice applications!