<!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>All,</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; I am newbie to SER.Here has a 
question.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; I have three SIP-client(MSN messenger4.7 
and kphone)&nbsp;and a proxy server-SER.</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; Three clients all register to 
SER.</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; I uses messenger4.7 to invite the other one 
.When invite message pass through SER, I rewrite URI to kphone.</FONT></DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; But this doesn't work.Followed my 
script.How should I do&nbsp; this work?</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; Thanks.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; # ----------- global configuration 
parameters ------------------------</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>#debug=3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 
debug level (cmd line: 
-dddddddddd)<BR>#fork=yes<BR>#log_stderror=no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# (cmd line: -E)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>/* Uncomment these lines to enter debugging 
mode<BR>debug=9<BR>fork=no<BR>log_stderror=yes<BR>*/<BR>check_via=no&nbsp;&nbsp;&nbsp; 
# (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=4<BR>fifo="/tmp/ser_fifo"</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2># ------------------ module loading 
----------------------------------</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2># Uncomment this if you want to use SQL database</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>loadmodule "/usr/lib/ser/modules/mysql.so"<BR>loadmodule 
"/usr/lib/ser/modules/sl.so"<BR>loadmodule 
"/usr/lib/ser/modules/tm.so"<BR>loadmodule 
"/usr/lib/ser/modules/rr.so"<BR>loadmodule 
"/usr/lib/ser/modules/maxfwd.so"<BR>loadmodule 
"/usr/lib/ser/modules/usrloc.so"</FONT></DIV>
<DIV><FONT size=2>loadmodule "/usr/lib/ser/modules/registrar.so"</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2># Uncomment this if you want digest authentication<BR># 
mysql.so must be loaded !<BR>loadmodule 
"/usr/lib/ser/modules/auth.so"<BR>loadmodule 
"/usr/lib/ser/modules/auth_db.so"</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2># ----------------- setting module-specific parameters 
---------------</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2># -- usrloc params --</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>#modparam("usrloc", "db_mode",&nbsp;&nbsp; 0)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2># Uncomment this if you want to use SQL database<BR># for 
persistent storage and comment the previous line<BR>modparam("usrloc", 
"db_mode", 2)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2># -- 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")</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2># -- rr params --<BR># add value to ;lr param to make some 
broken UAs happy<BR>modparam("rr", "enable_full_lr", 1)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2># -------------------------&nbsp; request routing logic 
-------------------</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2># main routing logic</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>route{</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # initial sanity 
checks -- messages with<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 
max_forwards==0, or excessively long 
requests<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if 
(!mf_process_maxfwd_header("10")) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
sl_send_reply("483","Too Many 
Hops");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( msg:len &gt; max_len ) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
sl_send_reply("513", "Message too 
big");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # we record-route 
all messages -- to make sure that<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# subsequent messages will go through our proxy; 
that's<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # particularly good if 
upstream and downstream entities<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 
use different transport protocol<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
record_route();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # loose-route 
processing</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (loose_route()) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
t_relay();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<BR>&nbsp;# if the request is 
for other domain use UsrLoc<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # (in 
case, it does not work, use the following 
command<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # with proper names and 
addresses in it)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if 
(uri=~"mook.com") {</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if (method=="REGISTER") {</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2># Uncomment this if you want to use digest 
authentication<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if (!www_authorize("mook.com", "subscriber")) 
{<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; 
www_challenge("mook.com", 
"0");<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; 
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
};</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
save("location");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
};</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
# native SIP destinations are handled using our USRLOC 
DB<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if (method=="INVITE") {</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT 
size=2>&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; 
if (uri=~"<A href="mailto:messenger4.7@mook.com">messenger4.7@mook.com</A>") 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }; #end 
uri=myself<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # forward to current 
uri now; use stateful forwarding; 
that<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # works reliably even if we 
forward from TCP to UDP<BR>&nbsp;if (!t_relay()) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
sl_reply_error();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>}<BR></FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV></BODY></HTML>