[SR-Users] dmq_t_replicate fails with ERROR: t_forward_nonack: no branches for forwarding

Leonardo Arena rnalrd at gmail.com
Mon Feb 2 11:52:11 CET 2015


Hi all,
I have three Registrar-only proxies DMQ interconnected [1]. I'm
attempting to use a client to register to one of them and replicate
REGISTRAR message to the other two.

* What it works:
- Clients registration to proxy1
- Proxy1 replication of REGISTRAR message to proxy2

* What does not work:
- Proxy replication of REGISTRAR message to proxy3

* Error message of proxy1:
ERROR: tm [t_fwd.c:1770]: t_forward_nonack(): ERROR: t_forward_nonack:
no branches for forwarding
ERROR: dmq [dmq_funcs.c:410]: cfg_dmq_t_replicate(): error calling
t_replicate

append_branch() did't help me and a search on the ML either.

What am I doing wrong?

Thanks!

- leonardo


[1]

#--------------------------------------------------------
# Global Definitions
#--------------------------------------------------------
debug      =   2
fork      =   yes
log_stderror   =   no
# listen      =   0.0.0.0
port      =   5060
children   =   4

dns      =   no
rev_dns      =   no
use_dns_failover =    on
dns_srv_lb   =   yes
#dns_try_naptr    =    no


mpath      =   "/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/"

#--------------------------------------------------------
# Modules
#--------------------------------------------------------

loadmodule   "tm.so"      
loadmodule   "sl.so"
loadmodule   "tmx.so"      
loadmodule   "maxfwd.so"
loadmodule   "usrloc.so"
loadmodule   "registrar.so"
loadmodule   "pv.so"
loadmodule   "xlog.so"
loadmodule   "ctl.so"
#loadmodule   "db_text.so"
loadmodule   "db_sqlite.so"
loadmodule   "auth.so"
loadmodule   "auth_db.so"
loadmodule   "memcached.so"
loadmodule   "dmq.so"
loadmodule   "corex.so"

#--------------------------------------------------------
# Module Configuration
#--------------------------------------------------------

modparam ( "usrloc", "db_mode", 0 )
modparam ( "usrloc", "use_domain", 1 )
modparam ( "usrloc", "hash_size", 20 ) 
#modparam ( "ctl", "binrpc_max_body_size", 10000 )
#modparam ( "ctl", "binrpc_struct_max_body_size", 200 )
#default
#modparam ( "db_text", "db_mode", 0 )
modparam ( "auth", "use_domain", 1 )
#modparam ( "auth_db", "db_url", "text:///etc/kamailio/dbtext/" )
modparam ( "auth_db", "db_url", "sqlite:///etc/kamailio/kamailiodb" )
modparam ( "auth_db", "use_domain", 1 )
#use plaintext passwords for testing
modparam ( "auth_db", "calculate_ha1", 1 )
modparam ( "auth_db", "version_table", 0 )
modparam ( "auth_db", "password_column", "password" )
modparam ( "auth_db", "load_credentials", "$avp(s:username)=username;
$avp(s:domain)=domain;$avp(s:password)=password" )

modparam( "memcached", "servers", "localhost:11211" )

modparam( "dmq", "server_address", "sip:10.0.0.1:5060" )
modparam( "dmq", "notification_address", "sip:dmq.my.domain.net" )
#modparam( "dmq", "num_threads", 4 )
# modparam( "dmq", "ping_interval", 60 )

#--------------------------------------------------------
# Main Route Block
#--------------------------------------------------------

include_file "kamailio-errors.cfg"

route 
  {   
   # Uncomment next line if you  want to see
   # each incoming message
   xlog( "L_INFO", "$rm: $fu -> $ru" );
   
   if (!mf_process_maxfwd_header("20")) {
      route(ERROR_TOO_MANY_HOPS);
   }
 
   if (msg:len > 4096) {
      route(ERROR_MESSAGE_OVERFLOW);
   }
   
   if ($rm == "REGISTER" ) {
      if ( dmq_is_from_node() ) {
         xlog( "L_INFO", "REGISTER from node" );
         route(REGISTER);
         exit;
      }
      else {
         # if we don't have credentials in cache authenticate against DB
         if ( $mct($tU@$td) == $null ) {
            if (!www_authenticate("$td", "subscriber")) {
               www_challenge("$td", "1");
               exit;
            }
            else {
               route(REGISTER);
               xlog( "L_INFO", "Authenticated user $tU for domain $td
against DB" );
               # store credentials into cache
               $mct($avp(s:username)@$avp(s:domain)) = $avp(s:password);
               exit;
            }
   
         }
         # credentials are in cache, authenticate against it
         else {
            if (!pv_www_authenticate("$td", "$mct($tU@$td)", "0")) { #
turn last param to "1" if using ha1 passwords
               # keep a counter of authentication attempts
               # if above 1 user is denied auth from cache so we discard
the cache and force auth from DB at next attempt
               if ( $mct(count_$tU@$td) ) == $null {
                  $mct(count_$tU@$td) = 1;
               }
               else {
                  $mct(count_$tU@$td) = $null;
                  $mct($tU@$td) = $null;
                  xlog( "L_INFO", "Authentication count limit for user
$tU for domain $td against cache reached. Cache discarded" );
               }
               www_challenge("$td", "1");
               exit;
            }
            else {
               route(REGISTER);
               $mct( count_$tU@$td ) = $null;
               xlog( "L_INFO", "Authenticated user $tU for domain $td
against cache" );
               exit;
            }
         }
      }
   }

        if ( $rm == "KDMQ" ) {
                dmq_handle_message();
        }

        route(ERROR_INVALID_METHOD);

}

route[REGISTER] {
   if (!save("location")) {
      sl_reply_error();
   }
   else {
      append_branch();
      dmq_t_replicate();
   }
}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150202/f241baf5/attachment.sig>


More information about the sr-users mailing list