Re: [OpenSIPS-Users] Using Sipp stress tool with Opensips

2018-06-08 Thread Jan Skórczyński
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@
to usr loc via *opensipsctl ul add.*

Thanks for replies

2018-06-06 16:01 GMT+02:00 Daniel Zanutti :

> 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:
>
>
>   
> 
>check_it="false" assign_to="3"/>
>assign_to="4"/>
> 
>   
>
>   
> 
>   
>
>   
>   
>   
>
>   
>   
> 
>   
>
>   
>
>
>
>
> On Wed, Jun 6, 2018 at 7:32 AM, David Villasmil <
> david.villasmil.w...@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 > 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 callsPeak 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 300 0 0
>>>
>>>   <-- 180300
>>>   <-- 20030140
>>>   --> ACK E-RTD1 0 0 0 30
>>>
>>>   --> BYE0 0 0 0
>>>   <-- 2000 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 --> 90415   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 

Re: [OpenSIPS-Users] Using Sipp stress tool with Opensips

2018-06-06 Thread Daniel Zanutti
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:


  

  
  

  

  

  

  
  
  

  
  

  

  




On Wed, Jun 6, 2018 at 7:32 AM, David Villasmil <
david.villasmil.w...@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 
> 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 callsPeak 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 300 0 0
>>
>>   <-- 180300
>>   <-- 20030140
>>   --> ACK E-RTD1 0 0 0 30
>>
>>   --> BYE0 0 0 0
>>   <-- 2000 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 --> 90415   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 

Re: [OpenSIPS-Users] Using Sipp stress tool with Opensips

2018-06-06 Thread David Villasmil
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 
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 callsPeak 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 300 0 0
>
>   <-- 180300
>   <-- 20030140
>   --> ACK E-RTD1 0 0 0 30
>
>   --> BYE0 0 0 0
>   <-- 2000 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 --> 90415   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();
> 

[OpenSIPS-Users] Using Sipp stress tool with Opensips

2018-06-06 Thread Jan Skórczyński
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 callsPeak 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 300 0 0

  <-- 180300
  <-- 20030140
  --> ACK E-RTD1 0 0 0 30

  --> BYE0 0 0 0
  <-- 2000 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 --> 90415   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