Hi to everybody,
I have an issue with the nathelper module and openser 1.3.4 . Basically
I want generate the Option message after the registration of a client,
but the server generate a UDP message with the correct ip and port but
empty.
Below the openser.cfg file and as attachment a pcap file where you can
see the registration message and the UDP message empty.
Any clue? With the same configuration in another enviroment I don't have
any issue
Kind Regards
Matteo
#
# $Id: openser.cfg 4424 2008-06-27 10:25:22Z henningw $
#
# OpenSER basic configuration script
# by Anca Vamanu <anca(a)voice-system.ro>
#
# Please refer to the Core CookBook at
http://www.openser.org/dokuwiki/doku.php
# for a explanation of possible statements, functions and parameters.
#
####### Global Parameters #########
debug=3
log_stderror=yes
log_facility=LOG_LOCAL0
fork=yes
children=4
/* uncomment the following lines to enable debugging */
#debug=6
#fork=no
#log_stderror=yes
/* 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 = "//etc/openser/tls/user/user-cert.pem"
#tls_private_key = "//etc/openser/tls/user/user-privkey.pem"
#tls_ca_list = "//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:77.72.192.99:5060
alias= leo.trentinonetowrk.it
####### Modules Section ########
#set module path
mpath="//lib/openser/modules/"
/* uncomment next line for MySQL DB support */
loadmodule "postgres.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 "auth.so"
loadmodule "auth_db.so"
loadmodule "alias_db.so"
loadmodule "domain.so"
#loadmodule "presence.so"
#loadmodule "presence_xml.so"
loadmodule "dialog.so"
loadmodule "lcr.so"
loadmodule "avpops.so"
loadmodule "pdt.so"
loadmodule "permissions.so"
loadmodule "nathelper.so"
# ----------------- setting module-specific parameters ---------------
# ----- mi_fifo params -----
modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
# ----- rr params -----
modparam("rr", "enable_full_lr", 1)
modparam("rr", "append_fromtag", 1)
# ---- registrar params -----
modparam("registrar", "method_filtering", 1)
modparam("registrar", "max_contacts", 10)
modparam("registrar", "received_avp", "$avp(s:rcv)")
# ----- uri_db params -----
modparam("uri_db", "use_uri_table", 0)
modparam("uri_db", "db_url",
"postgres://openser:openserrw@localhost/openser")
# ----- acc params -----
modparam("acc", "db_url",
"postgres://openser:openserrw@localhost/openser")
modparam("acc", "early_media", 1)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 0)
modparam("acc", "detect_direction", 1)
modparam("acc", "failed_transaction_flag", 3)
#modparam("acc", "log_flag", 1)
#modparam("acc", "log_missed_flag", 2)
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)
modparam("acc", "db_extra", "from_uri=$fu ; to_uri=$tu ;
from_user=$fU;
to_user=$tU; source_ip=$si")
# ----- usrloc params -----
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "db_url",
"postgres://openser:openserrw@localhost/openser")
modparam("usrloc", "nat_bflag", 6)
# ----- auth_db params -----
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "db_url",
"postgres://openser:openserrw@localhost/openser")
modparam("auth_db", "load_credentials", "")
# ----- alias_db params -----
modparam("alias_db", "db_url",
"postgres://openser:openserrw@localhost/openser")
# ----- domain params -----
modparam("domain", "db_url",
"postgres://openser:openserrw@localhost/openser")
modparam("domain", "db_mode", 1) # Use caching
# ----- multi-module params -----
#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|presence_xml", "db_url",
# "mysql://openser:openserrw@localhost/openser")
#modparam("presence_xml", "force_active", 1)
#modparam("presence", "server_address",
"sip:192.168.1.2:5060")
# ----- avpops param -----
modparam("avpops","avp_url","postgres://openser:openserrw@localhost/openser")
modparam("avpops","avp_table","avptable")
modparam("avpops","avp_table","usr_preferences")
modparam("avpops","use_domain",1)
modparam("avpops","uuid_column","uuid")
modparam("avpops","username_column","username")
modparam("avpops","domain_column","domain")
modparam("avpops","attribute_column","attribute")
modparam("avpops","value_column","value")
modparam("avpops","type_column","type")
# ----- lcr params -----
modparam("lcr","db_url","postgres://openser:openserrw@localhost/openser")
modparam("lcr","fr_inv_timer",90)
modparam("lcr","fr_inv_timer_next",30)
modparam("lcr", "dm_flag", 25)
modparam("lcr", "ruri_user_avp", "$avp(i:500)")
modparam("^auth$|lcr", "rpid_avp", "$avp(i:302)")
modparam("lcr", "gw_uri_avp", "$avp(i:709)")
modparam("lcr|tm", "fr_inv_timer_avp", "$avp(i:704)")
modparam("lcr", "contact_avp", "$avp(i:711)")
# ------- PDT ----------
modparam("pdt", "db_url",
"postgres://openser:openserrw@localhost/openser")
modparam("pdt", "db_table", "pdt")
modparam("pdt", "domain_column", "source_domain")
modparam("pdt", "prefix_column", "prefix")
modparam("pdt", "domain_column", "domain")
#modparam("pdt","check_domain",0)
#modparam("pdt", "char_list", "0123456789*+[]-.")
# ---------- permission -------------
modparam("permissions", "db_url",
"postgres://openser:openserrw@localhost/openser")
modparam("permissions", "db_mode", 1)
modparam("permissions", "trusted_table", "trusted")
modparam("permissions", "allow_suffix", ".allow")
modparam("permissions", "deny_suffix", ".deny")
# ---------- dialog -------------
modparam("dialog", "dlg_flag", 4)
modparam("dialog", "dlg_match_mode", 1)
# ------- nathelper ------------
modparam("nathelper", "rtpproxy_sock",
"udp:127.0.0.1:7890")
modparam("nathelper", "natping_interval", 10)
modparam("nathelper", "ping_nated_only", 0)
#modparam("nathelper", "rtpproxy_disable", 0)
modparam("nathelper", "rtpproxy_disable_tout", 60)
modparam("nathelper", "rtpproxy_tout", 1)
modparam("nathelper", "rtpproxy_retr", 5)
modparam("nathelper", "sipping_method", "OPTIONS")
modparam("nathelper", "received_avp", "$avp(s:rcv)")
modparam("nathelper", "sipping_bflag", 7)
modparam("nathelper", "sipping_from",
"sip:ping@leo.trentinonetwork.it")
route[0]
{
xlog("L_INFO", "New request - M=$rm RURI=$ru F=$fu T=$tu IP=$si
ID=$ci\n");
force_rport();
if (!mf_process_maxfwd_header("10"))
{
xlog("L_INFO", "Too many hops - M=$rm RURI=$ru F=$fu T=$tu
IP=$si ID=$ci\n");
sl_send_reply("483", "Too Many Hops");
exit;
}
if(!is_method("REGISTER"))
{
if(nat_uac_test("19"))
{
record_route(";nat=yes");
}
else
{
record_route();
}
}
if(is_method("CANCEL") || is_method("BYE"))
{
unforce_rtp_proxy();
}
if(loose_route())
{
if(!has_totag())
{
xlog("L_INFO", "Initial loose-routing rejected - M=$rm
RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
sl_send_reply("403", "Initial Loose-Routing Rejected");
exit;
}
if(nat_uac_test("19") || search("^Route:.*;nat=yes"))
{
fix_nated_contact();
setbflag(6);
}
route(3);
}
if(is_method("REGISTER"))
{
route(2);
}
if(is_method("INVITE"))
{
route(4);
}
if(is_method("CANCEL") || is_method("ACK"))
{
route(8);
}
route(9);
}
########################################################################
# Request route 'stop-rtp-proxy'
########################################################################
route[1]
{
if(isflagset(22))
{
unforce_rtp_proxy();
}
}
########################################################################
# Request route 'base-route-register'
########################################################################
route[2]
{
sl_send_reply("100", "Trying");
if(!www_authorize("", "subscriber"))
{
xlog("L_INFO", "Register authentication failed - M=$rm RURI=$ru
F=$fu T=$tu IP=$si ID=$ci\n");
www_challenge("", "0");
exit;
}
if(!check_to())
{
xlog("L_INFO", "Spoofed To-URI detected - M=$rm RURI=$ru F=$fu
T=$tu IP=$si ID=$ci\n");
sl_send_reply("403", "Spoofed To-URI Detected");
exit;
}
consume_credentials();
if(!search("^Contact:[ ]*\*") && nat_uac_test("19"))
{
fix_nated_register();
setbflag(6);
setbflag(7);
}
if(!save("location"))
{
xlog("L_ERR", "Saving contact failed - M=$rm RURI=$ru F=$fu
T=$tu IP=$si ID=$ci\n");
sl_reply_error();
exit;
}
xlog("L_INFO", "Registration successful - M=$rm RURI=$ru F=$fu T=$tu
IP=$si ID=$ci\n");
exit;
}
########################################################################
# Request route 'base-outbound'
########################################################################
route[3]
{
if(isbflagset(6))
{
if(!isflagset(22) && !search("^Content-Length:[ ]*0"))
{
setflag(22);
force_rtp_proxy();
}
t_on_reply("2");
}
else
{
t_on_reply("1");
}
if(!isflagset(21))
{
t_on_failure("1");
}
if(isflagset(29))
{
append_branch();
}
if(is_present_hf("Proxy-Authorization"))
{
consume_credentials();
}
xlog("L_INFO", "Request leaving server, D-URI='$du' - M=$rm
RURI=$ru
F=$fu T=$tu IP=$si ID=$ci\n");
# no 100 (we already sent it) and no DNS blacklisting
if(!t_relay("0x05"))
{
sl_reply_error();
if(is_method("INVITE") && isbflagset(6))
{
unforce_rtp_proxy();
}
}
exit;
}
########################################################################
# Request route 'base-route-invite'
########################################################################
route[4]
{
sl_send_reply("100", "Trying");
if(!proxy_authorize("", "subscriber"))
{
xlog("L_INFO", "Proxy authentication failed - M=$rm RURI=$ru
F=$fu T=$tu IP=$si ID=$ci\n");
proxy_challenge("", "0");
exit;
}
if(!check_from())
{
xlog("L_INFO", "Spoofed From-URI detected - M=$rm RURI=$ru F=$fu
T=$tu IP=$si ID=$ci\n");
sl_send_reply("403", "Spoofed From-URI Detected");
exit;
}
if(nat_uac_test("19"))
{
fix_nated_contact();
setbflag(6);
}
route(5);
}
########################################################################
# Request route 'invite-find-callee'
########################################################################
route[5]
{
if(!is_domain_local("$rd"))
{
setflag(20);
route(7);
}
if(does_uri_exist())
{
xlog("L_INFO", "Callee is local - M=$rm RURI=$ru F=$fu T=$tu
IP=$si ID=$ci\n");
route(6);
}
else
{
xlog("L_INFO", "Callee is not local - M=$rm RURI=$ru F=$fu T=$tu
IP=$si ID=$ci\n");
route(7);
}
exit;
}
########################################################################
# Request route 'invite-to-internal'
########################################################################
route[6]
{
if(!lookup("location"))
{
xlog("L_INFO", "Local user offline - M=$rm RURI=$ru F=$fu T=$tu
IP=$si ID=$ci\n");
sl_send_reply("404", "User Offline");
}
else
{
xlog("L_INFO", "Local user online - M=$rm RURI=$ru F=$fu T=$tu
IP=$si ID=$ci\n");
route(3);
}
exit;
}
########################################################################
# Request route 'invite-to-external'
########################################################################
route[7]
{
if(isflagset(20))
{
xlog("L_INFO", "Call to foreign domain - M=$rm RURI=$ru F=$fu
T=$tu IP=$si ID=$ci\n");
route(3);
exit;
}
xlog("L_INFO", "Call to unknown user - M=$rm RURI=$ru F=$fu T=$tu
IP=$si ID=$ci\n");
sl_send_reply("404", "User Not Found");
exit;
}
########################################################################
# Request route 'base-route-local'
########################################################################
route[8]
{
t_on_reply("1");
if(t_check_trans())
{
xlog("L_INFO", "Request leaving server - M=$rm RURI=$ru F=$fu
T=$tu IP=$si ID=$ci\n");
if(!t_relay())
{
sl_reply_error();
}
}
else
{
xlog("L_INFO", "Dropping mis-routed request - M=$rm RURI=$ru
F=$fu T=$tu IP=$si ID=$ci\n");
}
exit;
}
########################################################################
# Request route 'base-route-generic'
########################################################################
route[9]
{
xlog("L_INFO", "Method not supported - M=$rm RURI=$ru F=$fu T=$tu
IP=$si ID=$ci\n");
sl_send_reply("501", "Method Not Supported Here");
exit;
}
########################################################################
# Request route 'base-filter-failover'
########################################################################
route[10]
{
if(!t_check_status("408|500|503"))
{
xlog("L_INFO", "No failover routing needed for this response
code - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
route(1);
exit;
}
}
########################################################################
# Reply route 'base-standard-reply'
########################################################################
onreply_route[1]
{
xlog("L_INFO", "Reply - S=$rs D=$rr F=$fu T=$tu IP=$si
ID=$ci\n");
exit;
}
########################################################################
# Reply route 'base-nat-reply'
########################################################################
onreply_route[2]
{
xlog("L_INFO", "NAT-Reply - S=$rs D=$rr F=$fu T=$tu IP=$si
ID=$ci\n");
if(nat_uac_test("1"))
{
fix_nated_contact();
}
if(isbflagset(6) && status=~"(180)|(183)|2[0-9][0-9]")
{
if(!search("^Content-Length:[ ]*0"))
{
force_rtp_proxy();
}
}
exit;
}
########################################################################
# Failure route 'base-standard-failure'
########################################################################
failure_route[1]
{
route(10);
route(1);
}
--
==========================================================================
Matteo Piazza
Trentino Network s.r.l.
Area Innovazione
Via Gilli, 2 - 38100 TRENTO
Tel (+39) 0461.020224
Mob (+39) 335.5378482
Fax (+39) 0461.020201
Cap. Soc. sottoscritto 7.573.248,00 - i. v.
REG. IMP. C.F. e P. IVA 01904880224
Società soggetta a direzione e controllo da parte della Provincia
Autonoma di Trento. C.F. e P. IVA 00337460224
==========================================================================