[OpenSIPS-Users] No ACK response for 200 ok

Nawfel Oujdi noujdi at egtelecom.es
Tue Nov 23 18:32:09 CET 2010


Hello!!
 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

      Cisco gateway inbound ------> opensips ------> asterisk  --------->
Cisco gateway outbound

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 .
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.
In the same way opensips never receive the BYE packet and the load never
decrease  when the call is hanging up.


        Cisco gateway          opensips        asterisk
                  ---invite--->
                  <--trying----      ---invite--->
                                     <---trying---
                                     <----200OK---
                  <---200 OK---
                                      <----200OK---
                  <---200 OK---
                                      <----200OK---
                  <---200 OK---
                                      <----200OK---
                  <---200 OK---

Please can somebady help me to understand  what cause that?

Best Regards!!

Configuration of Cisco AS

...
dial-peer voice 205 voip
 description VoIP GWs->OPENSIPS LAB Desarrollo
 preference 1
 destination-pattern ^91112666[7-9]$
 session protocol sipv2
 session target dns:x$s$.$d$.opensips.lab.egtelecom.es
 dtmf-relay sip-notify rtp-nte
 no vad
.....


This my opensips.cfg:

debug=4
log_stderror=no
log_facility=LOG_LOCAL0

fork=yes
children=4

disable_dns_blacklist=yes
auto_aliases=no
port=5060


####### Modules Section ########

mpath="//lib/opensips/modules/"

loadmodule "db_mysql.so"
loadmodule "signaling.so"
loadmodule "auth.so"
loadmodule "auth_db.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
loadmodule "uri.so"
loadmodule "acc.so"
loadmodule "dialog.so"
loadmodule "load_balancer.so"
loadmodule "presence.so"
loadmodule "presence_xml.so"


# ----------------- setting module-specific parameters ---------------


# ----- mi_fifo params -----
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")


# ----- rr params -----
# add value to ;lr param to cope with most of the UAs
modparam("rr", "enable_full_lr", 1)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 1)


# ----- registrar params -----
/* uncomment the next line not to allow more than 10 contacts per AOR */
modparam("registrar", "max_contacts", 10)


# ----- usrloc params -----
modparam("usrloc", "db_mode",   0)
/* uncomment the following lines if you want to enable DB persistency
   for location entries */
modparam("usrloc", "db_mode",   2)
modparam("usrloc", "db_url","mysql://opensips:opensipsrw@localhost
/opensips")


# ----- uri params -----
modparam("uri", "use_uri_table", 0)


# ----- acc params -----
/* what sepcial events should be accounted ? */
modparam("acc", "early_media", 1)
modparam("acc", "report_ack", 1)
modparam("acc", "report_cancels", 1)
/* by default ww do not adjust the direct of the sequential requests.
   if you enable this parameter, be sure the enable "append_fromtag"
   in "rr" module */
modparam("acc", "detect_direction", 0)
/* account triggers (flags) */
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 2)
/* uncomment the following lines to enable DB accounting also */
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)


# ----- auth_db params -----
/* uncomment the following lines if you want to enable the DB based
   authentication */
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "db_url","mysql://opensips:opensipsrw@localhost
/opensips")
#modparam("auth_db", "load_credentials", "")

# ----- dialog  params -----
modparam("dialog", "dlg_flag", 13)
modparam("dialog", "db_mode", 1)
modparam("dialog", "db_url", "mysql://opensips:opensipsrw@localhost
/opensips")


# ----- presence params -----
/* uncomment the following lines if you want to enable presence */
modparam("presence|presence_xml",
"db_url","mysql://opensips:opensipsrw@localhost/opensips")
modparam("presence_xml", "force_active", 1)
modparam("presence", "server_address", "sip:10.234.227.199:5060")

# ----- load_balancer params -----
modparam("load_balancer", "db_url","mysql://opensips:opensipsrw@localhost
/opensips")



####### Routing Logic ########


# main request routing logic

route{

  if (!mf_process_maxfwd_header("10")) {
                sl_send_reply("483","looping");
                exit;
        }


      if ($rU==NULL) {
            # request with no Username in RURI
               sl_send_reply("484","Address Incomplete");
               exit;
      }
        #####################################

        if (!has_totag()) {
                # initial request
                record_route();
        } else {
                # sequential request -> obey Route indication
                loose_route();
                t_relay();
                exit;
        }

##******************************************************************************************##

       if (has_totag()) {

           if (loose_route()) {
               if (is_method("BYE")) {
                      setflag(1); # do accounting ...
                      setflag(3); # ... even if the transaction fails
                       t_relay();
                }
               route(1);
            } else {

                    if ( is_method("ACK") ) {
                        if ( t_check_trans() ) {
                              # non loose-route, but stateful ACK; must be
an ACK after a 487 or e.g. 404 from upstream server
                              xlog("ACK !!!!!!!!!!!!!!!!!!\n");

                              t_relay();
                              exit;
                        } else {
                              # ACK without matching transaction ... ignore
and discard.\n");
                             xlog("ACK ACK ACK ACK ACK");

                               exit;
                               }
                    }

                sl_send_reply("404","Not here");
                }
              exit;
    }


##******************************************************************************************##

        # handle cancel and re-transmissions
        if ( is_method("CANCEL") ) {
                if ( t_check_trans() )
                        t_relay();
                exit;
        }


        # from now on we have only the initial requests
        if (!is_method("INVITE")) {
                send_reply("405","Method Not Allowed");
                exit;
        }

        # detect resources and do balancing
        if (method=="INVITE") {
              load_balance("1","calls");
        }

        # LB function returns negative if no suitable destination (for
requested resources) is found,
        # or if all destinations are full
        if ($retcode<0) {
             sl_send_reply("500","Service full");
             exit;
        }

        xlog("Selected destination is: $du\n");

        # send it out
        if (!t_relay()) {
                sl_reply_error();
        }
}

route[1] {
            if (!t_relay()) {
                sl_reply_error();
            };
            exit;
            }


  # Presence route
  /* uncomment the whole following route for enabling presence
  NOTE: do not forget to enable the call of this route from the main route
*/

   route[2] {
           if (!t_newtran())
           {
              sl_reply_error();
              exit;
           };

           if(is_method("PUBLISH"))
           {
              handle_publish();
           }
           else
           if( is_method("SUBSCRIBE"))
           {
              handle_subscribe();
           }

           exit;
        }


   branch_route[2] {
          xlog("new branch at $ru\n");
        }


   onreply_route[2] {
            xlog("incoming reply\n");
        }


   failure_route[1] {
          if (t_was_cancelled()) {
                  exit;
                  }
        }

-- 
    Nawfel Oujdi
*Ingeniero VoIP*
noujdi at egtelecom.es
 EG telecom S.A | www.egtelecom.es
Oficina: *902 050 080*
Agustín de Foxá, 25 - 9B | 28036 Madrid
------------------------------

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20101123/6c5c30a0/attachment-0001.htm>


More information about the Users mailing list