[OpenSIPS-Users] Using Sipp stress tool with Opensips

Jan Skórczyński jskorczynski at milosolutions.com
Fri Jun 8 06:32:27 EDT 2018


I managed to run Sipp finally. I tried to run UAC from my PC which is
behind NAT, and UAS from VPN where opensips is installed.
I just moved UAC to the machine which public address and add
service@<uas_ip_address>
to usr loc via *opensipsctl ul add.*

Thanks for replies

2018-06-06 16:01 GMT+02:00 Daniel Zanutti <daniel.zanutti at gmail.com>:

> I think the problem is related to configuring SIPP properly.
>
> If I'm not wrong, SIPP standard scenario for UAC/UAS is configured to work
> with a gateway (B2B), but Opensips is a proxy. You have to use Routes to
> properly handle the incoming call and respond it.
>
> Take a lookt at "rrs" param of recv command.
>
> This is the code I use on UAC.xml, after receiving 200 OK from initial
> invite:
>
>
>   <recv response="200" rrs="true" response_txn="invite">
>     <action>
>       <ereg regexp=";branch=[^;]*" search_in="hdr" header="Via"
> check_it="false" assign_to="3"/>
>       <ereg regexp=";.*" search_in="hdr" header="To" check_it="false"
> assign_to="4"/>
>     </action>
>   </recv>
>
>   <send ack_txn="invite">
>     <![CDATA[
>
>       ACK [next_url] SIP/2.0
>       Via: SIP/2.0/[transport] [local_ip]:[local_port][$3]
>       [routes]
>       From: <sip:[$1]@[$2]:[local_port]>;tag=[pid]SIPpTag00[call_number]
>       To: <sip:[field0]@[$2]:[remote_port]>[$4]
>       Call-ID: [call_id]
>       CSeq: 1 ACK
>       Contact: sip:[$1]@[local_ip]:[local_port]
>       Max-Forwards: 70
>       Subject: Performance Test
>       Content-Length: 0
>
>     ]]>
>   </send>
>
>   <!-- This delay can be customized by the -d command-line option       -->
>   <!-- or by adding a 'milliseconds = "value"' option here.             -->
>   <pause distributio="uniform" min="4000" max="20000" />
>
>   <!-- The 'crlf' option inserts a blank line in the statistics report. -->
>   <send start_txn="bye">
>     <![CDATA[
>
>       BYE [next_url] SIP/2.0
>       Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
>       [routes]
>       From: <sip:[$1]@[$2]:[local_port]>;tag=[pid]SIPpTag00[call_number]
>       To: <sip:[field0]@[$2]:[remote_port]>[peer_tag_param]
>       Call-ID: [call_id]
>       CSeq: 2 BYE
>       Contact: sip:sipp@[local_ip]:[local_port]
>       Max-Forwards: 70
>       Subject: Performance Test
>       Content-Length: 0
>
>     ]]>
>   </send>
>
>   <recv response="200" response_txn="bye"/>
>
>
>
>
> On Wed, Jun 6, 2018 at 7:32 AM, David Villasmil <
> david.villasmil.work at gmail.com> wrote:
>
>> Are the 2 sipp instances behind nat? If so, you need to set the
>> appropiate switch on sipp, i believe it is
>> -bind_local the actual local ip
>> -i the public ip
>>
>> Take a look at sipp's documentation
>>
>> Hope it helps
>>
>> David
>>
>> On Wed, Jun 6, 2018, 10:33 Jan Skórczyński <jskorczynski at milosolutions.co
>> m> wrote:
>>
>>> Hello,
>>>
>>> I'm a beginner in VOIP world so maybe this question have obvious
>>> answer...
>>> I would like to perform series of stress tests of my Opensips server.
>>>
>>> Opensips instance is located on VPS at adres XXX.XXX.XXX.XXX (public IP)
>>> and it is listening on 5060 port. I'm using custom client apps, everything
>>> works fine, however I have some issue when I try to test with Sipp.
>>>
>>> I'm setting UAS on my VPS, with the following command:
>>>
>>> sipp -sn uas -rsa XXX.XXX.XXX.XXX:5060 -i XXX.XXX.XXX.XXX
>>>
>>> and UAC on my PC:
>>>
>>> sipp -sn uac XXX.XXX.XXX.XXX:5061  -i 192.168.0.103
>>>
>>> I can see on UAS that it receives messages from my UAC, but it cannot
>>> reply to them.
>>>
>>> ------------------------------ Scenario Screen -------- [1-9]: Change
>>> Screen --
>>>   Port   Total-time  Total-calls  Transport
>>>   5061      19.07 s           30  UDP
>>>
>>>   0 new calls during 1.004 s period      1 ms scheduler resolution
>>>   0 calls                                Peak was 6 calls, after 6 s
>>>   0 Running, 31 Paused, 4 Woken up
>>>   90 dead call msg (discarded)
>>>   4 open sockets
>>>
>>>                                  Messages  Retrans   Timeout
>>>  Unexpected-Msg
>>>   ----------> INVITE             30        0         0         0
>>>
>>>   <---------- 180                30        0
>>>   <---------- 200                30        14        0
>>>   ----------> ACK         E-RTD1 0         0         0         30
>>>
>>>   ----------> BYE                0         0         0         0
>>>   <---------- 200                0         0
>>>   [   4000ms] Pause              0                             0
>>> ------------------------------ Sipp Server Mode
>>> -------------------------------
>>>
>>>
>>> Logs from UAC:
>>>
>>> ------------------------------ Scenario Screen -------- [1-9]: Change
>>> Screen --
>>>   Call-rate(length)   Port   Total-time  Total-calls  Remote-host
>>>   10.0(0 ms)/1.000s   5060      73.29 s           90
>>> XXX.XXX.XXX.XXX:5061(UDP)
>>>
>>>   0 new calls during 1.004 s period      1 ms scheduler resolution
>>>   30 calls (limit 30)                    Peak was 30 calls, after 3 s
>>>   0 Running, 62 Paused, 24 Woken up
>>>   0 dead call msg (discarded)            0 out-of-call msg (discarded)
>>>
>>>   3 open sockets
>>>
>>>                                  Messages  Retrans   Timeout
>>>  Unexpected-Msg
>>>       INVITE ---------->         90        415       60
>>>          100 <----------         0         0         0         0
>>>          180 <----------         0         0         0         0
>>>          183 <----------         0         0         0         0
>>>          200 <----------  E-RTD1 0         0         0         0
>>>          ACK ---------->         0         0
>>>        Pause [      0ms]         0                             0
>>>          BYE ---------->         0         0         0
>>>          200 <----------         0         0         0         0
>>>
>>> ------ [+|-|*|/]: Adjust rate ---- [q]: Soft exit ---- [p]: Pause
>>> traffic -----
>>>
>>> And here is my opensips.cfg routing script:
>>>
>>> route{
>>> xlog("Begin route");
>>> if (!mf_process_maxfwd_header("10")) {
>>> xlog("Too many hops");
>>> send_reply("483","Too Many Hops");
>>> exit;
>>> }
>>>
>>> if (has_totag() && ($fU!="sipp")) {
>>> xlog("Has totag");
>>> # handle hop-by-hop ACK (no routing required)
>>> if ( is_method("ACK") && t_check_trans() ) {
>>>                         xlog("Method: ACK && t_check_trans.
>>> Relaying...");
>>> t_relay();
>>> exit;
>>> }
>>>
>>> # sequential request within a dialog should
>>> # take the path determined by record-routing
>>> if ( !loose_route() ) {
>>> # we do record-routing for all our traffic, so we should not
>>> # receive any sequential requests without Route hdr.
>>> send_reply("404","Not here");
>>> exit;
>>> }
>>>
>>> if (is_method("BYE")) {
>>> # do accounting even if the transaction fails
>>> #do_accounting("log","failed");
>>> }
>>>
>>> # route it out to whatever destination was set by loose_route()
>>> # in $du (destination URI).
>>> route(relay);
>>> exit;
>>> }
>>>
>>> # CANCEL processing
>>> if (is_method("CANCEL")) {
>>> if (t_check_trans())
>>> t_relay();
>>> exit;
>>> }
>>>
>>> # absorb retransmissions, but do not create transaction
>>> t_check_trans();
>>>
>>> if ( !(is_method("REGISTER")  ) ) {
>>> if (is_myself("$fd")) {
>>> } else {
>>> # if caller is not local, then called number must be local
>>> if (!is_myself("$rd")) {
>>> send_reply("403","Relay Forbidden");
>>> exit;
>>> }
>>> }
>>> }
>>>
>>> # preloaded route checking
>>> if (loose_route()) {
>>> xlog("L_ERR",
>>> "Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");
>>> if (!is_method("ACK"))
>>> send_reply("403","Preload Route denied");
>>> exit;
>>> }
>>>
>>> # record routing
>>> if (!is_method("REGISTER|MESSAGE"))
>>> record_route();
>>>
>>> # account only INVITEs
>>> if (is_method("INVITE")) {
>>> create_dialog();
>>> engage_media_proxy();
>>> #do_accounting("log");
>>> }
>>> if (!is_myself("$rd")) {
>>> append_hf("P-hint: outbound\r\n");
>>> # if you have some interdomain connections via TLS
>>> ## CUSTOMIZE IF NEEDED
>>> ##if ($rd=="tls_domain1.net"
>>> ## || $rd=="tls_domain2.net"
>>> ##) {
>>> ## force_send_socket(tls:127.0.0.1:5061); # CUSTOMIZE
>>> ##}
>>> route(relay);
>>> }
>>>
>>> # requests for my domain
>>> if (is_method("PUBLISH|SUBSCRIBE")) {
>>> send_reply("503", "Service Unavailable");
>>> exit;
>>> }
>>>
>>> if (is_method("REGISTER")) {
>>> xlog("NEW REGISTER!");
>>> if ($proto == "tls")
>>> setflag(TCP_PERSISTENT);
>>> if (!save("location"))
>>> sl_reply_error();
>>>
>>> exit;
>>> }
>>>
>>> if ($rU==NULL) {
>>> # request with no Username in RURI
>>> send_reply("484","Address Incomplete");
>>> exit;
>>> }
>>>
>>> # do lookup with method filtering
>>> if (!lookup("location","m")) {
>>> xlog("not found");
>>> t_reply("404", "Not Found");
>>> exit;
>>> } else {
>>> xlog("FOUND");
>>> }
>>>
>>> # when routing via usrloc, log the missed calls also
>>> #do_accounting("log","missed");
>>> route(relay);
>>> }
>>>
>>>
>>> route[relay] {
>>> # for INVITEs enable some additional helper routes
>>> if (is_method("INVITE")) {
>>> t_on_branch("per_branch_ops");
>>> t_on_reply("handle_nat");
>>> t_on_failure("missed_call");
>>> }
>>>
>>> if (!t_relay()) {
>>> send_reply("500","Internal Error");
>>> }
>>> exit;
>>> }
>>>
>>> branch_route[per_branch_ops] {
>>> xlog("new branch at $ru\n");
>>> }
>>>
>>> onreply_route[handle_nat] {
>>> xlog("incoming reply\n");
>>> }
>>>
>>>
>>> failure_route[missed_call] {
>>> if (t_was_cancelled()) {
>>> exit;
>>> }
>>>
>>> # uncomment the following lines if you want to block client
>>> # redirect based on 3xx replies.
>>> ##if (t_check_status("3[0-9][0-9]")) {
>>> ##t_reply("404","Not found");
>>> ## exit;
>>> ##}
>>> }
>>>
>>>
>>> What I'm doing wrong? How can I test my Opensips instance? I would like
>>> to perform not only sip stress test but also test with some media
>>> transport. Should I run UAC from public IP too?
>>>
>>> Thanks in advance for reply.
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20180608/ca867e1e/attachment-0001.html>


More information about the Users mailing list