<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=big5">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi all,<BR>I am trying ser + rtpproxy like this</FONT></DIV>
<DIV>&nbsp;</DIV><FONT size=2>
<DIV><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Internet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
UA3<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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nbsp;&nbsp;&nbsp;&nbsp; UA2</DIV>
<DIV>&nbsp;</DIV>
<DIV>Now UA3 &lt;-&gt; UA1&nbsp;&nbsp; , UA1 &lt;-&gt; UA2 can make call 
successfuly via rtpproxy in bridge mode<BR>but now when UA1 &lt;-&gt; UA2 , i 
want the call can be made not via rtpproxy ,<BR>I think it should do some 
modification in ser.cfg to make this,<BR>I have try&nbsp; some modification, but 
it doesn't works</DIV>
<DIV>&nbsp;</DIV>
<DIV>could anyone give me any suggestion?</DIV>
<DIV>&nbsp;</DIV>
<DIV>this is my ser.cfg</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>#debug=4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # debug level 
(cmd line: -dddddddddd)<BR>fork=yes<BR>#log_stderror=yes # (cmd line: -E)</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>check_via=no # (cmd. line: 
-v)<BR>dns=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 
(cmd. line: -r)<BR>rev_dns=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (cmd. line: 
-R)<BR>port=5060<BR>children=1<BR>fifo="/tmp/ser_fifo"</DIV>
<DIV>&nbsp;</DIV>
<DIV># ------------------ module loading 
----------------------------------</DIV>
<DIV>&nbsp;</DIV>
<DIV># Uncomment this if you want to use SQL database<BR>#loadmodule 
"/lib/ser/modules/mysql.so"</DIV>
<DIV>&nbsp;</DIV>
<DIV>loadmodule "/lib/ser/modules/sl.so"<BR>loadmodule 
"/lib/ser/modules/tm.so"<BR>loadmodule "/lib/ser/modules/rr.so"<BR>loadmodule 
"/lib/ser/modules/maxfwd.so"<BR>loadmodule 
"/lib/ser/modules/usrloc.so"<BR>loadmodule 
"/lib/ser/modules/registrar.so"<BR>loadmodule 
"/lib/ser/modules/textops.so"</DIV>
<DIV>&nbsp;</DIV>
<DIV># Uncomment this if you want digest authentication<BR># mysql.so must be 
loaded !<BR>#loadmodule "/lib/ser/modules/auth.so"<BR>#loadmodule 
"/lib/ser/modules/auth_db.so"</DIV>
<DIV>&nbsp;</DIV>
<DIV># !! Nathelper<BR>loadmodule "/lib/ser/modules/nathelper.so"</DIV>
<DIV>&nbsp;</DIV>
<DIV># ----------------- setting module-specific parameters 
---------------</DIV>
<DIV>&nbsp;</DIV>
<DIV># -- usrloc params --</DIV>
<DIV>&nbsp;</DIV>
<DIV>modparam("usrloc", "db_mode",&nbsp;&nbsp; 0)</DIV>
<DIV>&nbsp;</DIV>
<DIV># Uncomment this if you want to use SQL database <BR># for persistent 
storage and comment the previous line<BR>#modparam("usrloc", "db_mode", 2)</DIV>
<DIV>&nbsp;</DIV>
<DIV># -- auth params --<BR># Uncomment if you are using auth 
module<BR>#<BR>#modparam("auth_db", "calculate_ha1", yes)<BR>#<BR># If you set 
"calculate_ha1" parameter to yes (which true in this config), <BR># uncomment 
also the following parameter)<BR>#<BR>#modparam("auth_db", "password_column", 
"password")</DIV>
<DIV>&nbsp;</DIV>
<DIV># -- rr params --<BR># add value to ;lr param to make some broken UAs 
happy<BR>modparam("rr", "enable_full_lr", 1)</DIV>
<DIV>&nbsp;</DIV>
<DIV># !! Nathelper<BR>modparam("registrar", "nat_flag", 
6)<BR>modparam("nathelper", "natping_interval", 5) # Ping interval 30 
s<BR>modparam("nathelper", "ping_nated_only", 1)&nbsp;&nbsp; # Ping only clients 
behind NAT</DIV>
<DIV>&nbsp;</DIV>
<DIV># -------------------------&nbsp; request routing logic 
-------------------</DIV>
<DIV>&nbsp;</DIV>
<DIV># main routing logic</DIV>
<DIV>&nbsp;</DIV>
<DIV>route{</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;# initial sanity checks -- messages with<BR>&nbsp;# max_forwards==0, 
or excessively long requests<BR>&nbsp;if (!mf_process_maxfwd_header("10")) 
{<BR>&nbsp; sl_send_reply("483","Too Many Hops");<BR>&nbsp; 
break;<BR>&nbsp;};<BR>&nbsp;if (msg:len &gt;=&nbsp; max_len ) {<BR>&nbsp; 
sl_send_reply("513", "Message too big");<BR>&nbsp; break;<BR>&nbsp;};</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # !! Nathelper<BR>&nbsp;# 
Special handling for NATed clients; first, NAT test is<BR>&nbsp;# executed: it 
looks for via!=received and RFC1918 addresses<BR>&nbsp;# in Contact (may fail if 
line-folding is used); also,<BR>&nbsp;# the received test should, if completed, 
should check all<BR>&nbsp;# vias for rpesence of received<BR>&nbsp;if 
(nat_uac_test("3")) {<BR>&nbsp; # Allow RR-ed requests, as these may indicate 
that<BR>&nbsp; # a NAT-enabled proxy takes care of it; unless it is<BR>&nbsp; # 
a REGISTER</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; if (method == "REGISTER" || ! search("^Record-Route:")) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log("LOG: Someone trying to register from 
private IP, rewriting\n");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # This will work 
only for user agents that support symmetric<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 
communication. We tested quite many of them and majority 
is<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # smart enough to be symmetric. In some 
phones it takes a configuration<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # option. With 
Cisco 7960, it is called NAT_Enable=Yes, with kphone it 
is<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # called "symmetric media" and "symmetric 
signalling".</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fix_nated_contact(); # Rewrite contact with 
source IP of signalling<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (method == 
"INVITE") <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR># jimmy added for test 
++++++++++++++++++++++++++++++++<BR>&nbsp;&nbsp; 
if(src_ip=~"192.168.5.*")<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; 
;<BR>&nbsp;&nbsp; }else{<BR># 
-----------------------------------------------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
fix_nated_sdp("1"); # Add direction=active to SDP<BR>&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; force_rport(); # Add rport parameter to 
topmost Via<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setflag(6);&nbsp;&nbsp;&nbsp; # 
Mark as NATed<BR>&nbsp; };<BR>&nbsp;};</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;# we record-route all messages -- to make sure that<BR>&nbsp;# 
subsequent messages will go through our proxy; that's<BR>&nbsp;# particularly 
good if upstream and downstream entities<BR>&nbsp;# use different transport 
protocol<BR>&nbsp;if (!method=="REGISTER") record_route(); </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;# subsequent messages withing a dialog should take the<BR>&nbsp;# 
path determined by record-routing<BR>&nbsp;if (loose_route()) {<BR>&nbsp; # mark 
routing logic in request<BR>&nbsp; append_hf("P-hint: rr-enforced\r\n"); 
<BR>&nbsp; route(1);<BR>&nbsp; break;<BR>&nbsp;};</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;if (!uri==myself) {<BR>&nbsp; # mark routing logic in 
request<BR>&nbsp; append_hf("P-hint: outbound\r\n"); <BR>&nbsp; 
route(1);<BR>&nbsp; break;<BR>&nbsp;};</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;# if the request is for other domain use UsrLoc<BR>&nbsp;# (in case, 
it does not work, use the following command<BR>&nbsp;# with proper names and 
addresses in it)<BR>&nbsp;if (uri==myself) {</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; if (method=="REGISTER") {</DIV>
<DIV>&nbsp;</DIV>
<DIV># Uncomment this if you want to use digest authentication<BR>#&nbsp;&nbsp; 
if (!www_authorize("iptel.org", "subscriber")) {<BR>#&nbsp;&nbsp;&nbsp; 
www_challenge("iptel.org", "0");<BR>#&nbsp;&nbsp;&nbsp; break;<BR>#&nbsp;&nbsp; 
};</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp; save("location");<BR>&nbsp;&nbsp; break;<BR>&nbsp; };</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; lookup("aliases");<BR>&nbsp; if (!uri==myself) {<BR>&nbsp;&nbsp; 
append_hf("P-hint: outbound alias\r\n"); <BR>&nbsp;&nbsp; 
route(1);<BR>&nbsp;&nbsp; break;<BR>&nbsp; };</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp; # native SIP destinations are handled using our USRLOC DB<BR>&nbsp; 
if (!lookup("location")) {<BR>&nbsp;&nbsp; sl_send_reply("404", "Not 
Found");<BR>&nbsp;&nbsp; break;<BR>&nbsp; 
};<BR>&nbsp;};<BR>&nbsp;append_hf("P-hint: usrloc applied\r\n"); 
<BR>&nbsp;route(1);<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>route[1] <BR>{<BR>&nbsp;# !! Nathelper</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;# if client or server know to be behind a NAT, enable 
relay<BR>&nbsp;if (isflagset(6)) {<BR># jimmy added for test 
++++++++++++++++++++++++++++++++++++++++++++++<BR>&nbsp; 
if(search("^(Contact|m): <A 
href="mailto:.*@(192\.168\">.*@(192\.168\</A>.)"))<BR>&nbsp; 
#if(src_ip=~"192.168.5.*")<BR>&nbsp; {<BR>&nbsp;&nbsp; ;<BR>&nbsp; }else{<BR># 
-------------------------------------------------------------------<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
force_rtp_proxy();<BR>&nbsp; }<BR>&nbsp; <BR>&nbsp;};</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;# NAT processing of replies; apply to all transactions (for 
example,<BR>&nbsp;# re-INVITEs from public to private UA are hard to identify 
as<BR>&nbsp;# NATed at the moment of request processing); look at 
replies<BR>&nbsp;t_on_reply("1");</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;# send it out now; use stateful forwarding as it works 
reliably<BR>&nbsp;# even for UDP2TCP<BR>&nbsp;if (!t_relay()) {<BR>&nbsp; 
sl_reply_error();<BR>&nbsp;};<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV># !! Nathelper<BR>onreply_route[1] {<BR>&nbsp;&nbsp;&nbsp; # NATed 
transaction ?<BR>&nbsp;&nbsp;&nbsp; if (isflagset(6) &amp;&amp; status =~ 
"(183)|2[0-9][0-9]") {<BR># jimmy added for test 
++++++++++++++++++++++++++++++++++++++++++++++<BR>&nbsp;if(src_ip=~"192.168.5.*")<BR>&nbsp;{<BR>&nbsp; 
;<BR>&nbsp;}else<BR>&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
fix_nated_contact();<BR>&nbsp;}<BR>&nbsp;force_rtp_proxy();<BR># 
-------------------------------------------------------------------<BR>&nbsp;&nbsp;&nbsp; 
# otherwise, is it a transaction behind a NAT and we did 
not<BR>&nbsp;&nbsp;&nbsp; # know at time of request processing ? (RFC1918 
contacts)<BR>&nbsp;&nbsp;&nbsp; } else if (nat_uac_test("1")) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
fix_nated_contact();<BR>&nbsp;&nbsp;&nbsp; };<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks in advance<BR>Jimmy</FONT></DIV></BODY></HTML>