mojolingo / sippy_cup

Create SIP load test scenarios the easy way
http://mojolingo.github.io/sippy_cup
MIT License
218 stars 78 forks source link

Sippy Cup Not Generating All Scenario Elements #75

Closed smearl closed 9 years ago

smearl commented 9 years ago

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>
bklang commented 9 years ago

The default mechanism we use to send digits is RFC2833, which means that the digits are in the media, not in the signaling. So it's correct that they do not appear in the XML output. Instead, the digits are encoded into the RTP stream that is in the PCAP file. If you were to play back that scenario against a SIP target, you should see the digits appear as SIPp plays back the PCAP file to the SIP target.

Another thing I noticed: you are using a SIP registration, but the version of SippyCup you are using doesn't create registrations properly. You have two choices: you can use SippyCup from the develop branch, or you can remove it until I get a chance to release a new version. If you're up to testing the develop branch, feedback would be very much appreciated. I'm just about to make a release once I have a chance to ensure the documentation is up-to-date.

smearl commented 9 years ago

Thanks Ben. I'm using RubyMine and have the develop branch cloned, but I can't seem to get the gem installed to allow me to use it in another RubyMine project. I can see all of my other recently installed gems in "/home/searl/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems" (pcaprub for example), but no sippy_cup (0.4.2 - as I upped the version locally).

Being new to Ruby I'd appreciate any suggestions at all on how to get the sippy_cup gem installed correctly in order to use it in another Ruby project.