SIPp: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
mNo edit summary
Line 5: Line 5:
Installed from apt package 'sip-tester' onto Bellman.
Installed from apt package 'sip-tester' onto Bellman.


Hit the server with one request and repeat every 1000 milliseconds.
This command will hit the server with one request (-r 1) at a time and repeat every second (-rp 1000).
Use 192.168.1.2 as the source IP address (bellman) and send from port 5123.
Use 192.168.1.2 as the source IP address (bellman).


  sipp -sn uac -r 1 -rp 1000 cds.wildsong.biz:5060 -p 5123 -i 192.168.1.2
  sipp -sn uac -r 1 -rp 1000 cds.wildsong.biz:5060 -i 192.168.1.2


On the asterisk console,
On the asterisk console, so I can see what happens, I turn on debug.


  core set debug 10
  core set debug 10
  sip set debug on
  sip set debug on


Then I can see
Then I can see requests coming in,


  Sending to 192.168.1.2:5123 (no NAT)
  Sending to 192.168.1.2:5123 (no NAT)
Line 35: Line 35:
  Content-Length: 0
  Content-Length: 0


So I add a peer called 'sipp' in sip.conf:
It is not authorized,
so I add a peer called 'sipp' in sip.conf:


  [sipp]
  [sipp]
Line 46: Line 47:
  allow=ulaw
  allow=ulaw


Progress: now I get this:
Making progress: now I get this error:


  SIP/2.0 404 Not Found
  SIP/2.0 404 Not Found

Revision as of 19:38, 19 June 2016

SIPp SIP testing program.

You can set it to pound away at a remote SIP server to see how it performs.

Installed from apt package 'sip-tester' onto Bellman.

This command will hit the server with one request (-r 1) at a time and repeat every second (-rp 1000). Use 192.168.1.2 as the source IP address (bellman).

sipp -sn uac -r 1 -rp 1000 cds.wildsong.biz:5060 -i 192.168.1.2

On the asterisk console, so I can see what happens, I turn on debug.

core set debug 10
sip set debug on

Then I can see requests coming in,

Sending to 192.168.1.2:5123 (no NAT)
Sending to 192.168.1.2:5123 (no NAT)
Using INVITE request as basis request - [email protected]
No matching peer for 'sipp' from '192.168.1.2:5123'

<--- Reliably Transmitting (no NAT) to 192.168.1.2:5123 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.2:5123;branch=z9hG4bK-9441-25-0;received=192.168.1.2
From: sipp <sip:[email protected]:5123>;tag=9441SIPpTag0025
To: sut <sip:[email protected]:5060>;tag=as58ab0f52
Call-ID: [email protected]
CSeq: 1 INVITE
Server: Asterisk PBX 13.9.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="14229989"
Content-Length: 0

It is not authorized, so I add a peer called 'sipp' in sip.conf:

[sipp]
type=friend
context=testing
host=192.168.1.2
user=sipp
canreinvite=no
disallow=all
allow=ulaw

Making progress: now I get this error:

SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 192.168.1.2:5123;branch=z9hG4bK-9453-11-0;received=192.168.1.2
From: sipp <sip:[email protected]:5123>;tag=9453SIPpTag0011
To: sut <sip:[email protected]:5060>;tag=as3d8a6110
Call-ID: [email protected]
CSeq: 1 INVITE
Server: Asterisk PBX 13.9.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

<------------>
[2016-06-19 12:18:27] NOTICE[25269][C-000000f1]: chan_sip.c:26219 handle_request_invite: Call from 'sipp' (192.168.1.2:5123) to extension 'service' rejected because extension not found in context 'testing'.
Scheduling destruction of SIP dialog '[email protected]' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:192.168.1.2:5123 --->
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.2:5123;branch=z9hG4bK-9453-11-0;received=192.168.1.2
From: sipp <sip:[email protected]:5123>;tag=9453SIPpTag0011
To: sut <sip:[email protected]:5060>;tag=as3d8a6110
Call-ID: [email protected]
CSeq: 1 ACK
Contact: <sip:[email protected]:5123;transport=UDP>
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0

So I add the context and the extension to 'extensions.conf' and do 'dialplan reload'.

[testing]
exten => service,1,Verbose(1,SIP test)
 same => n,Answer()
 same => n,Playback(SIP_Test_Success)
 same => n,Hangup()

And it works! I turn off SIP debug and I can see this in the asterisk console.

sip set debug off
== Using SIP RTP CoS mark 5
   -- Executing [service@testing:1] Verbose("SIP/sipp-00000298", "1,SIP test") in new stack
SIP test
   -- Executing [service@testing:2] Answer("SIP/sipp-00000298", "") in new stack
 == Spawn extension (testing, service, 2) exited non-zero on 'SIP/sipp-00000298'
 == Using SIP RTP CoS mark 5
   -- Executing [service@testing:1] Verbose("SIP/sipp-00000299", "1,SIP test") in new stack
SIP test
   -- Executing [service@testing:2] Answer("SIP/sipp-00000299", "") in new stack
 == Spawn extension (testing, service, 2) exited non-zero on 'SIP/sipp-00000299'
 == Using SIP RTP CoS mark 5
   -- Executing [service@testing:1] Verbose("SIP/sipp-0000029a", "1,SIP test") in new stack
SIP test
   -- Executing [service@testing:2] Answer("SIP/sipp-0000029a", "") in new stack
 == Spawn extension (testing, service, 2) exited non-zero on 'SIP/sipp-0000029a'
 == Using SIP RTP CoS mark 5
   -- Executing [service@testing:1] Verbose("SIP/sipp-0000029b", "1,SIP test") in new stack
SIP test
   -- Executing [service@testing:2] Answer("SIP/sipp-0000029b", "") in new stack
 == Spawn extension (testing, service, 2) exited non-zero on 'SIP/sipp-0000029b'