[OpenSIPS-Users] opensips sending cancel

Miha miha at softnet.si
Wed Jan 2 13:15:32 CET 2013


HI to everyone:),

I need a little help. I am new to opensips, right now I am implementing 
load_balancar which is for now working:)
ok, problem is when calls go from opensips to fs (fs for media 
handling), fs bridge back call to opensips, which sends call to phone 
(both phones are registered to opensips). After second user pickups 
call, call is being canceled by opensips.

If call is send to user, which is not registered to opensips call is ok.

Thanks!

Miha

[root at localhost tmp]# cat /usr/local/etc/opensips/opensips.cfg
####### Global Parameters #########

debug=4
log_stderror=no
log_facility=LOG_LOCAL7

fork=yes
children=4

disable_tcp=no

dns_try_ipv6=no

auto_aliases=no

/* bind on the machine's virtual ip (note: enable 
sys.net.ipv4.ip_nonlocal_bind) */
listen=udp:xxx.xxx.xxx.xxx:5060
listen=tcp:xxx.xxx.xxx.xxx:5060

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

#set module path
mpath="/usr/local/lib/opensips/modules/"

loadmodule "db_mysql.so"
loadmodule "signaling.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "uri.so"
loadmodule "usrloc.so"
loadmodule "dialog.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
loadmodule "dispatcher.so"
loadmodule "load_balancer.so"
loadmodule "sipmsgops.so"
loadmodule "auth_db.so"
loadmodule "auth.so"
loadmodule "domain.so"
loadmodule "alias_db.so"
loadmodule "presence.so"
loadmodule "presence_xml.so"
loadmodule "registrar.so"
loadmodule "aaa_radius.so"
loadmodule "acc.so"
loadmodule "auth_aaa.so"
loadmodule "siptrace.so"
#loadmoudle "aaa_radius.so"

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

modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")

modparam("dialog", "db_mode", 1)
modparam("dialog", "db_url", "mysql://root:soft1234@localhost/opensips")

modparam("rr", "enable_double_rr", 1)
modparam("rr", "append_fromtag", 1)

modparam("tm", "fr_timer", 2)

#USRLOCK
modparam("usrloc", "db_url","mysql://root:soft1234@localhost/opensips")
modparam("usrloc", "db_mode",   2)

modparam("dispatcher", "db_url", "mysql://root:soft1234@localhost/opensips")
modparam("usrloc", "db_mode", 2)

modparam("dispatcher", "ds_ping_method", "OPTIONS")
modparam("dispatcher", "ds_ping_interval", 5)
modparam("dispatcher", "ds_probing_threshhold", 2)
modparam("dispatcher", "ds_probing_mode", 1)

modparam("load_balancer", "db_url", 
"mysql://root:soft1234@localhost/opensips")
modparam("load_balancer", "db_table", "load_balancer")
modparam("load_balancer", "probing_method", "OPTIONS")
modparam("load_balancer", "probing_interval", 5)


#DB

modparam("auth_db", "db_url", "mysql://root:soft1234@localhost/opensips")
modparam("auth_db", "load_credentials", "")
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")

modparam("alias_db", "db_url", "mysql://root:soft1234@localhost/opensips")

modparam("domain", "db_url", "mysql://root:soft1234@localhost/opensips")

#RADIUS
modparam("acc", "aaa_url", 
"radius:/usr/local/etc/radiusclient-ng/radiusclient.conf")
modparam("auth_aaa", "aaa_url", 
"radius:/usr/local/etc/radiusclient-ng/radiusclient.conf")

#PRESENCE
modparam("presence|presence_xml", "db_url", 
"mysql://root:soft1234@localhost/opensips")
modparam("presence_xml", "force_active", 1)
#modparam("presence", "server_address", "sip:192.168.30.3:5060")


#URI
modparam("uri", "db_url", "mysql://root:soft1234@localhost/opensips")

#SIPTRACE
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
modparam("siptrace", "db_url", "mysql://root:soft1234@localhost/opensips")
####### Routing Logic ########

# based on 
http://www.opensips.org/index.php?n=Resources.DocsTutLoadbalancing
route{
         xlog("L_ERR", "time [$Tf] method ($rm) r-uri ($ru) 2nd via 
($hdr(via[1]))\n");
         if (!mf_process_maxfwd_header("10")) {
                 sl_send_reply("483","Too Many Hops");
                 exit;
         }

         if (!has_totag()) {
                 # initial request
                 record_route();
         }
         else {
                 # sequential request - obey the indicated route
                 loose_route();
                 t_relay();
                 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

         # select the node that'll handle the call (load balanced)
         # the method used is different for invite/register requests
                 # unknown methods are rejected here

         if (is_method("REGISTER")) {
                 $var(auth_code) = www_authorize("", "subscriber");
                 if ( $var(auth_code) == -1 || $var(auth_code) == -2 ) {
                         xlog("L_NOTICE","Auth error for $fU@$fd from 
$si cause $var(auth_code)");
                 }
                 if ( $var(auth_code) < 0 ) {
                         www_challenge("", "0");
                         exit;
                 }
                 if (!db_check_to()) {
                         sl_send_reply("403","Forbidden auth ID");
                         exit;
                 }
                 if (!save("location"))
                 sl_reply_error();
                 exit;
         }
         #RADIUS ATHENTICATION
         xlog ("L_NOTICE","si $si");

         if(!ds_is_in_list("$si", ""))
         {
                 if (!aaa_www_authorize(""))
                 {
                         www_challenge("", "1");
                 }
         }
                     }
                  xlog ("L_NOTICE","si $si");
                 trace_dialog();
                 if (is_method("INVITE"))
                 {
                         xlog ("L_NOTICE","si $si");
                         if(!ds_is_in_list("$si", ""))
                         {
                                 if (!load_balance("1","pstn","1"))
                                        {
                                        sip_trace();
                                        send_reply("503","Service 
Unavailable");
                                        exit;
                                        }

                         }
                         else
                         {
                                 if (db_get_auth_id("$ru", 
"$avp(auth_id)", "$avp(auth_realm)"))
                                 {
                                         if (lookup("location"))
                                         {
xlog("L_NOTICE","du $du ru $ru rU $rU");
                                                 t_relay();
                                         }
                                 }
                                 else
                                 {
                                 xlog("L_NOTICE","user ni in klic gre na 
sbc");
rewritehostport("xxx.xxx.xxx.xxx:5060");
                                 }


                         }

                 }
               }
         else
          {
                 send_reply("405","Method Not Allowed");
                 exit;
         }

         # route the request
         if (!t_relay()) {
                 sl_reply_error();
         }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130102/7d6b7cbe/attachment.htm>


More information about the Users mailing list