#
# sample config file to be used with nathelper/rtpproxy
#
# start RTPProxy with: rtpproxy -l your_public_ip -s udp:localhost:8899
#

# ----------- global configuration parameters ------------------------

debug=5            # debug level (cmd line: -dddddddddd)
fork=yes
log_stderror=no    # (cmd line: -E)

fork=no
log_stderror=yes

check_via=no # (cmd. line: -v)
dns=no          # (cmd. line: -r)
rev_dns=no      # (cmd. line: -R)
port=5060
listen=192.168.39.54
children=4
fifo="/tmp/openser_fifo"

# --- module loading

mpath="/usr/local/lib64/openser/modules/"
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 "nathelper.so"
loadmodule "auth.so"
loadmodule "auth_db.so"
loadmodule "lcr.so"

# --- setting module parameters

#modparam("usrloc|auth_db","db_url","mysql://openser:[EMAIL PROTECTED]/openser")
modparam("usrloc|lcr|domain|auth_db|lcr", "db_url", "mysql://openser:[EMAIL 
PROTECTED]/openser")

# -- usrloc params --
modparam("usrloc", "db_mode", 2)

# -- registrar params --
modparam("registrar", "nat_flag", 6)
modparam("registrar", "sip_natping_flag", 7)

# -- auth params --
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")

# -- rr params --
modparam("rr", "enable_full_lr", 1)

# -- nathelper
modparam("nathelper", "rtpproxy_sock", "udp:127.0.0.1:7890")
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_from", "sip:[EMAIL PROTECTED]")

# --- main routing logic
route{
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;
};

# NAT detection
route(2);

if (!method=="REGISTER")
record_route();

if (loose_route()) {
append_hf("P-hint: rr-enforced\r\n");
   if (method == INVITE || method==REFER){
               unforce_rtp_proxy();
force_rtp_proxy();
}
route(1);
};

if (!uri==myself) {
append_hf("P-hint: outbound\r\n");
route(1);
};
if (uri==myself) {
if (method=="REGISTER") {
if (!www_authorize("nodex.ru", "subscriber")) {
www_challenge("nodex.ru", "0");
exit;
};

if (isflagset(5)) {
setflag(6);
# if you want OPTIONS natpings uncomment next
# setflag(7);
};
save("location");
exit;
};

if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
};
append_hf("P-hint: usrloc applied\r\n");
};

route(1);
}


route[1] {
if (subst_uri('/(sip:.*);nat=yes/\1/')){
setflag(6);
};

if (isflagset(5)||isflagset(6)) {
route(3);
}
if (!t_relay()) {
sl_reply_error();
};
exit;
}

route[2]{
force_rport();
if (nat_uac_test("19")) {
if (method=="REGISTER") {
fix_nated_register();
} else {
fix_nated_contact();
};
setflag(5);
};
}

route[3] {
if (is_method("BYE|CANCEL")) {
unforce_rtp_proxy();
} else if (is_method("INVITE")){
force_rtp_proxy();
t_on_failure("1");
};
if (isflagset(5))
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
t_on_reply("1");
}

failure_route[1] {
if (isflagset(6) || isflagset(5)) {
unforce_rtp_proxy();
}
}

onreply_route[1] {
if ((isflagset(5) || isflagset(6)) && status=~"(183)|(2[0-9][0-9])") {
force_rtp_proxy();
}
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');

if (isflagset(6)) {
fix_nated_contact();
}
exit;
}


--
Pavel D.Kuzin
System Administrator
Nodex  ISP
St. Petersburg, Russia
[EMAIL PROTECTED]
http://nodex.ru
----- Original Message ----- From: "Daniel-Constantin Mierla" <[EMAIL PROTECTED]>
To: "Pavel D. Kuzin" <[EMAIL PROTECTED]>
Cc: "Hakan YASTI" <[EMAIL PROTECTED]>; <[email protected]>
Sent: Friday, August 11, 2006 2:57 PM
Subject: Re: [Users] nathelper & fax = bug ?


Hello,

please send me your config file. It seems that is a bit different than the one on voip-info.org. The re-INVITE is managed via nathelper, but the force_rtp_proxy() is called twice, the re-invite sent by openser contains:

c=IN IP4 192.168.39.54192.168.39.54 and a=nortpproxy:yes..a=nortpproxy:yes..

This is a bug in the configuration file.

Cheers,
Daniel



U 2006/08/11 14:31:59.615113 192.168.39.54:5060 -> 192.168.39.50:5060
INVITE sip:[EMAIL PROTECTED]:5060 SIP/2.0..Record-Route: <sip:192.168.39.54;lr=on;ftag=0-13c4-44dc5c97-4ee1e80-548d>..From: <sip:[EMAIL PROTECTED] 2.168.39.54>;tag=0-13c4-44dc5c97-4ee1e80-548d..To: <sip:[EMAIL PROTECTED]>;tag=0-13c4-44dc5c97-4ee1e30-4451..Call-ID: c8ece4-0-13 [EMAIL PROTECTED]: 1 INVITE..Via: SIP/2.0/UDP 192.168.39.54;branch=z9hG4bK9017.79c65191.0..Via: SIP/2.0/UDP 192.168.39.50:5060;rport=5060;branch=z9hG4bK-44dc5c9d-4ee37f8-7b90..Max-Forwards: 69..Supported: 100rel..User-Agent: SIP-RG..Contact: < sip:[EMAIL PROTECTED]:5060;nat=yes>..Content-Type: application/sdp..Content-Length: 372..P-hint: rr-enforced....v=0..o=SIP-N-TA 0 0 IN IP4 192.168.39.50..s=C0A82732 0000 C0A82732 0000 01 0..c=IN IP4 192.168.39.50..t=0 0..m=image 3503835038 udptl t38..c=IN IP4 192.168.39.54192.168.39.54..a=T38FaxVersion:0..a=T38MaxBitRate:14400..a=T38FaxFillBitRemoval:0..a=T38FaxTranscodingMMR:0..a=T38FaxTranscodingJBIG
:0..a=T38FaxRateManagement:transferredTCF..a=nortpproxy:yes..a=nortpproxy:yes..


On 08/11/06 13:31, Pavel D. Kuzin wrote:

[...]



_______________________________________________
Users mailing list
[email protected]
http://openser.org/cgi-bin/mailman/listinfo/users

Reply via email to