<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-9">
<META content="MSHTML 6.00.2900.2604" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>
<DIV><FONT face=Arial size=2>Conditions as follows :</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>* SER runs on a Public IP</FONT></DIV>
<DIV><FONT face=Arial size=2>* SER works without auth & database
modules,</FONT></DIV>
<DIV><FONT face=Arial size=2>* Nearly all user behind NAT (but routers
configured to do port forwarding for TCP/UDP 5060) to help SER in some
cases,</FONT></DIV>
<DIV><FONT face=Arial size=2>* Users numbers in format of 833XXXXXXX 834XXXXXXX
and they should call each P2P-SIP-Calls (if not behind NAT),</FONT></DIV>
<DIV><FONT face=Arial size=2>* If a user need to call PSTN end point (SIP
Gateway located at 212.154.32.154) the call traffic should flow over SER to SIP
Gateway via T1 connection already located between that systems so SER
handles all voice traffic by help of RTP Proxy.</FONT></DIV>
<DIV><FONT face=Arial size=2>* UA's registers on SER (Zyxel Prestige 2000, Zyxel
Prestige 200W, Cisco ATA186 etc.)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Problem is users </FONT><FONT face=Arial
size=2>cannot call each other (if i comment lines for nathelper they can
call)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>It's clear i think, and below is my ser.cfg, what
do i need extra or erase.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><-<-<-<-< MY SER.CFG STARTS HERE
>->->->-></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#<BR># $Id nathelper.cfg,v 1.1.2.1 20050301 by Ozan
Blotter Exp $<BR>#<BR># simple quick-start config script including nathelper
support</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># This default script includes nathelper support.
To make it work<BR># you will also have to install Maxim's RTP proxy. The proxy
is enforced<BR># if one of the parties is behind a NAT.<BR>#<BR># If you have an
endpoing in the public internet which is known to<BR># support symmetric RTP
(Cisco PSTN gateway or voicemail, for example),<BR># then you don't have to
force RTP proxy. If you don't want to enforce<BR># RTP proxy for some
destinations than simply use t_relay() instead of<BR># route(1)<BR>#<BR>#
Sections marked with !! Nathelper contain modifications for nathelper<BR>#<BR>#
NOTE !! This config is EXPERIMENTAL !<BR>#<BR># ----------- global configuration
parameters ------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#
debug=3 # debug level (cmd line
-dddddddddd)<BR># fork=yes<BR>#
log_stderror=no # (cmd line -E)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>/* Uncomment these lines to enter debugging
mode<BR>debug=7<BR>fork=no<BR>log_stderror=yes<BR>*/</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>check_via=no # (cmd. line
-v)<BR>dns=no #
(cmd. line -r)<BR>rev_dns=no # (cmd. line
-R)<BR>port=5060<BR>children=4<BR>fifo="/tmp/ser_fifo"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># ------------------ 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/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/textops.so"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># !! Nathelper<BR>loadmodule
"/usr/local/lib/ser/modules/nathelper.so"</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># ----------------- setting module-specific
parameters ---------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># -- usrloc params --</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>modparam("usrloc", "db_mode",
0)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># -- rr params --<BR># add value to ;lr param to
make some broken UAs happy</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>modparam("rr", "enable_full_lr", 1)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># !! Nathelper<BR>modparam("registrar", "nat_flag",
6)<BR>modparam("nathelper", "natping_interval", 10) # Ping interval 10
seconds<BR>modparam("nathelper", "ping_nated_only", 1) # Ping only
clients behind NAT</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># ------------------------- request routing
logic -------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2># main routing logic</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>route{</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> #
initial sanity checks -- messages
with<BR> # max_forwards==0, or
excessively long requests<BR> if
(!mf_process_maxfwd_header("10"))
{<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> };</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> # if
((method=="NOTIFY")&& search("^Event: Keep-Alive"))
{<BR> #
ls_send_reply("200","OK");<BR>
# break;<BR> #
};</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> # !!
Nathelper<BR> # Special handling for
NATed clients; first, NAT test is<BR>
# executed it looks for via!=received and RFC1918
addresses<BR> # in Contact (may fail
if line-folding is used); also,<BR> #
the received test should, if completed, should check
all<BR> # vias for rpesence of
received<BR>
if (nat_uac_test("3")) {</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> # Allow
RR-ed requests, as these 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\$</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> # This
will work only for user agents that support
symmetric<BR> # communication. We
tested quite many of them and majority
is<BR> # smart enough to be symmetric.
In some phones it takes a
configuration<BR> # option. With Cisco
7960, it is called NAT_Enable=Yes, with kphone it
$<BR> # called symmetric media and
symmetric signalling.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>
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>
</FONT></DIV>
<DIV><FONT face=Arial
size=2> force_rport();
# Add rport parameter to topmost
Via<BR>
setflag(6); # Mark as
NATed<BR>
};<BR> };</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> # we
record-route all messages -- to make sure
that<BR> # subsequent messages will go
through our proxy; that's<BR> #
particularly good if upstream and downstream
entities<BR> # use different transport
protocol<BR> if (!method=="REGISTER")
record_route();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> #
subsequent messages withing a dialog should take
the<BR> # path determined by
record-routing<BR> if (loose_route())
{<BR>
# mark routing logic in
request<BR>
append_hf("P-hint:
rr-enforced\r\n");<BR>
route(1);<BR>
break;<BR> };</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> if
(!uri==myself)
{<BR>
# mark routing logic in
request<BR>
append_hf("P-hint:
outbound\r\n");<BR>
route(1);<BR>
break;<BR> };</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> # if the
request is for other domain use
UsrLoc<BR> # (in case, it does not
work, use the following command<BR> #
with proper names and addresses in
it)<BR> if (uri==myself)
{</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>
if (method=="REGISTER") {</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>
if (!(uri=~"sip:(833)|(834)"))
{<BR>
t_relay_to_udp("212.154.32.154","5060");</FONT></DIV>
<DIV><FONT face=Arial
size=2><BR>
save("location");<BR>
break;<BR>
};</DIV>
<DIV> </DIV>
<DIV> #
lookup(aliases);<BR> # if
(!uri==myself) {<BR> #
append_hf("P-hint: outbound
alias\r\n");<BR> #
route(1);<BR> #
break;<BR> # };</DIV>
<DIV> </DIV>
<DIV>
# native SIP destinations are handled using our USRLOC
DB<BR>
if (!lookup("location"))
{<BR>
sl_send_reply("404", "Not
Found");<BR>
break;<BR> };</DIV>
<DIV>
};<BR> append_hf("P-hint: usrloc
applied\r\n");<BR>
route(1);<BR>}</DIV>
<DIV> </DIV>
<DIV>route[1]<BR>{<BR> # !!
Nathelper<BR> if
(uri=~"[@:](192\.168\.|10\.172\.(1[6-9]|2[0-9]|3[0-1])\.)" &&
!searc$<BR>
sl_send_reply("479", "We don't forward to private IP
addresses");<BR>
break;<BR> };</DIV>
<DIV> </DIV>
<DIV> # if client or server know to be
behind a NAT, enable relay<BR> if
(isflagset(6))
{<BR>
force_rtp_proxy();<BR> };</DIV>
<DIV> </DIV>
<DIV> # NAT processing of replies;
apply to all transactions (for
example,<BR> # re-INVITEs from public
to private UA are hard to identify
as<BR> # NATed at the moment of
request processing); look at
replies<BR> t_on_reply("1");</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> };<BR>}</DIV>
<DIV> </DIV>
<DIV> # !!
Nathelper<BR> onreply_route[1]
{<BR> # NATed
transaction<BR> if (isflagset(6)
&& status =~ "(183)|2[0-9][0-9]")
{<BR> fix_nated_contact();</DIV>
<DIV> </DIV>
<DIV> if
(!search("^Content-Length:\0")){<BR>
force_rtp_proxy();<BR> };<BR></DIV>
<DIV> # otherwise, is it a transaction
behind a NAT and we did not<BR> # know
at time of request processing (RFC1918
contacts)<BR> } else if
(nat_uac_test("1")) {<BR>
fix_nated_contact();</DIV>
<DIV> </DIV>
<DIV> if
(!search("^Content-Length:\0")){<BR>
force_rtp_proxy();<BR> };<BR></DIV>
<DIV> # otherwise, is it a transaction
behind a NAT and we did not<BR> # know
at time of request processing (RFC1918
contacts)<BR> } else if
(nat_uac_test("1")) {<BR>
fix_nated_contact();<BR> };<BR>}</DIV>
<DIV> </DIV>
<DIV><-<-<-<-< MY SER.CFG ENDS HERE
>->->->-></FONT></DIV></DIV></BODY></HTML>