<!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.2900.3020" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2> I use module AVPops and Textops do chang username of
request uri.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT
size=2>example:<BR> <A
href="mailto:john@10.10.16.23">john@10.10.16.23</A> </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>I hope chang => <A
href="mailto:4762@10.10.10.22">4762@10.10.10.22</A></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>my configuration sample:<BR> if
(uri=~"john@")<BR> {<BR> avp_write("4762",
"s:phone");<BR> subst_user(/(.*)/$avp(phone)/');<BR> rewritehostport("10.10.10.22:5060");<BR> forward(uri:host,
uri:port);<BR> avp_delete("s:phone");<BR> }; </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> but reply is "Call failed:Device not found"</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> I try this sample
is OK</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
if (uri=~"john@")<BR> {<BR> avp_write("4762",
"s:phone");<BR> subst_user(/(.*)/4762/');<BR> rewritehostport("10.10.10.22:5060");<BR> forward(uri:host,
uri:port);<BR> avp_delete("s:phone");<BR> };<BR>
OS: Freebsd
5.4<BR> SIP server:
SER-0.9.6<BR> <BR>please tell my
problem is on? Thank you</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Chungyu</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>This is my Configuration:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2># ----------- global configuration parameters
------------------------</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>#debug=3 #
debug level (cmd line: -dddddddddd)<BR>#fork=yes<BR>#log_stderror=no # (cmd
line: -E)</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>/* Uncomment these lines to enter debugging mode
<BR>fork=no<BR>log_stderror=yes<BR>*/</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT 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"<BR>fifo_db_url="mysql://ser:heslo@localhost/ser"<BR>#
------------------ module loading
----------------------------------</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2># Uncomment this if you want to use SQL database<BR>loadmodule
"/usr/local/lib/ser/modules/mysql.so"</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT 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/textops.so"<BR>loadmodule
"/usr/local/lib/ser/modules/avp.so"<BR>#loadmodule
"/usr/local/lib/ser/modules/uri.so"<BR>#loadmodule
"/usr/local/lib/ser/modules/usrloc.so"<BR>loadmodule
"/usr/local/lib/ser/modules/avpops.so"</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2># Uncomment this if you want digest authentication<BR>#
mysql.so must be loaded !<BR>loadmodule
"/usr/local/lib/ser/modules/auth.so"<BR>loadmodule
"/usr/local/lib/ser/modules/auth_db.so"</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2># ----------------- setting module-specific parameters
---------------</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2># -- usrloc params --</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>modparam("usrloc", "db_mode", 0)</FONT></DIV>
<DIV><FONT size=2></FONT> </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><FONT size=2></FONT> </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><FONT size=2></FONT> </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><FONT size=2></FONT> </DIV>
<DIV><FONT size=2># ------------------------- request routing logic
-------------------</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2># main routing logic</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>route{</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT 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
>= 2048 ) {<BR>sl_send_reply("513", "Message too
big");<BR>break;<BR>};</FONT></DIV>
<DIV> </DIV><FONT size=2>
<DIV><BR># 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(); </DIV>
<DIV> </DIV>
<DIV># 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>};</DIV>
<DIV> </DIV>
<DIV>if (!uri==myself) {<BR># mark routing logic in
request<BR>append_hf("P-hint: outbound\r\n");
<BR>route(1);<BR>break;<BR>};</DIV>
<DIV> </DIV>
<DIV># 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) {</DIV>
<DIV> </DIV>
<DIV>if (method=="REGISTER") {</DIV>
<DIV> </DIV>
<DIV># Uncomment this if you want to use digest authentication<BR>if
(!www_authorize("xx.xx.xx.xx", "subscriber")) {<BR>www_challenge("xx.xx.xx.xx",
"0");<BR>break;<BR>};</DIV>
<DIV> </DIV>
<DIV>save("location");<BR>break;<BR>};<BR>if
(uri=~"john@")<BR>{<BR> avp_write("4762","phone");<BR> subst_user('/(.*)/$avp(phone)/');<BR> rewritehostport("10.10.10.22:5060");<BR> forward(uri:host,
uri:port);<BR> avp_delete("phone");<BR>};<BR>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>};<BR>};<BR>append_hf("P-hint: usrloc applied\r\n");
<BR>route(1);<BR>}</DIV>
<DIV> </DIV>
<DIV>route[1] <BR>{<BR># 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>}<BR> </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV></BODY></HTML>