Hello!!<br> I m new in opensips and i m testing the load balancer cause i need it to balance calls between 4 asterisk.For the start i make the following scenario <br><br> Cisco gateway inbound ------> opensips ------> asterisk ---------> Cisco gateway outbound<br>
<br>when the call comes to the opensips, the load_balancer forward the call correctly to my asterisk but the call hangs up after 15 seg approximately.When i did a ngrep for the sip traffic in opensips, i realized that cisco gateway inbound never sent the ACK for 200 OK to opensips .<br>
In the Cisco's logs i saw that the reply of 200 ok is sent directly to public ip of asterisk but never to opensips server so asterisk still waiting for the ACK from opensips. <br>In the same way opensips never receive the BYE packet and the load never decrease when the call is hanging up.<br>
<br> <br> Cisco gateway opensips asterisk <br> ---invite---> <br> <--trying---- ---invite---> <br> <---trying---<br>
<----200OK---<br> <---200 OK--- <br> <----200OK---<br> <---200 OK--- <br>
<----200OK---<br> <---200 OK--- <br> <----200OK---<br> <---200 OK--- <br>
<br>Please can somebady help me to understand what cause that?<br><br>Best Regards!! <br> <br>Configuration of Cisco AS<br><br>...<br>dial-peer voice 205 voip<br> description VoIP GWs->OPENSIPS LAB Desarrollo<br>
preference 1<br> destination-pattern ^91112666[7-9]$<br> session protocol sipv2<br> session target dns:x$s$.$d$.<a href="http://opensips.lab.egtelecom.es">opensips.lab.egtelecom.es</a><br> dtmf-relay sip-notify rtp-nte<br>
no vad<br>..... <br> <br><br>This my opensips.cfg:<br><br>debug=4<br>log_stderror=no<br>log_facility=LOG_LOCAL0<br><br>fork=yes<br>children=4<br><br>disable_dns_blacklist=yes<br>auto_aliases=no<br>port=5060<br>
<br><br>####### Modules Section ########<br><br>mpath="//lib/opensips/modules/"<br><br>loadmodule "db_mysql.so"<br>loadmodule "signaling.so"<br>loadmodule "auth.so"<br>loadmodule "auth_db.so"<br>
loadmodule "sl.so"<br>loadmodule "tm.so"<br>loadmodule "rr.so"<br>loadmodule "maxfwd.so"<br>loadmodule "usrloc.so"<br>loadmodule "registrar.so"<br>loadmodule "textops.so"<br>
loadmodule "mi_fifo.so"<br>loadmodule "uri.so"<br>loadmodule "acc.so"<br>loadmodule "dialog.so"<br>loadmodule "load_balancer.so"<br>loadmodule "presence.so"<br>loadmodule "presence_xml.so"<br>
<br><br># ----------------- setting module-specific parameters ---------------<br><br><br># ----- mi_fifo params -----<br>modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")<br><br><br># ----- rr params -----<br>
# add value to ;lr param to cope with most of the UAs<br>modparam("rr", "enable_full_lr", 1)<br># do not append from tag to the RR (no need for this script)<br>modparam("rr", "append_fromtag", 1)<br>
<br><br># ----- registrar params -----<br>/* uncomment the next line not to allow more than 10 contacts per AOR */<br>modparam("registrar", "max_contacts", 10)<br><br><br># ----- usrloc params -----<br>
modparam("usrloc", "db_mode", 0)<br>/* uncomment the following lines if you want to enable DB persistency<br> for location entries */<br>modparam("usrloc", "db_mode", 2)<br>modparam("usrloc", "db_url","mysql://opensips:opensipsrw@localhost/opensips")<br>
<br><br># ----- uri params -----<br>modparam("uri", "use_uri_table", 0)<br><br><br># ----- acc params -----<br>/* what sepcial events should be accounted ? */<br>modparam("acc", "early_media", 1)<br>
modparam("acc", "report_ack", 1)<br>modparam("acc", "report_cancels", 1)<br>/* by default ww do not adjust the direct of the sequential requests.<br> if you enable this parameter, be sure the enable "append_fromtag"<br>
in "rr" module */<br>modparam("acc", "detect_direction", 0)<br>/* account triggers (flags) */<br>modparam("acc", "failed_transaction_flag", 3)<br>modparam("acc", "log_flag", 1)<br>
modparam("acc", "log_missed_flag", 2)<br>/* uncomment the following lines to enable DB accounting also */<br>modparam("acc", "db_flag", 1)<br>modparam("acc", "db_missed_flag", 2)<br>
<br><br># ----- auth_db params -----<br>/* uncomment the following lines if you want to enable the DB based<br> authentication */<br>modparam("auth_db", "calculate_ha1", yes)<br>modparam("auth_db", "password_column", "password")<br>
modparam("auth_db", "db_url","mysql://opensips:opensipsrw@localhost/opensips")<br>#modparam("auth_db", "load_credentials", "")<br><br># ----- dialog params -----<br>
modparam("dialog", "dlg_flag", 13)<br>modparam("dialog", "db_mode", 1)<br>modparam("dialog", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")<br>
<br><br># ----- presence params -----<br>/* uncomment the following lines if you want to enable presence */<br>modparam("presence|presence_xml", "db_url","mysql://opensips:opensipsrw@localhost/opensips")<br>
modparam("presence_xml", "force_active", 1)<br>modparam("presence", "server_address", "sip:<a href="http://10.234.227.199:5060">10.234.227.199:5060</a>")<br><br># ----- load_balancer params -----<br>
modparam("load_balancer", "db_url","mysql://opensips:opensipsrw@localhost/opensips")<br><br><br><br>####### Routing Logic ########<br><br><br># main request routing logic<br><br>route{<br><br>
if (!mf_process_maxfwd_header("10")) {<br> sl_send_reply("483","looping");<br> exit;<br> }<br> <br><br> if ($rU==NULL) { <br> # request with no Username in RURI <br>
sl_send_reply("484","Address Incomplete"); <br> exit; <br> }<br> #####################################<br><br> if (!has_totag()) {<br> # initial request<br>
record_route();<br> } else {<br> # sequential request -> obey Route indication<br> loose_route();<br> t_relay();<br> exit;<br> }<br>
##******************************************************************************************## <br> if (has_totag()) {<br><br> if (loose_route()) {<br> if (is_method("BYE")) {<br>
setflag(1); # do accounting ...<br> setflag(3); # ... even if the transaction fails<br> t_relay();<br> }<br> route(1);<br> } else {<br>
<br> if ( is_method("ACK") ) {<br> if ( t_check_trans() ) {<br> # non loose-route, but stateful ACK; must be an ACK after a 487 or e.g. 404 from upstream server<br>
xlog("ACK !!!!!!!!!!!!!!!!!!\n");<br><br> t_relay();<br> exit;<br> } else {<br> # ACK without matching transaction ... ignore and discard.\n");<br>
xlog("ACK ACK ACK ACK ACK");<br><br> exit;<br> }<br> }<br><br> sl_send_reply("404","Not here");<br>
}<br> exit;<br> }<br><br> ##******************************************************************************************## <br> # handle cancel and re-transmissions<br> if ( is_method("CANCEL") ) {<br>
if ( t_check_trans() )<br> t_relay();<br> exit;<br> }<br><br><br> # from now on we have only the initial requests<br> if (!is_method("INVITE")) {<br>
send_reply("405","Method Not Allowed");<br> exit;<br> }<br><br> # detect resources and do balancing<br> if (method=="INVITE") {<br> load_balance("1","calls"); <br>
}<br><br> # LB function returns negative if no suitable destination (for requested resources) is found,<br> # or if all destinations are full<br> if ($retcode<0) {<br> sl_send_reply("500","Service full");<br>
exit;<br> }<br><br> xlog("Selected destination is: $du\n");<br><br> # send it out<br> if (!t_relay()) {<br> sl_reply_error();<br> }<br>}<br><br>route[1] {<br>
if (!t_relay()) {<br> sl_reply_error();<br> };<br> exit;<br> }<br><br><br> # Presence route<br> /* uncomment the whole following route for enabling presence<br>
NOTE: do not forget to enable the call of this route from the main route */<br><br> route[2] {<br> if (!t_newtran())<br> {<br> sl_reply_error();<br> exit;<br> };<br>
<br> if(is_method("PUBLISH"))<br> {<br> handle_publish();<br> }<br> else<br> if( is_method("SUBSCRIBE"))<br> {<br> handle_subscribe();<br>
}<br><br> exit;<br> }<br><br><br> branch_route[2] {<br> xlog("new branch at $ru\n");<br> }<br><br><br> onreply_route[2] {<br> xlog("incoming reply\n");<br>
}<br><br><br> failure_route[1] {<br> if (t_was_cancelled()) {<br> exit;<br> }<br> } <br clear="all"><br>-- <br><span style="font-size: 13px; font-family: arial,sans-serif; border-collapse: collapse;">
<div>
<table style="border-width: 0px; padding: 0px;">
<tbody>
<tr>
<td style="border-width: 0px; padding: 0px 15px 0px 0px; margin: 0px; font-family: arial,sans-serif;"><img src="http://egt-lab-design.s3.amazonaws.com/FirmasMail/logotipo-100x100.png"></td>
<td style="border-width: 0px; padding: 0px; margin: 0px; vertical-align: top; font-family: arial,sans-serif;">
<div style="padding: 0px; margin-bottom: 10px;">
<div style="font-weight: bold; font-size: 15px; color: rgb(15, 120, 180); font-family: Arial;">Nawfel Oujdi</div>
<div style="font-size: 12px; color: rgb(100, 101, 103); font-family: Arial;"><b>Ingeniero VoIP</b></div>
<div style="font-size: 12px; color: rgb(100, 101, 103); font-family: Arial;"><a style="color: rgb(15, 120, 180);" href="mailto:noujdi@egtelecom.es" target="_blank">noujdi@egtelecom.es</a></div></div>
<div>
<div style="font-size: 12px; color: rgb(100, 101, 103); font-family: Arial;">EG telecom S.A | <a style="color: rgb(15, 120, 180);" href="http://www.egtelecom.es/" target="_blank">www.egtelecom.es</a></div>
<div style="font-size: 12px; color: rgb(100, 101, 103); font-family: Arial;">Oficina: <b>902 050 080</b></div>
<div style="font-size: 12px; color: rgb(100, 101, 103); font-family: Arial;">Agustín de Foxá, 25 - 9B | 28036 Madrid</div></div></td></tr></tbody></table>
<hr>
<p style="margin-top: 10px; font-size: 10px; color: rgb(163, 162, 167); font-family: Arial;">Aviso
legal: Este mensaje electrónico está dirigido únicamente a la(s)
dirección(es) indicadas anteriormente; el carácter confidencial,
personal e intransferible del mismo está protegido legalmente. Cualquier
revelación, uso o reenvío no autorizado, completo o en parte, está
prohibido. Si ha recibido este mensaje por equivocación, notifíquelo
inmediatamente a la persona que lo ha enviado y borre el mensaje
original junto con sus ficheros anexos sin leerlo ni grabarlo, total o
parcialmente.</p></div></span><br>