Simple usage of sipp to stress load

Hey
I’m a new user in the asterisk and voip world. I’m trying to do some benchmarking on asterisk with SRTP over TLS connection.
i found the SIPp tool and i’m trying to use it.
I found some basic examples and setup pjsip first to check UDP. i get errors when running SIPp. I found a forum thread but there the guy just disabled the auth and thats not good for me.
Asterisk stress testing using SIPp - Asterisk / Asterisk SIP - Asterisk Community

this are my conf files
pjsip.conf

[transport-udp]
type=transport
protocol=udp
bind=192.168.1.11:5060

[sipp]
type=endpoint
context=from-internal
allow=all
auth=sipp
aors=sipp
;media_encryption=sdes

[sipp]
type=auth
auth_type=userpass
password=password
username=sipp

[sipp]
type=aor
max_contacts=20

[service]
type=endpoint
context=from-internal
allow=all
auth=service
aors=service
;media_encryption=sdes

[service]
type=auth
auth_type=userpass
password=password
username=service

[service]
type=aor
max_contacts=20

extension.conf i left what was there by default

[from-internal]
exten = service,1,Answer()
same = n,Wait(30)
same = n,Playback(hello-world)
same = n,Hangup()

exten = sipp,1,Answer()
same = n,Wait(30)
same = n,Playback(hello-world)
same = n,Hangup()

i used the basic sipp command
./sipp -sn uac -max_socket 100 -trace_err 192.168.1.11:5060

i get in the sipp log many of

2023-02-21      16:07:34.545774 1676995654.545774: Aborting call on unexpected message for Call-Id '1-14218@192.168.1.10': while expecting '100' (index 1), received 'SIP/2.0 401 Unauthorized^M
Via: SIP/2.0/UDP 192.168.1.10:5060;rport=5060;received=192.168.1.10;branch=z9hG4bK-14218-1-0^M
Call-ID: 1-14218@192.168.1.10^M
From: "sipp" <sip:sipp@192.168.1.10>;tag=14218SIPpTag001^M
To: "service" <sip:service@192.168.1.11>;tag=z9hG4bK-14218-1-0^M
CSeq: 1 INVITE^M
WWW-Authenticate: Digest realm="asterisk",nonce="1676995654/4fd8aeeb5402bca919a0b8378a037adc",opaque="49ef92d60e24bb13",algorithm=MD5,qop="auth"^M
Server: Asterisk PBX 20.1.0^M
Content-Length:  0^M


when i increase the asterisk log level i see this
<--- Received SIP request (517 bytes) from UDP:192.168.1.10:5060 --->
INVITE sip:service@192.168.1.11:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.10:5060;branch=z9hG4bK-14740-1-0
From: sipp <sip:sipp@192.168.1.10:5060>;tag=14740SIPpTag001
To: service <sip:service@192.168.1.11:5060>
Call-ID: 1-14740@192.168.1.10
CSeq: 1 INVITE
Contact: sip:sipp@192.168.1.10:5060
Max-Forwards: 70
Subject: Performance Test
Content-Type: application/sdp
Content-Length:   131

v=0
o=user1 53655765 2353687637 IN IP4 192.168.1.10
s=-
c=IN IP4 192.168.1.10
t=0 0
m=audio 6000 RTP/AVP 0
a=rtpmap:0 PCMU/8000

<--- Transmitting SIP response (476 bytes) to UDP:192.168.1.10:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.10:5060;rport=5060;received=192.168.1.10;branch=z9hG4bK-14740-1-0
Call-ID: 1-14740@192.168.1.10
From: "sipp" <sip:sipp@192.168.1.10>;tag=14740SIPpTag001
To: "service" <sip:service@192.168.1.11>;tag=z9hG4bK-14740-1-0
CSeq: 1 INVITE
WWW-Authenticate: Digest realm="asterisk",nonce="1676996369/ab45af4f9fe2de332def17d1606d107e",opaque="2e53c70c2847ab6a",algorithm=MD5,qop="auth"
Server: Asterisk PBX 20.1.0
Content-Length:  0


<--- Received SIP request (403 bytes) from UDP:192.168.1.10:5060 --->
ACK sip:service@192.168.1.11 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.10:5060;rport=5060;received=192.168.1.10;branch=z9hG4bK-14740-1-0
From: "sipp" <sip:sipp@192.168.1.10>;tag=14740SIPpTag001
To: "service" <sip:service@192.168.1.11>;tag=z9hG4bK-14740-1-0
Call-ID: 1-14740@192.168.1.10
CSeq: 1 ACK
Contact: <sip:sipp@192.168.1.10:5060;transport=UDP>
Max-Forwards: 70
Subject: Performance Test
Content-Length: 0


<--- Received SIP request (517 bytes) from UDP:192.168.1.10:5060 --->
INVITE sip:service@192.168.1.11:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.10:5060;branch=z9hG4bK-14740-2-0
From: sipp <sip:sipp@192.168.1.10:5060>;tag=14740SIPpTag002
To: service <sip:service@192.168.1.11:5060>
Call-ID: 2-14740@192.168.1.10
CSeq: 1 INVITE
Contact: sip:sipp@192.168.1.10:5060
Max-Forwards: 70
Subject: Performance Test
Content-Type: application/sdp
Content-Length:   131

v=0
o=user1 53655765 2353687637 IN IP4 192.168.1.10
s=-
c=IN IP4 192.168.1.10
t=0 0
m=audio 6000 RTP/AVP 0
a=rtpmap:0 PCMU/8000

thanks for your help

https://sipp.readthedocs.io/en/v3.6.1/scenarios/sipauth.html

Asterisk uses digest authentication

Thanks David
I tried adding the [authentication] without luck, not sure it’s critical.
I got stuck in the TLS im trying to run a simple tls this is my command
./sipp -m 1 -sf …/sipp_scenarios/pfca_uac_apattern_crypto_simple.xml -t ln -rtpcheck_debug -srtpcheck_debug -trace_err -tls_cert …/sipp.pem -tls_key …/sipp.pem -max_socket 10 192.168.0.10:5061

but i get this output from sipp
any idea?

------------------------------ Scenario Screen -------- [1-9]: Change Screen --
  Call rate (length)   Port   Total-time  Total-calls  Remote-host
  10.0(0 ms)/1.000s   5060       0.22 s            1  192.168.0.10:5061(TLS)

  Call limit 1 hit, 0.0 s period          0 ms scheduler resolution
  0 calls (limit 60)                      Peak was 1 calls, after 0 s
  0 Running, 4 Paused, 0 Woken up
  0 dead call msg (discarded)             0 out-of-call msg (discarded)
  0 open sockets                          0/0/0 TLS errors (send/recv/cong)
  0 open sockets                          0/0/0 TLS errors (send/recv/cong)

                                 Messages  Retrans   Timeout   Unexpected-Msg
0 :      INVITE ---------->         1         0         0
1 :         100 <----------         1         0         0         0
2 :         180 <----------         0         0         0         1
3 :       PRACK ---------->         0         0         0
4 :         200 <----------         0         0         0         0
5 :         200 <----------         0         0         0         0
6 :         ACK ---------->         0         0
7 :              [ NOP ]
8 :       Pause [   2000ms]         0                             0
9 :         BYE ---------->         0         0         0
10:         200 <----------         0         0         0         0
------------------------------ Test Terminated --------------------------------
----------------------------- Statistics Screen ------- [1-9]: Change Screen --
  Start Time             | 2023-02-23   00:52:04.290573 1677106324.290573
  Last Reset Time        | 2023-02-23   00:52:04.520092 1677106324.520092
  Current Time           | 2023-02-23   00:52:04.520314 1677106324.520314
-------------------------+---------------------------+--------------------------
  Counter Name           | Periodic value            | Cumulative value
-------------------------+---------------------------+--------------------------
  Elapsed Time           | 00:00:00:000000           | 00:00:00:000000
  Call Rate              |    0.000 cps              |    4.367 cps
-------------------------+---------------------------+--------------------------
  Incoming calls created |        0                  |        0
  Outgoing calls created |        0                  |        1
  Total Calls created    |                           |        1
  Current Calls          |        0                  |
-------------------------+---------------------------+--------------------------
  Successful call        |        0                  |        0
  Failed call            |        0                  |        1
-------------------------+---------------------------+--------------------------
  Call Length            | 00:00:00:000000           | 00:00:00:000000
------------------------------ Test Terminated --------------------------------
2023-02-23      00:52:04.417121 1677106324.417121: Aborting call on unexpected message for Call-Id '1-5846@1.1.65.22': while expecting '180' (index 2), received 'SIP/2.0 200 OK
Via: SIP/2.0/TLS 192.168.0.11:37437;rport=37437;received=1.1.65.22;branch=z9hG4bK-5846-1-0
Call-ID: 1-5846@192.168.0.11
From: "16001" <sip:16001@192.168.0.10>;tag=1
To: <sip:service@192.168.0.10>;tag=3b7910f2-2ce2-4e23-ae21-5e451920ba48
CSeq: 10 INVITE
Server: Asterisk PBX 20.1.0
Contact: <sip:192.168.0.10:5061;transport=TLS>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 3600;refresher=uas
Content-Type: application/sdp
Content-Length:   449

v=0
o=- 0 2 IN IP4 1.1.64.180
s=Asterisk
c=IN IP4 1.1.64.180
t=0 0
m=audio 17180 RTP/AVP 0 8 18 9 103 101
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:Xlp1RbLvJUUzSIZihVKYg2McBRMDXqXViDBJFM1k
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:9 G722/8000
a=rtpmap:103 G7221/16000
a=fmtp:103 bitrate=32000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:80
a=sendrecv
'

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.