<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2722" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>Jose,</DIV>
<DIV>I would say that the easiest (if under you control) would be to make the 
two networks routable across.&nbsp; If that's not possible, you need to look at 
the more advanced options of force_rtp_proxy.&nbsp; I suggest you try to look at 
one network as the private and one as the public.&nbsp; Detection of the two 
must be done by a check on IPs as nat_uac_test will just match against private 
addresses.</DIV>
<DIV>g-)</DIV>
<DIV>&nbsp;</DIV>
<DIV>---- Original Message ----<BR>From: Jose Soler<BR>To: 
serusers@lists.iptel.org<BR>Sent: Tuesday, September 20, 2005 02:20 PM<BR>Subject: 
[Serusers] RTP proxy between two subnetworks with private @s<BR><BR>&gt; 
Hi,<BR>&gt; <BR>&gt; I am trying to figure out how to solve the follwoing 
problem.<BR>&gt; I have two subnetworks, A and B, with different private ip 
adressing<BR>&gt; schemes (IP@A) and (IP@B). <BR>&gt; <BR>&gt; SER is installed 
in a computer with network interfaces towards both<BR>&gt; subnetworks. <BR>&gt; 
SER's SIP signalling proxying operation works properly within the<BR>&gt; 
subnetworks and when trying to set up a communication between users<BR>&gt; in A 
and B. But in that last case, obviously there is no media at all<BR>&gt; 
circulating among the subnetworks.&nbsp;&nbsp; <BR>&gt; <BR>&gt; Portaone's RTP 
proxy has been installed and configured in the<BR>&gt; computer with interfaces 
towards both subnetworks where SER is<BR>&gt; installed.&nbsp; <BR>&gt; <BR>&gt; 
I am trying to configure SER so that, based on the nathelper module,<BR>&gt; 
when communication between both subnetworks occurs, the RTP proxy is<BR>&gt; 
involved and the communication (also media and not only signalling)<BR>&gt; is 
possible. BUT I am making something wrong, becouse it does not<BR>&gt; work 
...&nbsp;&nbsp;&nbsp; <BR>&gt; <BR>&gt; Can anyone give me&nbsp; a hand 
/hint?<BR>&gt; Thanks a lot in advance / in any case.<BR>&gt; <BR>&gt; My SER 
config file is the following:<BR>&gt; <BR>&gt; #<BR>&gt; # ----------- global 
configuration parameters ------------------------<BR>&gt; /* Uncomment these 
lines to enter debugging mode<BR>&gt; debug=7<BR>&gt; fork=no<BR>&gt; 
log_stderror=yes<BR>&gt; */<BR>&gt; check_via=no # (cmd. line: -v)<BR>&gt; 
dns=no # (cmd. line: -r)<BR>&gt; rev_dns=no # (cmd. line: -R)<BR>&gt; 
fifo="/tmp/ser_fifo"<BR>&gt; fifo_mode=0662<BR>&gt; 
alias=wirelessip.x.x.x<BR>&gt; alias=sip..x.x.x<BR>&gt; alias=x.x.x<BR>&gt; 
log_stderror=no<BR>&gt; debug=3<BR>&gt; children=3<BR>&gt; mhomed=1<BR>&gt; # 
------------------ module loading ----------------------------------<BR>&gt; # 
Uncomment this if you want to use SQL database<BR>&gt; loadmodule 
"/lib/ser/modules/mysql.so"<BR>&gt; loadmodule "/lib/ser/modules/sl.so"<BR>&gt; 
loadmodule "/lib/ser/modules/tm.so"<BR>&gt; loadmodule 
"/lib/ser/modules/rr.so"<BR>&gt; loadmodule "/lib/ser/modules/maxfwd.so"<BR>&gt; 
loadmodule "/lib/ser/modules/usrloc.so"<BR>&gt; loadmodule 
"/lib/ser/modules/textops.so"<BR>&gt; loadmodule 
"/lib/ser/modules/registrar.so"<BR>&gt; # Uncomment this if you want digest 
authentication<BR>&gt; # mysql.so must be loaded !<BR>&gt; loadmodule 
"/lib/ser/modules/auth.so"<BR>&gt; loadmodule 
"/lib/ser/modules/auth_db.so"<BR>&gt; # For NAT support / media proxying<BR>&gt; 
loadmodule "/lib/ser/modules/nathelper.so"<BR>&gt; # ----------------- setting 
module-specific parameters ---------------<BR>&gt; # -- usrloc params --<BR>&gt; 
#modparam("usrloc", "db_mode", 0)<BR>&gt; # Uncomment this if you want to use 
SQL database<BR>&gt; # for persistent storage and comment the previous 
line<BR>&gt; modparam("usrloc", "db_mode", 2)<BR>&gt; # -- auth params 
--<BR>&gt; # Uncomment if you are using auth module<BR>&gt; modparam("auth_db", 
"calculate_ha1", yes)<BR>&gt; # If you set "calculate_ha1" parameter to yes 
(which true in this<BR>&gt; config), <BR>&gt; # uncomment also the following 
parameter)<BR>&gt; modparam("auth_db", "password_column", "password")<BR>&gt; # 
-- rr params --<BR>&gt; # add value to ;lr param to make some broken UAs 
happy<BR>&gt; modparam("rr", "enable_full_lr", 1)<BR>&gt; # For NAT<BR>&gt; # We 
will use flag 6 to mark NATed contacts<BR>&gt; modparam("registrar", "nat_flag", 
6)<BR>&gt; # Enable NAT pinging<BR>&gt; modparam("nathelper", 
"natping_interval", 60)<BR>&gt; # Ping only contacts that are known to 
be<BR>&gt; # behind NAT<BR>&gt; modparam("nathelper", "ping_nated_only", 
1)<BR>&gt; # ------------------------- request routing logic 
-------------------<BR>&gt; # main routing logic<BR>&gt; route{<BR>&gt; # 
initial sanity checks -- messages with<BR>&gt; # max_forwards==0, or excessively 
long requests<BR>&gt; if (!mf_process_maxfwd_header("10")) {<BR>&gt; 
sl_send_reply("483","Too Many Hops");<BR>&gt; break;<BR>&gt; };<BR>&gt; if ( 
msg:len &gt; max_len ) {<BR>&gt; sl_send_reply("513", "Message too 
big");<BR>&gt; break;<BR>&gt; };<BR>&gt; # special handling for NATed clients; 
first, nat test is<BR>&gt; # executed: it looks for via!=received and RFC1918 
addresses<BR>&gt; # in Contact (may fail if line-folding used); also,<BR>&gt; # 
the received test should, if complete, should check all<BR>&gt; # vias for 
presence of received<BR>&gt; if (nat_uac_test("3")) {<BR>&gt; # allow RR-ed 
requests, as these may indicate that<BR>&gt; # a NAT-enabled proxy takes care of 
it; unless it is<BR>&gt; # a REGISTER<BR>&gt; if (method == "REGISTER" || ! 
search("^Record-Route:")) {<BR>&gt; log("LOG: Someone trying to register from 
private IP, rewriting\n");<BR>&gt; # This will work only for user agents that 
support symmetric<BR>&gt; # communication. We tested quite many of them and 
majority is<BR>&gt; # smart smart enough to be symmetric. In some phones, 
like<BR>&gt; # it takes a configuration option. With Cisco 7960, it is<BR>&gt; # 
called NAT_Enable=Yes, with kphone it is called<BR>&gt; # "symmetric media" and 
"symmetric signaling". (The latter<BR>&gt; # not part of public released 
yet.)<BR>&gt; fix_nated_contact(); # Rewrite contact with source IP of 
signalling<BR>&gt; if (method == "INVITE") {<BR>&gt; fix_nated_sdp("1"); # Add 
direction=active to SDP<BR>&gt; };<BR>&gt; force_rport(); # Add rport parameter 
to topmost Via<BR>&gt; setflag(6); # Mark as NATed<BR>&gt; };<BR>&gt; };<BR>&gt; 
# we record-route all messages -- to make sure that<BR>&gt; # subsequent 
messages will go through our proxy; that's<BR>&gt; # particularly good if 
upstream and downstream entities<BR>&gt; # use different transport 
protocol<BR>&gt; record_route();<BR>&gt; # loose-route processing<BR>&gt; if 
(loose_route()) {<BR>&gt; t_relay();<BR>&gt; break;<BR>&gt; };<BR>&gt; 
lookup("aliases");<BR>&gt; # if the request is for other domain use 
UsrLoc<BR>&gt; # (in case, it does not work, use the following command<BR>&gt; # 
with proper names and addresses in it)<BR>&gt; if (uri==myself) {<BR>&gt; if 
(method=="REGISTER") {<BR>&gt; # Uncomment this if you want to use digest 
authentication<BR>&gt; if (!www_authorize("com.dtu.dk", "subscriber")) {<BR>&gt; 
www_challenge("com.dtu.dk", "0");<BR>&gt; break;<BR>&gt; };<BR>&gt; 
save("location");<BR>&gt; break;<BR>&gt; };<BR>&gt; # native SIP destinations 
are handled using our USRLOC DB<BR>&gt; if (!lookup("location")) {<BR>&gt; 
sl_send_reply("404", "Not Found");<BR>&gt; break;<BR>&gt; };<BR>&gt; };<BR>&gt; 
# forward to current uri now; use stateful forwarding; that<BR>&gt; # works 
reliably even if we forward from TCP to UDP<BR>&gt; if (!t_relay()) {<BR>&gt; 
sl_reply_error();<BR>&gt; };<BR>&gt; }<BR>&gt; #<BR>&gt; # Forcing media relay 
if necessary<BR>&gt; #<BR>&gt; route[1] {<BR>&gt; #if 
(uri=~"[@:](192\.168\.|10\.|172\.16)" &amp;&amp; !search("^Route:")){<BR>&gt; # 
sl_send_reply("479", "We don't forward to private IP addresses");<BR>&gt; # 
break;<BR>&gt; #};<BR>&gt; #if (isflagset(6)) {<BR>&gt; force_rtp_proxy(); # I 
force everything through the proxy<BR>&gt; t_on_reply("1");<BR>&gt; 
append_hf("P-Behind-NAT: Yes\r\n");<BR>&gt; #};<BR>&gt; if (!t_relay()) 
{<BR>&gt; sl_reply_error();<BR>&gt; break;<BR>&gt; };<BR>&gt; }<BR>&gt; 
onreply_route[1] {<BR>&gt; if (status =~ "(183)|2[0-9][0-9]") {<BR>&gt; 
fix_nated_contact();<BR>&gt; force_rtp_proxy();<BR>&gt; };<BR>&gt; }<BR>&gt; 
<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; 
_______________________________________________<BR>&gt; Serusers mailing 
list<BR>&gt; serusers@lists.iptel.org<BR>&gt; 
http://lists.iptel.org/mailman/listinfo/serusers</DIV></BODY></HTML>