Code Monkey home page Code Monkey logo

sippy_cup's Introduction

Gem Version Build Status Dependency Status Code Climate Coverage Status

Sippy Cup

Overview

The Problem

Load testing voice systems, and voice applications in particular, is tricky. While several commercial tools exist, there is really only one tool in the Open Source world that is good at efficiently generating SIP load: SIPp. While SIPp does a good job of generating load, it is somewhat clumsy to use, due to a verbose XML format for scenarios, a confusing set of command line parameters, and worst of all, a lack of tools to create media needed to interact with voice applications.

The last problem is especially tricky: Imagine you want to load test an IVR. Testing requires:

  • calling a test number
  • waiting a certain amount of time
  • sending some DTMF
  • waiting some more
  • sending more DTMF
  • etc....

To test this with SIPp you need a PCAP file that contains the properly timed DTMF interactions. Since there is no tool to create this media, it is usually necessary to call into the system and record the PCAP, isolate the RTP from the captured packets with something like Wireshark, then connect the pcap file into the SIPp scenario. This process is time consuming and error prone, meaning that testing isn't done as often as it should.

SippyCup aims to help solve these problems.

The Solution

Sippy Cup is a tool to generate SIPp load test profiles and the corresponding media in PCAP format. The goal is to take an input document that describes a load test in a very simple way (call this number, wait this many seconds, send this digit, wait a few more seconds, etc). The ideas are taken from LoadBot, but the goal is for a more performant load generating tool with no dependency on Asterisk.

Requirements

SippyCup relies on the following to generate scenarios and the associated media PCAP files:

  • Ruby 2.3.0 or later
  • SIPp latest master branch - Download from https://github.com/sipp/sipp - NOTE: Version SIPp version 3.4 may work, but will be missing certain new Sippy Cup features, such as rate scaling
  • "root" user access via sudo: needed to run SIPp so it can bind to raw network sockets

Installation

If you do not have Ruby 2.3.3 available (check using ruby --version), we recommend installing Ruby with RVM

Install via gem (production)

Once Ruby is installed, install SippyCup:

gem install sippy_cup

Now you can start creating scenario files like in the examples below.

Install from repository (development)

You use bundle command (from the "bundler" package) to install from the source directly. First, clone the repository into a working directory.

Install bundle via gem:

gem install bundler --no-ri --no-rdoc

Then build the sippy_cup application with bundle.

bundle install

Using bundle will then install the gem dependencies and allow you to run sippy_cup from your working directory.

Examples

Simple Example

---
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_hangup

Both source and destination above may be optionally supplied with a port number, eg. 192.0.2.200:5061

Next, execute the scenario:

$ sippy_cup -r my_test_scenario.yml
I, [2013-09-30T14:48:08.388106 #9883]  INFO -- : Preparing to run SIPp command: sudo sipp -i 192.0.2.15 -p 8836 -sf /var/folders/n4/dpzsp6_95tb3c4sp12xj5wdr0000gn/T/scenario20130930-9883-1crejcw -l 10 -m 20 -r 5 -s 1 192.0.2.200
Password:

...snip...

I, [2013-09-30T14:48:16.728712 #9883]  INFO -- : Test completed successfully.

More examples are available in the source repository.

Example embedding SIPp in another Ruby process

require 'sippy_cup'

scenario = SippyCup::Scenario.new 'Sippy Cup', source: '192.168.5.5:10001', destination: '10.10.0.3:19995' do |s|
  s.invite
  s.wait_for_answer
  s.ack_answer

  s.sleep 3
  s.send_digits '3125551234'
  s.sleep 5
  s.send_digits '#'

  s.wait_for_hangup
end

# Create the scenario XML and PCAP media. File will be named after the scenario name, in our case:
# * sippy_cup.xml
# * sippy_cup.pcap
scenario.compile!

The above code can be executed as a standalone Ruby script and the resulting scenario file run with SIPp.

Customize Your Scenarios

Available Scenario Steps

Each command below can take SIPp attributes as optional arguments. For a full list of available steps with arguments explained, see the API documentation.

  • sleep <seconds> Wait a specified number of seconds
  • invite Send a SIP INVITE to the specified target
  • receive_invite Wait for an INVITE to be received
  • register <username> [password] Register the specified user to the target with an optional password
  • send_trying Send a 100 Trying provisional response
  • receive_trying Expect to receive a 100 Trying response from the target
  • send_ringing Send a 180 Ringing provisional response
  • receive_ringing Expect to receive a 180 Ringing response from the target
  • receive_progress Expect to receive a 183 Progress response from the target
  • send_answer Send a 200 Ok response to an INVITE (answer the call)
  • receive_answer Expect to receive a 200 OK (answering the call) response from the target
  • answer Convenient shortcut for send_answer; receive_ack
  • wait_for_answer Convenient shortcut for receive_trying; receive_ringing; receive_progress; receive_answer, with all but the answer marked as optional
  • ack_answer Send an ACK in response to a 200 OK
  • receive_ack Expect to receive an ACK
  • send_digits <string> Send a DTMF string. May send one or many digits, including 0-9, *, #, and A-D
  • receive_ok Expect to receive a 200 OK
  • receive_message [regex] Expect to receive a SIP MESSAGE, optionally matching a regex
  • send_bye Send a BYE (hangup request)
  • receive_bye Expect to receive a BYE from the target
  • ack_bye Send a 200 OK response to a BYE
  • wait_for_hangup Convenient shortcut for receive_bye; ack_bye
  • hangup Convenient shortcut for send_bye; receive_ok
  • call_length_repartition Creates a histogram table of individual call lengths in milliseconds between min length and max length, at the specified interval
  • response_time_repartition Creates a histogram table of individual SIP request response times in milliseconds between min length and max length, at the specified interval

Alternate Output File Path

Don't want your scenario to end up in the same directory as your script? Need the filename to be different than the scenario name? No problem!

For the sippy_cup manifest, use filename:

---
filename: /path/to/somewhere

Or, in Ruby:

s = SippyCup::Scenario.new 'SippyCup', source: '192.168.5.5:10001', destination: '10.10.0.3:19995', filename: '/path/to/somewhere' do
  # scenario definitions here...
end
s.compile!

This will create the files somewhere.xml and somewhere.pcap in the /path/to/ directory.

Customizing the Test Run

Each parameter has an impact on the test, and may either be changed once the XML file is generated or specified in the options hash for SippyCup::Scenario.new. In addition to the default parameters, some additional parameters can be set:

stats_file
Path to a file where call statistics will be stored in a CSV format, defaults to not storing stats
stats_interval
Frequency (in seconds) of statistics collections. Defaults to 10. Has no effect unless :stats_file is also specified
from_user
SIP user from which traffic should appear. Default: sipp
to
SIP user / address to send requests to. Defaults to SIPp's default: `s@[destination]` (as in `[email protected]`). Can specify either a user (`foouser`) or a full address (`[email protected]`), the latter being useful for testing multi-tenant systems where the `To` domain is not the same as the hostname of the system.
transport
Specify the SIP transport. Valid options are `udp` (default) or `tcp`. Default: `udp`
full_sipp_output
By default, SippyCup will show SIPp's command line output while running a scenario. Set this parameter to `false` to hide full command line output. Default: `true`
summary_report_file
Write a summary of the SIPp run to the specified file. This summary is the output from the SIPp `-trace_screen` command. Default: unused
errors_report_file
Record SIPp's errors to the specified file. This report is the output from the SIPp `-trace_err` command. Default: unused
options
A string of SIPp command line options included with the SIPp run. Default: none
media_port
By default, SIPp assigns RTP ports dynamically. However, if there is a need for a static RTP port (say, for data collection purposes), it can be done by supplying a port number here. Default: SIPp's default of 6000
dtmf_mode
Specify the mechanism by which DTMF is signaled. Valid options are `rfc2833` for within the RTP media, or `info` for SIP INFO. Default: rfc2833
scenario_variables
If you're using sippy_cup to run a SIPp XML file, there may be CSV fields in the scenario ([field0], [field1], etc.). Specify a path to a CSV file containing the required information using this option. (File is semicolon delimeted, information can be found [here](http://sipp.sourceforge.net/doc/reference.html#inffile).) Default: unused
number_of_calls
The total number of calls permitted for the entire test. When this limit is reached, the test is over. Defaults to none - test will run forever until manually stopped
number_of_calls
The total number of calls permitted for the entire test. When this limit is reached, the test is over. Defaults to nil.
concurrent_max
The maximum number of calls permitted to be active at any given time. When this limit is reached, SIPp will slow down or stop sending new calls until there it falls below the limit. Defaults to SIPp's default: (3 * call_duration (seconds) * calls_per_second)
calls_per_second
The rate at which new calls should be created. Note that SIPp will automatically adjust this downward to stay at or beneath the maximum number of concurrent calls (`concurrent_max`). Defaults to SIP's default of 10
calls_per_second_incr
When used with `calls_per_second_max`, tells SIPp the amount by which `calls_per_second` should be incremented. CPS rate is adjusted each `calls_per_second_interval`. Default: 1.
calls_per_second_interval
When used with `calls_per_second_max`, tells SIPp the time interval (in seconds) by which calls-per-second should be incremented. Default: Unset; SIPp's default (60s). NOTE: Requires a development build of SIPp; see SIPp/sipp#107
calls_per_second_max
The maximum rate of calls-per-second. Default: unused (`calls_per_second` will not change)
advertise_address
The IP address to advertise in SIP and SDP if different from the bind IP. Default: `source` IP address

Additional SIPp Scenario Attributes

With Sippy Cup, you can add additional attributes to each step of the scenario:

# This limits the amount of time the server has to reply to an invite (3 seconds)
s.receive_answer timeout: 3000

# You can override the default 'optional' parameters
s.receive_ringing optional: false
s.receive_answer optional: true

# Let's combine multiple attributes...
s.receive_answer timeout: 3000, crlf: true

For more information on possible attributes, visit the SIPp Documentation.

Credits

Copyright (C) 2013-2015 Mojo Lingo LLC

Sippy Cup is released under the MIT license. Please see the LICENSE file for details.

Sippy Cup was created by Ben Klang and Will Drexler with support from Mojo Lingo and their clients.

"Sippy Cup" name suggested by Jamey Owens

sippy_cup's People

Contributors

aukeman avatar benlangfeld avatar bklang avatar chewi avatar eloycoto avatar ik5 avatar leifmadsen avatar lpradovera avatar sfgeorge avatar wdrexler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sippy_cup's Issues

Pauses with distribution

The ability to specify a pause distribution with would help in building complex functional scenarios.

to_domain doesn't do anything

Hello,

I'm testing with 0.7.2 and this version is supposed to take an argument:

@option options [String] :to_domain The SIP domain to address requests to. Defaults to the same as :destination.

And i created a yml with:


source: 10.0.160.3
to_domain: test.domain.com
destination: 1.2.3.4
max_concurrent: 1
calls_per_second: 1
transport_mode: tn
full_sipp_output: false
options: {
-trace_msg -message_file test_trace.log,
-trace_logs -log_file test_log.log,
-trace_shortmsg -shortmessage_file test_shortmsg.log,
-trace_err -error_file test_error.log
}
steps:
- register myuser password
- sleep 15

But REGISTERs are still going with the IP as the registrar:

REGISTER sip:1.2.3.4 SIP/2.0.
Via: SIP/2.0/TCP 10.0.160.3:8836;branch=z9hG4bK-26702-5-0.
From: sip:[email protected];tag=5.
To: sip:[email protected].

...

Whereas it should be:

REGISTER sip:test.domain.com SIP/2.0.
Via: SIP/2.0/TCP 10.0.160.3:8836;branch=z9hG4bK-26702-5-0.
From: sip:[email protected];tag=5.
To: sip:[email protected].

...

Is my config wrong?

Thanks for your help!

David

Missing Logger constant

$ sippy_cup -cr test.yaml
/Users/bklang/.rvm/gems/ruby-1.9.3-p448/gems/sippy_cup-0.2.2/lib/sippy_cup/runner.rb:11:in `initialize': uninitialized constant SippyCup::Runner::Logger (NameError)
    from /Users/bklang/.rvm/gems/ruby-1.9.3-p448/gems/sippy_cup-0.2.2/bin/sippy_cup:75:in `new'
    from /Users/bklang/.rvm/gems/ruby-1.9.3-p448/gems/sippy_cup-0.2.2/bin/sippy_cup:75:in `<top (required)>'
    from /Users/bklang/.rvm/gems/ruby-1.9.3-p448/bin/sippy_cup:23:in `load'
    from /Users/bklang/.rvm/gems/ruby-1.9.3-p448/bin/sippy_cup:23:in `<main>'
    from /Users/bklang/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/bklang/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `<main>'

Scenario generated with incorrect filename

Two issues:

  1. When the base filename is not specified, we use the YAML file as the file name. However, in this case, we need to strip off .yaml

  2. Right now the scenario is being generated as test_yaml.xml but runner is attempting to execute test.yaml.xml

Solving 1 will likely solve 2.

Aborting call on unexpected message error

i am testing the following scenario with freeswitch

source: 172.31.0.23
destination: 172.31.0.26
max_concurrent: 1
calls_per_second: 1
number_of_calls: 1
from_user: 1000
to_user: 1001
steps:

  • invite
  • wait_for_answer
  • ack_answer
  • sleep 10
  • hangup

Getting the following error.
Aborting call on unexpected message for Call-Id '[email protected]': while expecting '180' (index 2), received 'SIP/2.0 407 Proxy Authentication Required

Could you please tell what is the issue

SIPp CPU seems unusually high on test runs

This may be related to broken console handling. We should investigate SIPp batch mode:

  -B, --batch         Don't use history file. Disable interactive behavior.
                      (Enables --silent.)
  -s, --silent        Be more silent. Print results with a tab as separator,
                      each row on new line.

missing extension '.xml' on sipp command line for scenario file

"Preparing to run SIPp command: sudo sipp -i 10.0.2.15 -p 8836 -sf /home/vagrant/test -l 10 -m 20 -r 5 -s 1 10.0.0.46"
2013-08-29 19:48:38:190 1377805718.190215: Unable to load or parse '/home/vagrant/test' xml scenario file.

should be

sudo sipp -i 10.0.2.15 -p 8836 -sf /home/vagrant/test.xml -l 10 -m 20 -r 5 -s 1 10.0.0.46

Send a CANCEL request

Is there a way for SippyCup to send a CANCEL?

I am trying to create an INVITE-CANCEL script using this tool. Thanks!

Scenario Pauses Considered Detrimental

Currently when sippy_cup is building a UAC scenario where the server side submits the BYE it inserts pauses into the compiled scenario to match the rtp pauses created. This is actually detrimental to runtime execution of the sipp scenario because at load variations in timing can cause the scenario to be in the middle of a forced pause when the BYE is received. Since we are simply waiting for a BYE as far as the SIP flow is concerned, this isn't the ideal behavior of sippy_cup.

At a glance, I'd assume we may want to either automatically strip the pauses generated for RTP actions in UAC scenarios during this time or even better make them switchable in case the desired behavior really is to force the pause.

Thoughts?

API changes

A bunch of work is already underway to separate concerns between Scenario and Runner, and this is almost finished.

A couple of rough proposals:

  • Fully separate concerns between Scenario and Runner
    • Runner should take a pre-built Scenario
    • Scenario #compile should be the point at which a path is taken
    • Overhaul CLI - Replace -c and -r options on CLI with full commands, ie sippy_cup run foo_scenario, sippy_cup compile foo_scenario
  • Default to using temporary files for generated scenarios unless they are explicitly compiled to disk
  • Allow SippyCup to execute SIPp scenarios using a YAML manifest (replacing steps with embed or similar, passing either filenames or embedded XML scenarios).

Thoughts, @bklang?

[Feature Request] Ability to run sippy_cup from minitest

I started looking into this a bit (only a few minutes), and the documentation examples show how to embed this into another Ruby process, but it looks like it is mostly just for creating the scenario file.

It would be amazing if I could embed this into minitest on my Chef runs (via minitest-chef-handler). Each time I ran my call server cookbooks, I could perform REGISTER tests, load testing, pretty much anything I would want.

error with sample example run

I tried to run sample example with ruby and jruby
ended up with these errors
root@cs11947 /home/adhearsion/testbed_slonophone/load_test # ruby sippy.rb
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require': /usr/local/rvm/gems/ruby-2.0.0-p247/gems/packetfu-1.1.8/lib/packetfu/protos/lldp.rb:19: invalid multibyte escape: /^\x01\x80\xc2\x00\x00[\x0e\x03\x00]/ (SyntaxError) from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/packetfu-1.1.8/lib/packetfu.rb:21:in block in require_protos' from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/packetfu-1.1.8/lib/packetfu.rb:18:ineach'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/packetfu-1.1.8/lib/packetfu.rb:18:in require_protos' from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/packetfu-1.1.8/lib/packetfu.rb:149:in<top (required)>'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/sippy_cup-0.2.1/lib/sippy_cup/media/rtp_payload.rb:2:in <top (required)>' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require' from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/sippy_cup-0.2.1/lib/sippy_cup/media/pcmu_payload.rb:1:in<top (required)>'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/sippy_cup-0.2.1/lib/sippy_cup/media.rb:2:in <top (required)>' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:inrequire'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in require' from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/sippy_cup-0.2.1/lib/sippy_cup.rb:5:inblock in <top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/sippy_cup-0.2.1/lib/sippy_cup.rb:5:in each' from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/sippy_cup-0.2.1/lib/sippy_cup.rb:5:in<top (required)>'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in require' from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:inrescue in require'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in require' from sippy.rb:1:in

'
root@cs11947 /home/adhearsion/testbed_slonophone/load_test # rvm use jruby
Using /usr/local/rvm/gems/jruby-1.7.4
root@cs11947 /home/adhearsion/testbed_slonophone/load_test # ruby sippy.rb
NoMethodError: undefined method `namespace' for main:Object
(root) at /usr/local/rvm/gems/jruby-1.7.4/gems/sippy_cup-0.2.1/lib/sippy_cup/tasks.rb:4
require at org/jruby/RubyKernel.java:1054
require at /usr/local/rvm/rubies/jruby-1.7.4/lib/ruby/shared/rubygems/custom_require.rb:36
(root) at sippy.rb:2
~

sippy_cup generates invalid sipp messages that cause sipp to crash

I noticed that the scenarios which received the 200 OK to hangup a call caused sippy_cup to exit abruptly. I verified sipp (I am using v3.7.2) crashes with a segmentation violation. I also noticed that Wireshark was reporting invalid SIP message headers for the ACK, BYE and 200 OK BYE messages. I compiled a very simple call start/answer scenarios using sippy_cup and decided to run sipp manually. Using this method I was also capable of reproducing the problem.

I am familiar with sipp so I noticed there is a [routes] element after the Content-Length header in the xml file generated by sippy_cup. I removed the [routes] element from the XML scenario files and sipp no longer terminated due a segmentation fault. I also verified that after making that change to the ACK messages, Wireshark no longer complained about invalid SIP message headers.

I check the template for every one of those messages in scenario.rb. and found them to have [routes] at the end of the SIP message header. All of these messages specify a Content-Length header of 0 which probably explains why sipp crashes while parsing the 200 OK BYE.
Here are the exact lines in scenario.rb:

  • ACK - line 458
  • BYE - line 573
  • 200 OK BYE - line 605
    I know that SIP header parameters can be in any order but I don't think the Route-Record header can be after Content-Length especially if the message length is 0. I looked in a few places for information about this but couldn't verify it.

illegal <exec> in the scenario

Under OsX 10.8, sipp via homebrew, I see these errors:

2014-06-04 19:53:08.435802 1401904388.435802: illegal in the scenario

when I try to

> sudo $(which sipp) -i 192.168.178.33 -p 8836 -sf ./sippy_cup.xml -l 1 -m 1 -r 1 -s 1 91.250.81.254
2014-06-04      19:46:19.172519 1401903979.172519: illegal <exec> in the scenario

with a sippy_cup.pcap file and

...
<![CDATA[
ACK [next_url] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: "sipp" <sip:sipp@[local_ip]>;tag=[call_number]
To: <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
Call-ID: [call_id]
CSeq: [cseq] ACK
Contact: <sip:sipp@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 100
User-Agent: SIPp/sippy_cup
Content-Length: 0
[routes]
]]>
</send>
  <nop>
    <action>
      <exec/>
    </action>
  </nop>
  <pause milliseconds="3000"/>
  <pause milliseconds="500"/>
  <pause milliseconds="3000"/>
  <pause milliseconds="2000"/>
  <pause milliseconds="3000"/>
  <send>
<![CDATA[
...

coming from

#!/usr/bin/env ruby
require 'sippy_cup'

scenario = SippyCup::Scenario.new 'Sippy Cup', source: '192.168.178.33', destination: '91.250.81.254' do |s|
 s.register '[email protected]', 'xxx'
 s.invite
 s.wait_for_answer
 s.ack_answer
 s.sleep 3
 s.send_digits '2'
 s.sleep 3
 s.send_digits '1234'
 s.sleep 3
 s.send_bye
 s.wait_for_hangup
end

scenario.compile!

I'd be grateful for any hint on this.

sippy_cup could locate sipp

Hello,

I have an issue running sippy_cup.
I have installed sipp following the documentation on their site and I installed sippy_cup too according the readme. However whenever I run the sippy_cup against my scenario file I got the following error:

# sippy_cup -r config.yml 
I, [2015-05-21T15:23:31.964131 #29070]  INFO -- : Preparing to run SIPp command: sudo $(which sipp) -p 8836 -sf /tmp/scenario20150521-29070-1y4lvvp -l 10 -m 20 -r 5 -s 233208063817 -i 192.168.88.135 192.168.254.220:5080
sudo: invalid option -- 'f'usage: sudo -h | -K | -k | -Vusage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user][command]usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-pprompt] [-u user] [VAR=value] [-i|-s] [<command>]usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-pprompt] [-u user] file ...I, [2015-05-21T15:23:31.985330 #29070]  INFO -- : Test completed successfully but some calls failed.

It seems that sippy_cup could not locate the sipp executable even though I am running under root. Please educate me on how to use them.

Adding options to receive 401, 403, 503, etc.. with true/false optional

It would be great if we had the ability to to things like:

  • receive_403
  • receive_401 optional

etc... for all possible response status.

I tried doing it by adding:

#
def receive_401(opts = {})
    handle_response 401, opts
end

And this actually works, but always with optional="true", and I can't figure out how to set it to that (I don't know anything about Ruby)

Thanks!

David

Generating very large pcaps fails

Right now we construct the entire PCAP in memory before writing to disk. This consumes a huge amount of memory (over 1GB was consumed attempting to generate 6,000 seconds). We should instead write out the packets as we go.

DTMFs not recognized on Freeswitch

Hi guys, I've compiled the following scenario:

SippyCup::Scenario.new("Test", opts) do |s|
  s.invite
  s.wait_for_answer
  s.ack_answer

  s.sleep 5
  s.send_digits "1"
  s.sleep 20

  s.wait_for_hangup                                                                                                                                                                   
end

Tried it against a Freeswitch (v1.2.15) instance, and it seems FS does not recognize the media into DTMFs. SippyCup is at v0.3.0. FS profile has liberal-dtmf=true.
I've made a SIPp run by using this DTMFs RFC2833 pcaps https://code.osso.nl/projects/sipp/browser/pcap (provided by SIPp), and that way FS did recognize the DTMFs.

Arbitrary command line arguments

SIPp supports many more options than we currently handle, so we should probably just make it possible to pass in an arbitrary list of command line options.

SIGINT doesn't behave the same as SIPp (or cleanly exit)

vagrant@loadtest:/vagrant$ sippy_cup -cr scenario.yml
Compiling media to /vagrant/scenario.xml...done.
Compiling scenario to /vagrant/scenario.pcap...done.
I, [2013-09-12T17:37:02.967913 #15808]  INFO -- : Preparing to run SIPp command: sudo sipp -i 10.203.175.15 -p 8836 -sf /vagrant/scenario.xml -l 50 -m 5000 -r 10 -s 1 asterisk.local-dev.mojolingo.com > /dev/null 2>&1
^C/home/vagrant/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/sippy_cup-0.2.3/lib/sippy_cup/runner.rb:62:in `rescue in run': Command sudo sipp -i 10.203.175.15 -p 8836 -sf /vagrant/scenario.xml -l 50 -m 5000 -r 10 -s 1 asterisk.local-dev.mojolingo.com > /dev/null 2>&1 failed (RuntimeError)
    from /home/vagrant/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/sippy_cup-0.2.3/lib/sippy_cup/runner.rb:58:in `run'
    from /home/vagrant/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/sippy_cup-0.2.3/bin/sippy_cup:77:in `<top (required)>'
    from /home/vagrant/.rbenv/versions/1.9.3-p448/bin/sippy_cup:23:in `load'
    from /home/vagrant/.rbenv/versions/1.9.3-p448/bin/sippy_cup:23:in `<main>'

unable to run sippy_cup scenario (CentOS Linux release 7.2.1511 (Core))

i have run sippy_cup -r simple_call.yml. It is throwing the following error

/usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.6.8.1/lib/nokogiri/xml/node.rb:390: warning: constant ::Fixnum is deprecated /usr/local/lib/ruby/gems/2.4.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:117:in new_packet': uninitialized constant PacketFu::UDPPacket (NameError)
Did you mean? PacketFu::Packet
Packet
UDPSocket
from /usr/local/lib/ruby/gems/2.4.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:49:in block (2 levels) in compile!' from /usr/local/lib/ruby/gems/2.4.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:48:in times'
from /usr/local/lib/ruby/gems/2.4.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:48:in block in compile!' from /usr/local/lib/ruby/gems/2.4.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:41:in each'
from /usr/local/lib/ruby/gems/2.4.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:41:in compile!' from /usr/local/lib/ruby/gems/2.4.0/gems/sippy_cup-0.7.2/lib/sippy_cup/scenario.rb:792:in compile_media'
from /usr/local/lib/ruby/gems/2.4.0/gems/sippy_cup-0.7.2/lib/sippy_cup/scenario.rb:726:in to_tmpfiles' from /usr/local/lib/ruby/gems/2.4.0/gems/sippy_cup-0.7.2/lib/sippy_cup/runner.rb:36:in run'
from /usr/local/lib/ruby/gems/2.4.0/gems/sippy_cup-0.7.2/bin/sippy_cup:75:in <top (required)>' from /usr/local/bin/sippy_cup:22:in load'
from /usr/local/bin/sippy_cup:22:in <main>'

Inject Sipp variable substitution (field0, field1, etc.) from CSV file in send_digits

It would be wonderful if Sipp variables can be specified in the send_digits step where the variable (field0, field1, etc.) can be substituted from the CSV file. A sample YML is as follows:

source: sipp.mycomp.net
destination: asterisk.mycomp.net
max_concurrent: 10
calls_per_second: 5
number_of_calls: 20
steps:

  • invite
  • wait_for_answer
  • ack_answer
  • sleep 3

Thanks

  • send_digits '1'
  • sleep 5
  • send_digits [field0]
  • sleep 10
  • send_digits [field1]
  • sleep 60
  • wait_for_bye

lack of structure validity

When creating the yaml file, there is no check to see if something that is required is missing, but it just try to execute the parameter with null value.

For example misspelling of field:
max_concurret:

Will not trigger that the max_concurrent: field is missing, but will add the -l field without integer or other type of value.

unable to run scenario

[root@ip-172-31-22-46 ~]# sippy_cup -r test.yml
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/sippy_cup-0.3.0/lib/sippy_cup/scenario.rb:47:in from_manifest': undefined methodsafe_load' for Psych:Module (NoMethodError)
from /usr/local/rvm/gems/ruby-2.0.0-p247/gems/sippy_cup-0.3.0/bin/sippy_cup:62:in <top (required)>' from /usr/local/rvm/gems/ruby-2.0.0-p247/bin/sippy_cup:23:inload'
from /usr/local/rvm/gems/ruby-2.0.0-p247/bin/sippy_cup:23:in <main>' from /usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:ineval'
from /usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `

'

to_user or to not working

https://github.com/mojolingo/sippy_cup
Has it as: to

http://mojolingo.github.io/sippy_cup/
Has it as: to_user

Neither seem to work. See below.....

[root@utility1 examples]# cat transcoded_call_test.yml
source: 172.21.0.20
destination: 172.21.3.8
max_concurrent: 1
calls_per_second: 1
number_of_calls: 1
from_user: 9545551234
to_user: 6787205023
steps:

  • invite
  • wait_for_answer
  • ack_answer
  • sleep 240
  • hangup

[root@utility1 examples]# sippy_cup -c transcoded_call_test.yml
Compiling media to /root/source/sipp/mojolingo-sippy_cup-540f657/examples/transcoded_call_test.pcap...done.
Compiling scenario to /root/source/sipp/mojolingo-sippy_cup-540f657/examples/transcoded_call_test.xml...done.
[root@utility1 examples]#

[root@utility1 examples]# cat transcoded_call_test.xml

;tag=[call_number] To: Call-ID: [call_id] CSeq: [cseq] INVITE Contact: Max-Forwards: 100 User-Agent: SIPp/sippy_cup Content-Type: application/sdp Content-Length: [len]

v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
]]>









;tag=[call_number] To: [peer_tag_param] Call-ID: [call_id] CSeq: [cseq] ACK Contact: Max-Forwards: 100 User-Agent: SIPp/sippy_cup Content-Length: 0 [routes] ]]> ;tag=[call_number] To: [peer_tag_param] Call-ID: [call_id] CSeq: [cseq] ACK Contact: Max-Forwards: 100 User-Agent: SIPp/sippy_cup Content-Length: 0 [routes] ]]> ;tag=[call_number] To: ;tag=[$remote_tag] Contact: Call-ID: [call_id] CSeq: [cseq] BYE Max-Forwards: 100 User-Agent: SIPp/sippy_cup Content-Length: 0 [routes] ]]>

[root@utility1 examples]# cat transcoded_call_test.yml
source: 172.21.0.20
destination: 172.21.3.8
max_concurrent: 1
calls_per_second: 1
number_of_calls: 1
from_user: 9545551234
to: 6787205023
steps:

  • invite
  • wait_for_answer
  • ack_answer
  • sleep 240
  • hangup
    [root@utility1 examples]# sippy_cup -c transcoded_call_test.yml
    Compiling media to /root/source/sipp/mojolingo-sippy_cup-540f657/examples/transcoded_call_test.pcap...done.
    Compiling scenario to /root/source/sipp/mojolingo-sippy_cup-540f657/examples/transcoded_call_test.xml...done.
    [root@utility1 examples]# cat transcoded_call_test.xml
;tag=[call_number] To: Call-ID: [call_id] CSeq: [cseq] INVITE Contact: Max-Forwards: 100 User-Agent: SIPp/sippy_cup Content-Type: application/sdp Content-Length: [len]

v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
]]>









;tag=[call_number] To: [peer_tag_param] Call-ID: [call_id] CSeq: [cseq] ACK Contact: Max-Forwards: 100 User-Agent: SIPp/sippy_cup Content-Length: 0 [routes] ]]> ;tag=[call_number] To: [peer_tag_param] Call-ID: [call_id] CSeq: [cseq] ACK Contact: Max-Forwards: 100 User-Agent: SIPp/sippy_cup Content-Length: 0 [routes] ]]> ;tag=[call_number] To: ;tag=[$remote_tag] Contact: Call-ID: [call_id] CSeq: [cseq] BYE Max-Forwards: 100 User-Agent: SIPp/sippy_cup Content-Length: 0 [routes] ]]>

Opperations not permitted

so upon trying to build from source (latest version on github) on a Mac OS (Latest version at time of writing) device ive encountered no end of problems trying to get sipp to work with sippy_cup, after installing the homebrew version of sipp with pcap flags enabled to fix the issue sippy_cup was displaying, sippy_cup now agnowledges the pcap libs are present but now gives the pollowing error message.

job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:80:in `pwd': Operation not permitted - getcwd (Errno::EPERM)

plus 10 more lines of the same,
now to me this seemed like a perssions error to me so tried to run as root and still gave the same errors.

very possible ive got something simple round the wrong way or maybe an issue with newer versions of Mac OS ?

Brew install sipp doesnt not install w/ pcap support by default

so I realize this may be considered a homebrew issue but I figured I would open a ticket here incase anyone else ran into this problem. It seems the the current sipp homebrew foruma does not install w/ pcap support.

jdyer@retina:~/Projects/sippy_cup ยป sippy_cup -cr test.yml
Compiling media to /Users/jdyer/Projects/sippy_cup/test.xml...done.
Compiling scenario to /Users/jdyer/Projects/sippy_cup/test.pcap...done.
I, [2013-11-15T09:35:41.786656 #2422]  INFO -- : Preparing to run SIPp command: sudo sipp -i 10.6.96.92 -p 8836 -sf /Users/jdyer/Projects/sippy_cup/test.xml -l 1 -m 1 -r 1 -s 9991xxxxx 10.6.69.188
2013-11-15  09:35:41:800    1384526141.800288: play_pcap_audio requires pcap support! Please recompile SIPp.
I, [2013-11-15T09:35:41.801057 #2422]  INFO -- : Test completed successfully!

So I was thinkMaybe you guys should mention this in the readme ? I was able to fix this using the following formula

require 'formula'

class Sipp < Formula
  homepage 'http://sipp.sourceforge.net/'
  url 'http://downloads.sourceforge.net/project/sipp/sipp/3.4/sipp-3.3.990.tar.gz'
  sha1 'b2637cb72556595253bbdd4a68cc974c9ac1d92e'
  def install
    system "./configure", "--with-pcap"
    system "make", "DESTDIR=#{prefix}"
    bin.install "sipp"
  end
end

Cannot install sippy_cup on CentOS 8 (minimal install)

I tried to compile sippy_cup from source code but getting the following error when I try to start a test scenario that I copied from the github web site:

[root@sip-centos1 ~]# /root/sippy_cup/bin/sippy_cup -r test.yml
Traceback (most recent call last):
        2: from /root/sippy_cup/bin/sippy_cup:3:in `<main>'
        1: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- sippy_cup (LoadError)
        21: from /root/sippy_cup/bin/sippy_cup:3:in `<main>'
        20: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:147:in `require'
        19: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:158:in `rescue in require'
        18: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:158:in `require'
        17: from /usr/local/share/gems/gems/sippy_cup-0.7.2/lib/sippy_cup.rb:7:in `<top (required)>'
        16: from /usr/local/share/gems/gems/sippy_cup-0.7.2/lib/sippy_cup.rb:7:in `each'
        15: from /usr/local/share/gems/gems/sippy_cup-0.7.2/lib/sippy_cup.rb:7:in `block in <top (required)>'
        14: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:94:in `require'
        13: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:94:in `require'
        12: from /usr/local/share/gems/gems/sippy_cup-0.7.2/lib/sippy_cup/scenario.rb:4:in `<top (required)>'
        11: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:94:in `require'
        10: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:94:in `require'
         9: from /usr/local/share/gems/gems/activesupport-7.0.2.3/lib/active_support/core_ext/hash.rb:3:in `<top (required)>'
         8: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:94:in `require'
         7: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:94:in `require'
         6: from /usr/local/share/gems/gems/activesupport-7.0.2.3/lib/active_support/core_ext/hash/conversions.rb:3:in `<top (required)>'
         5: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:94:in `require'
         4: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:94:in `require'
         3: from /usr/local/share/gems/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:11:in `<top (required)>'
         2: from /usr/local/share/gems/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:201:in `<module:ActiveSupport>'
         1: from /usr/local/share/gems/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:103:in `backend='
/usr/local/share/gems/gems/activesupport-7.0.2.3/lib/active_support/xml_mini.rb:184:in `current_thread_backend': uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState (NameError)

Before cloning the repo and running "bundle install", I executed the following to prep the environment:

dnf -y install dnf-plugins-core
dnf upgrade
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
dnf config-manager --set-enabled powertools
dnf -y group install "Development Tools"
dnf -y install make cmake gcc-c++ ncurses-devel openssl-devel flex bison libpcap libpcap-devel lksctp-tools-devel git
dnf module install ruby:2.7
dnf install ruby-devel

Am I missing a dependency? I am using sipp 3.7.

Thanks

Authorized 'register' doesn't seem to work

Was playing around yesterday, and no matter how things were setup, the system would not setup a REGISTER with authorization.

If the configuration in the yml file was like so:

register: 'sip:user@foobar', 'my_secret_password'

The REGISTER would just have the full string in the REGISTER line. It's like it isn't being parsed.

The documentation says to separate with a space, but the development code seems to show separation with a comma in the configuration. Either way, the password just appears in the REGISTER line.

Variable substitution ads extra quotes and fails to execute

The extra quotes added around From and <action> for variables in XML throws syntax error on SIPp
As explained in the SIPp documentation and an example image here, it should have any quotes around the field variables.

Scenario file

source: 192.168.0.1 # Masked
destination: 192.168.0.2:5060 # Masked
max_concurrent: 120
calls_per_second: 2
number_of_calls: 1000
to_user: 2156546
from_user: [field0]
dtmf_mode: 'info'
scenario_variables: variables.csv
steps:
  - invite
  - wait_for_answer
  - ack_answer
  - sleep 10
  - send_digits 3
  - sleep 1000
  - send_bye

Run

sippy_cup -r 1000calls.yml
.
.
2022-12-22	05:17:15.292803	1671686235.292803: Unsupported keyword '"field0"' in xml scenario file
2022-12-22	05:17:15.292803	1671686235.292803: Unsupported keyword '"field0"' in xml scenario fileI, [2022-12-22T05:17:15.294324 #23710] INFO -- : Test completed successfully but some calls failed.

Compile

sippy_cup --compile 1000calls.yml

Extra quotes and &quot; in two sections:

From: "["field0"]" <sip:["field0"]@[local_ip]:[local_port]>;tag=[call_number]
.
.
.
<action>
  <assignstr assign_to="remote_addr" value="[service]@[remote_ip]:[remote_port]"/>
  <assignstr assign_to="local_addr" value="[&quot;field0&quot;]@[local_ip]:[local_port]"/>
  <assignstr assign_to="call_addr" value="[service]@[remote_ip]:[remote_port]"/>
</action>

NOTE: When compiled and manually cleaned up the quotes and given to SIPp, it works perfectly fine.

Runtime error on Debian Jessie: UDPPacket (NameError)

I'm getting the error sippy_cup/media.rb:117:in new_packet': uninitialized constant PacketFu::UDPPacket (NameError)` when running sippy_cup on Debian 8.6, Ruby 2.1.5 installed via apt-get. I'm using a basic sippy_cup file and running sippy_cup as root. This is my first time attempting to use this software. Please advise for user error if that's the root cause.

root@docker-sms:~# uname -r
3.16.0-4-amd64
root@docker-sms:~# cat /etc/debian_version
8.6
root@docker-sms:~# ruby --version
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
root@docker-sms:~# sippy_cup --version
SippyCup version 0.7.2
root@docker-sms:~# cat test.yml

---
source: 10.93.56.25
destination: 10.50.55.101
max_concurrent: 10
calls_per_second: 5
number_of_calls: 20
steps:
  - invite
  - wait_for_answer
  - ack_answer
  - sleep 3
  - hangup
root@docker-sms:~# sippy_cup --compile test.yml
Compiling media to /root/test.pcap.../var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:117:in `new_packet': uninitialized constant PacketFu::UDPPacket (NameError)
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:49:in `block (2 levels) in compile!'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:48:in `times'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:48:in `block in compile!'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:41:in `each'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:41:in `compile!'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/scenario.rb:792:in `compile_media'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/scenario.rb:699:in `compile!'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/bin/sippy_cup:64:in `<top (required)>'
    from /usr/local/bin/sippy_cup:23:in `load'
    from /usr/local/bin/sippy_cup:23:in `<main>'
root@docker-sms:~# sippy_cup --run test.yml
/var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:117:in `new_packet': uninitialized constant PacketFu::UDPPacket (NameError)
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:49:in `block (2 levels) in compile!'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:48:in `times'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:48:in `block in compile!'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:41:in `each'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/media.rb:41:in `compile!'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/scenario.rb:792:in `compile_media'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/scenario.rb:726:in `to_tmpfiles'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/lib/sippy_cup/runner.rb:36:in `run'
    from /var/lib/gems/2.1.0/gems/sippy_cup-0.7.2/bin/sippy_cup:75:in `<top (required)>'
    from /usr/local/bin/sippy_cup:23:in `load'
    from /usr/local/bin/sippy_cup:23:in `<main>'
root@docker-sms:~#
root@docker-sms:~#
root@docker-sms:~# gcc --version
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@docker-sms:~# make --version
GNU Make 4.0
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
root@docker-sms:~#

GRUU Support for REGISTER

From @saghul:

@bklang When registering, the To header needs to contain the AoR to which we are registering, it's typically the same as the From, unless third-party registration is taking place.

About GRUU. When using GRUU, one needs to indicate the instance id in the contact header:

Contact: <sip:[email protected]>;+sip.instance="<urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6>"

Then the 200 OK will contain the public and temporary GRUUs, if supported:

Contact: <sip:[email protected]>;pub-gruu="sip:[email protected];gr=urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6";temp-gruu="sip:[email protected];gr";+sip.instance="<urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6>";expires=3600

Now, if the proxy supports GRUU and someone dials sip:[email protected];gr=urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6 only this instance will ring, it will not fork.

Sippy Cup Not Generating All Scenario Elements

I'm trying to use Sippy Cup to generate a relatively simple xml scenario and I'm not seeing any of the "send_digits" commands in my resulting xml scenario file. Is this a known issue? Am I missing something fundamental in my .rb script?

Below is my .rb script:

require 'sippy_cup'

scenario = SippyCup::Scenario.new('TestScenario', source: '127.0.0.1', destination: '10.10.10.10', dtmf_mode: 'rfc2833') { |s|
  s.register 'User', 'Password'
  s.invite
  s.wait_for_answer
  s.sleep 15
  s.send_digits '1'
  s.sleep 10
  s.send_digits '12345678'
  s.sleep 10
  s.wait_for_hangup
}

scenario.compile!

Below is the resulting .xml scenario:

<?xml version="1.0"?>
<scenario name="TestScenario">
  <recv response="401" auth="true" optional="false"/>
  <send retrans="500">
<![CDATA[
REGISTER sip:[remote_ip] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:User@[remote_ip]>;tag=[call_number]
To: <sip:User@[remote_ip]>
Call-ID: [call_id]
CSeq: [cseq] REGISTER
Contact: <sip:sipp@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 20
Expires: 3600
[authentication username=User password=Password]
User-Agent: SIPp/sippy_cup
Content-Length: 0
]]>
</send>
  <send retrans="500">
<![CDATA[
INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: "sipp" <sip:sipp@[local_ip]>;tag=[call_number]
To: <sip:[service]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: [cseq] INVITE
Contact: <sip:sipp@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 100
User-Agent: SIPp/sippy_cup
Content-Type: application/sdp
Content-Length: [len]

v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=-
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
]]>
</send>
  <recv response="100" optional="true"/>
  <recv response="180" optional="true"/>
  <recv response="183" optional="true"/>
  <recv response="200" rrs="true" rtd="true"/>
  <pause milliseconds="15000"/>
  <pause milliseconds="500"/>
  <pause milliseconds="10000"/>
  <pause milliseconds="4000"/>
  <pause milliseconds="10000"/>
  <recv request="BYE"/>
  <send>
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:sipp@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 100
User-Agent: SIPp/sippy_cup
Content-Length: 0
[routes]
]]>
</send>
</scenario>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.