<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi guys, </FONT></DIV>
<DIV><FONT face=Arial size=2>I have some problems with ser. When trying to call
from internal ip (nat) I can hear</FONT></DIV>
<DIV><FONT face=Arial size=2>user that is behind nat but he can't hear me. Same
problem exist when to users behind </FONT></DIV>
<DIV><FONT face=Arial size=2>nat call each other. The main problem comes when I
forward calls - all calls starting </FONT></DIV>
<DIV><FONT face=Arial size=2>with 1-9 are forwarded to pstn provider (quintum
gw). Whatever - internal or external </FONT></DIV>
<DIV><FONT face=Arial size=2>ip is used I cannot hear user at the other side but
he hears me!</FONT></DIV>
<DIV><FONT face=Arial size=2>Here is my configuration:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>debug=9 # debug level
(cmd line: -dddddddddd)<BR>#fork=yes<BR>log_stderror=yes # (cmd line:
-E)</FONT></DIV>
<DIV><FONT face=Arial size=2>check_via=no # (cmd. line:
-v)<BR>dns=yes #
(cmd. line: -r)<BR>rev_dns=yes # (cmd. line:
-R)<BR>port=5060<BR>children=4<BR>fifo="/tmp/ser_fifo"<BR>fifo_mode=0777<BR>#
------------------ module loading
----------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># Uncomment this if you want to use SQL
database<BR>loadmodule "/usr/local/lib/ser/modules/mysql.so"</FONT></DIV>
<DIV><FONT face=Arial size=2>loadmodule
"/usr/local/lib/ser/modules/sl.so"<BR>loadmodule
"/usr/local/lib/ser/modules/tm.so"<BR>loadmodule
"/usr/local/lib/ser/modules/rr.so"<BR>loadmodule
"/usr/local/lib/ser/modules/maxfwd.so"<BR>loadmodule
"/usr/local/lib/ser/modules/usrloc.so"<BR>loadmodule
"/usr/local/lib/ser/modules/registrar.so"<BR>loadmodule
"/usr/local/lib/ser/modules/auth.so"<BR>loadmodule
"/usr/local/lib/ser/modules/auth_db.so"<BR>loadmodule
"/usr/local/lib/ser/modules/textops.so"<BR>loadmodule
"/usr/local/lib/ser/modules/domain.so"<BR>#loadmodule
"/usr/local/lib/ser/modules/mediaproxy.so"<BR>loadmodule
"/usr/local/lib/ser/modules/acc.so"<BR>loadmodule
"/usr/local/lib/ser/modules/msilo.so"<BR>loadmodule
"/usr/local/lib/ser/modules/nathelper.so"<BR># ----------------- setting
module-specific parameters ---------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># -- usrloc params --<BR>modparam("usrloc",
"db_mode", 2)<BR>modparam("usrloc", "db_url",
"mysql://ser:heslo@192.168.2.15/ser")<BR>modparam("auth_db", "calculate_ha1",
yes)<BR>modparam("auth_db", "password_column", "password")<BR>modparam("rr",
"enable_full_lr", 1)<BR>modparam("acc", "db_url",
"mysql://ser:heslo@192.168.2.15/ser")<BR>modparam("acc", "log_level", 2)
<BR>modparam("acc", "log_flag", 3)<BR>modparam("acc", "log_level", 1)<BR>#
number of flag, which will be used for accounting; if a message is<BR># labeled
with this flag, its completion status will be reported<BR>modparam("acc",
"log_flag", 1)<BR>modparam("acc", "log_fmt", "cdfimorstup")<BR>modparam("acc",
"db_url", "mysql://ser:heslo@192.168.2.15/ser")<BR>modparam("acc", "db_flag",
1)<BR>modparam("acc", "log_missed_flag", 1)<BR>modparam("msilo", "db_url",
"mysql://ser:heslo@80.72.68.187/ser")<BR>modparam("msilo", "db_table",
"silo")<BR>#modparam("msilo", "registrar",
"sip:registrar@iptel.org")<BR>modparam("msilo", "expire_time",
259200)<BR>modparam("msilo", "check_time", 10)<BR>#modparam("msilo",
"clean_period", "3")<BR>modparam("msilo", "use_contact",
1)<BR>#modparam("rtpproxy", "rtpproxy_socket",
"/var/run/rtpproxy.sock")<BR>#modparam("nathelper", "rtpproxy_socket",
"/var/run/rtpproxy.sock")<BR>modparam("nathelper","rtpproxy_sock",
"/var/run/rtpproxy.sock")<BR>modparam("registrar", "nat_flag",
6)<BR>modparam("nathelper", "natping_interval", 30) # Ping interval 30
s<BR>modparam("nathelper", "ping_nated_only", 1) </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2><FONT face=Arial>listen=83.74.45.87</FONT><BR></FONT><FONT
face=Arial size=2># ------------------------- request routing logic
-------------------<BR># main routing logic<BR>route{<BR> if
(!mf_process_maxfwd_header("70")) {<BR> sl_send_reply("483","Too Many
Hops");<BR> break;<BR> };<BR> if ( msg:len > max_len )
{<BR> sl_send_reply("513", "Message too
big");<BR> break;<BR> };<BR> record_route(); <BR> if
(loose_route())
{<BR> t_relay();<BR> break;<BR> };</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV><BR> if (nat_uac_test("3"))
{<BR>
# Allow RR-ed requests, as there may indicate
that<BR>
# a NAT-enabled proxy takes care of it; unless it
is<BR>
# a
REGISTER<BR>
if (method == "REGISTER" || ! search("^Record-Route:"))
{<BR>
log("LOG: Someone trying to register from private IP,
rewriting\n");<BR>
fix_nated_contact(); # Rewrite contact with source IP of
signalling<BR>
if (method == "INVITE")
{<BR>
fix_nated_sdp("1"); # Add direction=active to
SDP<BR>
};<BR>
force_rport(); # Add rport parameter to topmost
Via<BR>
setflag(6); # Mark as
NATed<BR>
};<BR> };</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> if (uri==myself) {<BR> if (method=="REGISTER")
{<BR>
if (!www_authorize("83.74.45.87", "subscriber"))
{<BR>
www_challenge("83.74.45.87",
"0");<BR> break;<BR> };<BR> force_rtp_proxy();<BR> save("aliases");<BR> save("location");<BR>
if
(m_dump())<BR>
{<BR>
log("MSILO: offline messages dumped - if they
were\n");<BR>
}else{<BR>
log("MSILO: no offline messages
dumped\n");<BR>
};<BR> break;<BR> };<BR>};<BR><BR>if
(uri=~"^sip:[1-9]*@83.74.45.87")
{ <BR>
rewritehost("122.44.75.176");<BR>
forward( 122.44.75.176, 5060 );</DIV>
<DIV>
break; <BR> }
<BR>setflag(1);<BR> lookup("aliases");</DIV>
<DIV> </DIV>
<DIV> if (uri==myself)
{<BR>
if (method=="INVITE")
{<BR>
record_route();<BR>
if (isflagset(6))
{<BR>
force_rtp_proxy();<BR>
};<BR>
};<BR>};</DIV>
<DIV> </DIV>
<DIV><BR>
if(!lookup("location"))<BR>
{<BR> if (!
t_newtran())<BR>
{<BR>
sl_reply_error();<BR>
break;<BR>
};<BR> if
(!method=="MESSAGE")<BR>
{<BR>
if (!t_reply("404", "Not
found"))<BR>
{<BR>
sl_reply_error();<BR>
};<BR>
break;<BR>
};<BR>
log("MESSAGE received -> storing using
MSILO\n");<BR>
if
(m_store("0"))<BR>
{<BR>
log("MSILO: offline message
stored\n");<BR>
if (!t_reply("202",
"Accepted"))<BR>
{<BR>
sl_reply_error();<BR>
};<BR>
}else{<BR>
log("MSILO: offline message NOT
stored\n");<BR>
if (!t_reply("503", "Service
Unavailable"))<BR>
{<BR>
sl_reply_error();<BR>
};<BR>
};<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV><BR> if (!t_relay())
{<BR> sl_reply_error();<BR> };</DIV>
<DIV> </DIV>
<DIV>}<BR>#route[1] {<BR># if (!t_relay())
{<BR># sl_reply_error();<BR># };<BR>#}</DIV>
<DIV> </DIV>
<DIV><BR>route[1] {<BR> if
(uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" &&
!search("^Route:")){<BR>
sl_send_reply("479", "We don't forward to private IP
addresses");<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> if (isflagset(6))
{<BR>
force_rtp_proxy();<BR>
t_on_reply("1");<BR>
append_hf("P-Behind-NAT:
Yes\r\n");<BR> };</DIV>
<DIV> </DIV>
<DIV> # send it out now; use stateful
forwarding as it works reliably<BR> #
even for UDP2TCP<BR> if (!t_relay())
{<BR>
sl_reply_error();<BR>
break;<BR> };<BR>}</DIV>
<DIV> </DIV>
<DIV>onreply_route[1] {<BR> # NATed
transaction ?<BR> if (status =~
"(183)|2[0-9][0-9]")
{<BR>
fix_nated_contact();<BR>
force_rtp_proxy();<BR> # otherwise, is
it a transaction behind a NAT and we did
not<BR> # know at time or request
processing ? (RFC1918 contacts)<BR> }
else if (nat_uac_test("1"))
{<BR>
fix_nated_contact();<BR> };<BR>}</DIV>
<DIV> </DIV>
<DIV><BR>failure_route[1] {<BR> # forwarding failed -- check
if the request was a MESSAGE<BR> if
(!method=="MESSAGE")<BR>
{<BR> break;<BR>
};</DIV>
<DIV> </DIV>
<DIV> log(1,"MSILO:the downstream UA doesn't support
MESSAGEs\n");<BR> # we have changed the R-URI with the contact
address, ignore it now<BR> if
(m_store("1"))<BR>
{<BR> log("MSILO: offline message
stored\n");<BR> t_reply("202",
"Accepted");<BR>
}else{<BR> log("MSILO: offline message
NOT stored\n");<BR> t_reply("503",
"Service Unavailable");<BR> };</DIV>
<DIV> </DIV>
<DIV>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks in advance :)</DIV>
<DIV> </DIV>
<DIV>Pavel<BR></DIV></FONT></BODY></HTML>