[OpenSER-Users] Openser sending 513 Message Too Big

Aadilkhan Maniyar amaniyar at velankani.com
Wed Mar 19 12:07:55 CET 2008


Hi,
 
Please find my openser.cfg file below. Whenever I try to call a
softphone registered with Openser from another softphone (also
registered with Openser) i get a 513 Message Too Big.
I guess there is a loop in the configuration file but I am unable to
find it out. 
 
Any help would be appreciated.
 
Regards,
Aadil 
 
------------------------------------------------------------------------
------------------------------------------------------------------------
----------

 

####### Global Parameters #########
 
debug=9
log_stderror=no
log_facility=LOG_LOCAL0
 
fork=yes
children=4
 
 
/* uncomment the next line to disable TCP (default on) */
#disable_tcp=yes
 
/* uncomment the next line to enable the auto temporary blacklisting of 
   not available destinations (default disabled) */
#disable_dns_blacklist=no
 
/* uncomment the next line to enable IPv6 lookup after IPv4 dns 
   lookup failures (default disabled) */
#dns_try_ipv6=yes
/* uncomment the next line to disable the auto discovery of local
aliases
   based on revers DNS on IPs (default on) */
#auto_aliases=no
 
/* uncomment the following lines to enable TLS support  (default off) */
#disable_tls = no
#listen = tls:your_IP:5061
#tls_verify_server = 1
#tls_verify_client = 1
#tls_require_client_certificate = 0
#tls_method = TLSv1
#tls_certificate = "/opt/openser/etc/openser/tls/user/user-cert.pem"
#tls_private_key = "/opt/openser/etc/openser/tls/user/user-privkey.pem"
#tls_ca_list = "/opt/openser/etc/openser/tls/user/user-calist.pem"
 

port=5060
 
/* uncomment and configure the following line if you want openser to 
   bind on a specific interface/port/proto (default bind on all
available) */
listen=udp:IP1:5060
listen=udp:IP2:5060
 

####### Modules Section ########
 
#set module path
mpath="/opt/openser/lib/openser/modules/"
 
/* uncomment next line for MySQL DB support */
loadmodule "mysql.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_db.so"
loadmodule "uri.so"
loadmodule "xlog.so"
loadmodule "acc.so"
loadmodule "avpops.so"
 

/* uncomment next lines for MySQL based authentication support 
   NOTE: a DB (like mysql) module must be also loaded */
loadmodule "auth.so"
loadmodule "auth_db.so"
 
/* uncomment next line for aliases support
   NOTE: a DB (like mysql) module must be also loaded */
#loadmodule "alias_db.so"
/* uncomment next line for multi-domain support
   NOTE: a DB (like mysql) module must be also loaded
   NOTE: be sure and enable multi-domain support in all used modules
         (see "multi-module params" section ) */
loadmodule "domain.so"
/* uncomment the next two lines for presence server support
   NOTE: a DB (like mysql) module must be also loaded */
#loadmodule "presence.so"
 

# ----------------- setting module-specific parameters ---------------
 
modparam("usrloc|auth_db|avpops|domain", "db_url",
 "mysql://openser:openserrw@localhost/openser")
 
# ----- mi_fifo params -----
modparam("mi_fifo", "fifo_name", "/tmp/openser_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", 0)
 

# ----- rr params -----
modparam("registrar", "method_filtering", 1)
/* uncomment the next line to disable parallel forking via location */
# modparam("registrar", "append_branches", 0)
/* uncomment the next line not to allow more than 10 contacts per AOR */
#modparam("registrar", "max_contacts", 10)
 

# ----- uri_db params -----
/* by default we disable the DB support in the module as we do not need
it
   in this configuration */
modparam("uri_db", "use_uri_table", 0)
modparam("uri_db", "db_url", "")
 

# ----- 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)
 

# ----- 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",   1)
 

# ----- 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", "load_credentials", "")
 

# ----- alias_db params -----
/* uncomment the following lines if you want to enable the DB based
   aliases */
#modparam("alias_db", "db_url",
# "mysql://openser:openserrw@server/openser")
 

# ----- domain params -----
/* uncomment the following lines to enable multi-domain detection
   support */
modparam("domain", "db_mode", 1)   # Use caching
 

# ----- multi-module params -----
/* uncomment the following line if you want to enable multi-domain
support
   in the modules (dafault off) */
#modparam("alias_db|auth_db|usrloc|uri_db", "use_domain", 1)
 

# ----- presence params -----
/* uncomment the following lines if you want to enable presence */
#modparam("presence", "db_url",
# "mysql://openser:openserrw@server/openser")
#modparam("presence", "force_active", 1)
#modparam("presence", "server_address", "sip:192.168.1.2:5060")
 
modparam("avpops", "avp_table", "usr_preferences")
 
####### Routing Logic ########
 

# main request routing logic
 
route {
 # initial sanity checks -- messages with
 # max_forwards==0, or excessively long requests
 if (!mf_process_maxfwd_header("10")) {
  sl_send_reply("483","Too Many Hops");
  exit;
 };
 if (msg:len >=  2048 ) {
  sl_send_reply("513", "Message too big");
  exit;
 };
 # we record-route all messages -- to make sure that
 # subsequent messages will go through our proxy; that's
 # particularly good if upstream and downstream entities
 # use different transport protocol
 if (!method=="REGISTER")
  record_route();
 # subsequent messages withing a dialog should take the
 # path determined by record-routing
 if (loose_route()) {
  # mark routing logic in request
  append_hf("P-hint: rr-enforced\r\n"); 
  route(1);
 };
 if (!uri==myself) {
    if (method=="REGISTER") {
   # if (!www_authorize("", "subscriber")) {
    #www_challenge("", "0");
    #exit;
   #} #
   #save("location");
   #exit;
   #xlog("L_DEBUG", "Unknown Domain");
   #sl_send_reply("403", "Forbidden");
  };
   if (method=="INVITE") {
   xlog("L_DEBUG", "INVITE for other domain");
   route(4);
  };
 
  # mark routing logic in request
  append_hf("P-hint: outbound\r\n"); 
  route(1);
 };
 # if the request is for other domain use UsrLoc
 # (in case, it does not work, use the following command
 # with proper names and addresses in it)
 if (uri==myself) {
  if (method=="REGISTER") {
   if (!www_authorize("", "subscriber")) {
    www_challenge("", "0");
    exit;
   };
   save("location");
   exit;
  };
  # requests for Media server
  #if(is_method("INVITE") && !has_totag() ) {
  if(is_method("INVITE")) {
   ;route(3);
  exit;
  };

  # native SIP destinations are handled using our USRLOC DB
  if (!lookup("location")) {
   if(isflagset(2)) {
    # route to Asterisk Media Server
    prefix("1");
    rewritehostport("asterisk:6060");
    route(1);
   } else {
    sl_send_reply("404", "Not Found");
    exit;
   }
  };
  append_hf("P-hint: usrloc applied\r\n"); 
 };
 route(1);
}
route[1] {
 
 xlog("L_INFO","Entered route 1\n");
 if(isflagset(2))
  t_on_failure("1");
 if (!t_relay()) {
  sl_reply_error();
 };
 exit;
}
route[3] {
 xlog("L_INFO","Entered route 3\n");
         t_on_reply("3");
 
 #  Authenticate calls
  #if(!proxy_authorize("","subscriber")) {
 # proxy_challenge("","0");
 # exit;
 #}
 # end  Authenticate calls
 
 # route to Asterisk Media Server
 #rewritehostport("asterisk:6060");
 route(1);
}
 
#Route for calls to other domains
route[4] {
 xlog("L_INFO","Entered route 4");
 t_on_reply("4");
 
 rewritehostport("asterisk:6060");
 if (!t_relay()) {
  sl_reply_error();
 };
 exit;
 
}
 
failure_route[1] {
 if (t_was_cancelled()) {
  xdbg("transaction was cancelled by UAC\n");
  return;
 }
 # restore initial uri
        avp_pushto("$ruri","$avp(i:10)");
 prefix("1");
 # route to Asterisk Media Server
 rewritehostport("asterisk:6060");
 resetflag(2);
 route(1);
}
failure_route[4] {
        t_relay();
}
onreply_route[3]
{
        if(status =~"180") {
         t_on_failure("4");
        };
}
 
 
------------------------------------------------------------------------
------------------------------------------------------------------------
----------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20080319/803315fc/attachment.htm>


More information about the sr-users mailing list