<div dir="ltr"><div><div>Hello,</div><div><br></div><div>I'm a beginner in VOIP world so maybe this question have obvious answer... </div><div>I would like to perform series of stress tests of my Opensips server.</div><div><br></div><div>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.</div><div><br></div><div>I'm setting UAS on my VPS, with the following command:</div><div><br></div><div>sipp -sn uas -rsa XXX.XXX.XXX.XXX:5060 -i XXX.XXX.XXX.XXX</div><div><br></div><div>and UAC on my PC: </div><div><br></div><div>sipp -sn uac XXX.XXX.XXX.XXX:5061 -i 192.168.0.103</div><div><br></div><div>I can see on UAS that it receives messages from my UAC, but it cannot reply to them.</div><div><br></div><div>------------------------------ Scenario Screen -------- [1-9]: Change Screen --</div><div> Port Total-time Total-calls Transport</div><div> 5061 19.07 s 30 UDP</div><div><br></div><div> 0 new calls during 1.004 s period 1 ms scheduler resolution</div><div> 0 calls Peak was 6 calls, after 6 s</div><div> 0 Running, 31 Paused, 4 Woken up</div><div> 90 dead call msg (discarded) </div><div> 4 open sockets </div><div><br></div><div> Messages Retrans Timeout Unexpected-Msg</div><div> ----------> INVITE 30 0 0 0 </div><div><br></div><div> <---------- 180 30 0 </div><div> <---------- 200 30 14 0 </div><div> ----------> ACK E-RTD1 0 0 0 30 </div><div><br></div><div> ----------> BYE 0 0 0 0 </div><div> <---------- 200 0 0 </div><div> [ 4000ms] Pause 0 0 </div><div>------------------------------ Sipp Server Mode -------------------------------</div><div><br></div><div><br></div><div>Logs from UAC:</div><div><br></div><div>------------------------------ Scenario Screen -------- [1-9]: Change Screen --</div><div> Call-rate(length) Port Total-time Total-calls Remote-host</div><div> 10.0(0 ms)/1.000s 5060 73.29 s 90 XXX.XXX.XXX.XXX:5061(UDP)</div><div><br></div><div> 0 new calls during 1.004 s period 1 ms scheduler resolution</div><div> 30 calls (limit 30) Peak was 30 calls, after 3 s</div><div> 0 Running, 62 Paused, 24 Woken up</div><div> 0 dead call msg (discarded) 0 out-of-call msg (discarded) </div><div> 3 open sockets </div><div><br></div><div> Messages Retrans Timeout Unexpected-Msg</div><div> INVITE ----------> 90 415 60 </div><div> 100 <---------- 0 0 0 0 </div><div> 180 <---------- 0 0 0 0 </div><div> 183 <---------- 0 0 0 0 </div><div> 200 <---------- E-RTD1 0 0 0 0 </div><div> ACK ----------> 0 0 </div><div> Pause [ 0ms] 0 0 </div><div> BYE ----------> 0 0 0 </div><div> 200 <---------- 0 0 0 0 </div><div><br></div><div>------ [+|-|*|/]: Adjust rate ---- [q]: Soft exit ---- [p]: Pause traffic -----</div><div><br></div><div>And here is my opensips.cfg routing script:</div><div><br></div><div>route{</div><div><span style="white-space:pre"> </span>xlog("Begin route");</div><div><span style="white-space:pre"> </span>if (!mf_process_maxfwd_header("10")) {</div><div><span style="white-space:pre"> </span>xlog("Too many hops");</div><div><span style="white-space:pre"> </span>send_reply("483","Too Many Hops");</div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span>if (has_totag() && ($fU!="sipp")) {</div><div><span style="white-space:pre"> </span>xlog("Has totag");</div><div><span style="white-space:pre"> </span># handle hop-by-hop ACK (no routing required)</div><div><span style="white-space:pre"> </span>if ( is_method("ACK") && t_check_trans() ) {</div><div> xlog("Method: ACK && t_check_trans. Relaying...");</div><div><span style="white-space:pre"> </span>t_relay();</div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span># sequential request within a dialog should</div><div><span style="white-space:pre"> </span># take the path determined by record-routing</div><div><span style="white-space:pre"> </span>if ( !loose_route() ) {</div><div><span style="white-space:pre"> </span># we do record-routing for all our traffic, so we should not</div><div><span style="white-space:pre"> </span># receive any sequential requests without Route hdr.</div><div><span style="white-space:pre"> </span>send_reply("404","Not here");</div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span>if (is_method("BYE")) {</div><div><span style="white-space:pre"> </span># do accounting even if the transaction fails</div><div><span style="white-space:pre"> </span>#do_accounting("log","failed");</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span># route it out to whatever destination was set by loose_route()</div><div><span style="white-space:pre"> </span># in $du (destination URI).</div><div><span style="white-space:pre"> </span>route(relay);</div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span># CANCEL processing</div><div><span style="white-space:pre"> </span>if (is_method("CANCEL")) {</div><div><span style="white-space:pre"> </span>if (t_check_trans())</div><div><span style="white-space:pre"> </span>t_relay();</div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span># absorb retransmissions, but do not create transaction</div><div><span style="white-space:pre"> </span>t_check_trans();</div><div><br></div><div><span style="white-space:pre"> </span>if ( !(is_method("REGISTER") ) ) {</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>if (is_myself("$fd")) {</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>} else {</div><div><span style="white-space:pre"> </span># if caller is not local, then called number must be local</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>if (!is_myself("$rd")) {</div><div><span style="white-space:pre"> </span>send_reply("403","Relay Forbidden");</div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span># preloaded route checking</div><div><span style="white-space:pre"> </span>if (loose_route()) {</div><div><span style="white-space:pre"> </span>xlog("L_ERR",</div><div><span style="white-space:pre"> </span>"Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");</div><div><span style="white-space:pre"> </span>if (!is_method("ACK"))</div><div><span style="white-space:pre"> </span>send_reply("403","Preload Route denied");</div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span># record routing</div><div><span style="white-space:pre"> </span>if (!is_method("REGISTER|MESSAGE"))</div><div><span style="white-space:pre"> </span>record_route();</div><div><br></div><div><span style="white-space:pre"> </span># account only INVITEs</div><div><span style="white-space:pre"> </span>if (is_method("INVITE")) {</div><div><span style="white-space:pre"> </span>create_dialog();</div><div><span style="white-space:pre"> </span>engage_media_proxy();</div><div><span style="white-space:pre"> </span>#do_accounting("log");</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>if (!is_myself("$rd")) {</div><div><span style="white-space:pre"> </span>append_hf("P-hint: outbound\r\n"); </div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span># if you have some interdomain connections via TLS</div><div><span style="white-space:pre"> </span>## CUSTOMIZE IF NEEDED</div><div><span style="white-space:pre"> </span>##if ($rd=="<a href="http://tls_domain1.net">tls_domain1.net</a>"</div><div><span style="white-space:pre"> </span>## || $rd=="<a href="http://tls_domain2.net">tls_domain2.net</a>"</div><div><span style="white-space:pre"> </span>##) {</div><div><span style="white-space:pre"> </span>##<span style="white-space:pre"> </span>force_send_socket(tls:<a href="http://127.0.0.1:5061">127.0.0.1:5061</a>); # CUSTOMIZE</div><div><span style="white-space:pre"> </span>##}</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>route(relay);</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span># requests for my domain</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>if (is_method("PUBLISH|SUBSCRIBE")) {</div><div><span style="white-space:pre"> </span>send_reply("503", "Service Unavailable");</div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span>if (is_method("REGISTER")) {</div><div><span style="white-space:pre"> </span>xlog("NEW REGISTER!");</div><div><span style="white-space:pre"> </span>if ($proto == "tls")</div><div><span style="white-space:pre"> </span>setflag(TCP_PERSISTENT);</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>if (!save("location"))</div><div><span style="white-space:pre"> </span>sl_reply_error();</div><div><br></div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span>if ($rU==NULL) {</div><div><span style="white-space:pre"> </span># request with no Username in RURI</div><div><span style="white-space:pre"> </span>send_reply("484","Address Incomplete");</div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>}<span style="white-space:pre"> </span> </div><div><br></div><div><span style="white-space:pre"> </span># do lookup with method filtering</div><div><span style="white-space:pre"> </span>if (!lookup("location","m")) {</div><div><span style="white-space:pre"> </span>xlog("not found");<span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>t_reply("404", "Not Found");</div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>} else {</div><div><span style="white-space:pre"> </span>xlog("FOUND");</div><div><span style="white-space:pre"> </span>}<span style="white-space:pre"> </span></div><div><br></div><div><span style="white-space:pre"> </span># when routing via usrloc, log the missed calls also</div><div><span style="white-space:pre"> </span>#do_accounting("log","missed");</div><div><span style="white-space:pre"> </span>route(relay);</div><div>}</div><div><br></div><div><br></div><div>route[relay] {</div><div><span style="white-space:pre"> </span># for INVITEs enable some additional helper routes</div><div><span style="white-space:pre"> </span>if (is_method("INVITE")) {</div><div><span style="white-space:pre"> </span>t_on_branch("per_branch_ops");</div><div><span style="white-space:pre"> </span>t_on_reply("handle_nat");</div><div><span style="white-space:pre"> </span>t_on_failure("missed_call");</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span>if (!t_relay()) {</div><div><span style="white-space:pre"> </span>send_reply("500","Internal Error");</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span>exit;</div><div>}</div><div><br></div><div>branch_route[per_branch_ops] {</div><div><span style="white-space:pre"> </span>xlog("new branch at $ru\n");</div><div>}</div><div><br></div><div>onreply_route[handle_nat] {</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>xlog("incoming reply\n");</div><div>}</div><div><br></div><div><br></div><div>failure_route[missed_call] {</div><div><span style="white-space:pre"> </span>if (t_was_cancelled()) {</div><div><span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>}</div><div><br></div><div><span style="white-space:pre"> </span># uncomment the following lines if you want to block client </div><div><span style="white-space:pre"> </span># redirect based on 3xx replies.</div><div><span style="white-space:pre"> </span>##if (t_check_status("3[0-9][0-9]")) {</div><div><span style="white-space:pre"> </span>##t_reply("404","Not found");</div><div><span style="white-space:pre"> </span>##<span style="white-space:pre"> </span>exit;</div><div><span style="white-space:pre"> </span>##}</div><div><span style="white-space:pre"> </span></div><div>}</div><div><br></div><div><br></div><div>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?</div><div><br></div><div>Thanks in advance for reply.</div></div>
</div>