####
#### ----------- global configuration parameters ------------------------
debug=4 # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=yes# (cmd line: -E)
check_via=no # (cmd. line: -v)
dns=no # (cmd. line: -r)
rev_dns=no # (cmd. line: -R)
listen=xx.xxx.xxx.xx
port=5060
children=4
# fifo="/tmp/ser_fifo"
####-----------------------------------------------------------------------
####
####
#### ------------------ module loading ----------------------------------
loadmodule "/usr/lib/openser/modules/mysql.so"
loadmodule "/usr/lib/openser/modules/nathelper.so"
loadmodule "/usr/lib/openser/modules/sl.so"
loadmodule "/usr/lib/openser/modules/tm.so"
loadmodule "/usr/lib/openser/modules/rr.so"
loadmodule "/usr/lib/openser/modules/maxfwd.so"
loadmodule "/usr/lib/openser/modules/lcr.so"
loadmodule "/usr/lib/openser/modules/acc.so"
loadmodule "/usr/lib/openser/modules/usrloc.so"
loadmodule "/usr/lib/openser/modules/registrar.so"
####------------------------------------------------------------------------
####
####
#### ----------------- setting module-specific parameters ---------------
#modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
########################### Least Cost routing #############################
modparam("lcr","db_url", "mysql://root:Gabriel0$@localhost/openser")
modparam("lcr","gw_table","gw")
modparam("lcr","gw_name_column","gw_name")
modparam("lcr","ip_addr_column","ip_addr")
modparam("lcr","port_column","port")
#modparam("lcr","uri_scheme_column","uri_scheme")
#modparam("lcr","transport_column","transport")
modparam("lcr","grp_id_column","grp_id")
modparam("lcr","lcr_table","lcr")
modparam("lcr","prefix_column","prefix")
modparam("lcr","from_uri_column","from_uri")
modparam("lcr","priority_column","priority")
#modparam("lcr","gw_uri_avp","1400")
modparam("lcr","contact_avp","1401")
modparam("lcr","fr_inv_timer_avp","fr_inv_timer_avp")
#modparam("lcr","rpid_avp","rpid")
modparam("lcr","fr_inv_timer",90)
modparam("lcr","fr_inv_timer_next",30)
########################### RR shit #########################################
modparam("rr","enable_full_lr",1)
########################### ACC #############################################
modparam("acc","db_url", "mysql://root:Gabriel0$@localhost/openser")
modparam("acc", "db_flag", 2)
############################ usrloc params ##################################
modparam("usrloc", "db_url", "mysql://root:Gabriel0$@localhost/openser")
modparam("usrloc", "db_mode", 3)
####-------------------------------------------------------------------------
####
####
####---------------------------- Routing ------------------------------------
route
{
############################## Sanity checks #################################
if (!mf_process_maxfwd_header("10"))
{
sl_send_reply("483","Too Many Hops");
};
if (msg:len >= max_len )
{
sl_send_reply("513", "Message too big");
};
########################## Record route for NAT ################################
if(!method=="REGISTER")
{
record_route();
};
########################## Register ###########################################
if (method=="REGISTER")
{
if (uri==myself)
{
sl_send_reply("100", "Trying");
if(!save("location"))
{
sl_reply_error();
};
exit;
}
else
{
sl_send_reply("403", "Forbidden");
exit;
};
};
#############################
if(loose_route())
{
route(1);
};
############################ Least Cost Routing ###################################
if(!load_gws())
{
sl_send_reply("500", "Internal server error, unable to load gateways");
}
if(!next_gw())
{
sl_send_reply("503", "Service not available, no gateways found");
};
###################################################################################
route(1);
}
route[1]
{
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
setflag(2);
if(method=="INVITE")
{
force_rtp_proxy();
t_on_reply("1");
};
if (!t_relay())
{
sl_reply_error();
};
}
onreply_route[1]
{
setflag(2);
if (status=~"[12]0-90-9")
{
force_rtp_proxy();
};
}
####--------------------------------------------------------------------------------------------
####