<DIV>I changed the line modparam("nathelper", "rtpproxy_sock", "/var/run/rtpproxy.sock") to modparam("nathelper", "rtpproxy_sock", "udp:localhost:22222") and started the rtpproxy as ./rtpproxy -s udp from the relevant directory and this resulted in a series of "rtpp_command: no response from rtpproxy" and rtpproxy temporarily disabled" errors. If I return to the original modparam and start it as ./rtpproxy then it works but like I said when the private client rings the public client, I get "ERROR: send_rtpp_command: cant read reply from a RTP Proxy".</DIV>
<DIV> </DIV>
<DIV>Any further ideas? Has anyone on the mailing list experienced this? I am using the script given in the onsip getting started doc for 0.9.0. but am using ser 0.8.14.</DIV>
<DIV> </DIV>
<DIV>BR,</DIV>
<DIV>Vivienne</DIV>
<DIV><BR><BR><B><I>"Greger V. Teigre" <greger@teigre.com></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2900.2604" name=GENERATOR>
<STYLE></STYLE>
<DIV>See inline.</DIV>
<DIV><BR>> Thank you for that Greger. I have altered my script so that it<BR>> exactly mimics the one in the onsip document besides the has_totag<BR>> and fix_nated register. All is good when I ring from a private phone<BR>> to a public phone i.e. the audio is very clear and the following<BR>> messages are in /var/log. <BR>> <BR>> ERROR: extract_body: message body has length zero<BR>> ERROR: force_rtp_proxy2: cant extract body from the message.<BR>> <BR>> I assume this is because of the 200 OK to a register message where<BR>> theres no sdp?? Is this correct? <BR></DIV>
<DIV>That's correct. You will find code in the example configs where we test for an empty body before calling force_rtp_proxy.</DIV>
<DIV><BR>> However when I try to phone from public into private I get:<BR>> <BR>> ERROR: send_rtpp_command: cant read reply from a RTP Proxy.<BR>> <BR>> I find this confusing because I know the rtpproxy is working.<BR></DIV>
<DIV>This means that rtpproxy is not responding to a particular message. I have heard some people have had problems with the socket based communication. I only use UDP. This is what you do to set up udp (22222 is default port):</DIV>
<DIV>modparam("nathelper", "rtpproxy_sock", "udp:localhost:22222")</DIV>
<DIV>rtpproxy must be started with -s udp:*</DIV>
<DIV>g-)</DIV>
<DIV><BR>> BR<BR>> Vivienne.<BR>> <BR>> "Greger V. Teigre" <greger@teigre.com> wrote:<BR>> Yes, you can use fix_nated_contact instead. It is not entirely<BR>> RFC-compliant, but that's what you have in 0.8.14. <BR>> The has_totag() only tests to see if the INVITE has a To header,<BR>> which means that it is in-dialog and thus is a re-INVITE. An INVITE<BR>> will normally not have loose routing unless you have another SIP<BR>> proxy forwarding an INVITE to you (in which case you should assume<BR>> that the other proxy handles NAT and thus not trigger NAT-related<BR>> code). You can safely remove the has_totag() if you use<BR>> force_rtp_proxy("l") <BR>> g-)<BR>> <BR>> ---- Original Message ----<BR>> From: Vivienne Curran<BR>> To: Greger V. Teigre ; serusers@lists.iptel.org<BR>> Sent: Tuesday, April 05, 2005 02:25 PM<BR>> Subject: Re: [Serusers] Contact Header and SDP not
rewritten<BR>> <BR>>> Greger,<BR>>> <BR>>> Since fix_nated_register does not exist with 0.8.14, will<BR>>> fix_nated_contact do instead? Also if I am leaving out the<BR>>> has_totag() at the start of the script, will this greatly effect its<BR>>> functionality?<BR>>> <BR>>> Thank you,<BR>>> Vivienne<BR>>> <BR>>> "Greger V. Teigre" <greger@teigre.com> wrote:<BR>>> Vivienne,<BR>>> <BR>>> This is the first INVITE going from SER to your public phone. I have<BR>>> prefixed my comments with *==><BR>>> <BR>>> U 84.203.148.146:5060 -> 157.190.74.151:5060<BR>>> INVITE sip:2092@157.190.74.151 SIP/2.0..Via: SIP/2.0/UDP<BR>>> 84.203.148.146;branch=z9hG4bK77bc.b54ca216.0..<BR>>> Via: SIP/2.0/UDP<BR>>> 172.16.3.31;rport=5060;received=84.203.148.14;branch=z9hG4bK1a48edc121f5bc1f..<BR>>> From: "2093"
<sip:2093@84.203.148.146>;tag=2dc376dcd4655094..<BR>>> To: <sip:2092@84.203.148.146>..<BR>>> Contact: <sip:2093@84.203.148.14:5060>..<BR>>> *==> Correctly changed to the public address and port of 2093<BR>>> Supported: replaces..Call-ID: 44e1ae63c476fbff@172.16.3.31..CSeq:<BR>>> 10327 INVITE..<BR>>> User-Agent: Grandstream BT100 1.0.5.18..<BR>>> Max-Forwards: 69..Allow:<BR>>> INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..<BR>>> Content-Type: application/sdp..<BR>>> Content-Length: 443....v=0..<BR>>> o=2093 8000 0 IN IP4 172.16.3.31..<BR>>> s=SIP Call..<BR>>> c=IN IP4 84.203.148.1484.203.148.146..<BR>>> *==> Here it seems that first fix_nated_sdp("3") is called (replace<BR>>> private IP with public IP), then force_rtp_proxy() (replace with<BR>>> proxy IP). You must only call one of them (fix_nated_sdp! ("1") is<BR>>> ok) t=0 0..<BR>>>
m=audio 35006 RTP/AVP 0 8 4 18 2 15 99 9..<BR>>> a=sendrecv..<BR>>> a=rtpmap:0 PCMU/8000/3..<BR>>> a=rtpmap:8 PCMA/8000/3..<BR>>> a=rtpmap:4 G723/8000/3..a=rtpmap:18 G729/8000/3..<BR>>> a=rtpmap:2 G726-32/8000/3..<BR>>> a=rtpmap:15 G728/8000/3..<BR>>> a=rtpmap:99 iLBC/8000/3..<BR>>> a=fmtp:99 mode=20..<BR>>> a=rtpmap:9 G722/8000/3..<BR>>> a=ptime:20..<BR>>> a=direction:active..<BR>>> *==> Added by fix_nated_sdp("1") (and "3")<BR>>> a=oldmediaip:172.16.3.31..<BR>>> *==> Added by fix_nated_sdp("3")<BR>>> a=nortpproxy:yes..<BR>>> *==> Added by force_rtp_proxy()<BR>>> <BR>>> So, your call is proxied. Try using fix_nated_sdp("1"). It should<BR>>> make the INVITE correct. You have not posted the OK, so I don't know<BR>>> what is happening there. If you have followed the rtpproxy ONsip.org<BR>>> example in your onreply_route, you should be
fine.<BR>>> <BR>>> Good luck!<BR>> &g! t; g-)<BR>>> <BR>>> ---- Original Message ----<BR>>> From: Vivienne Curran<BR>>> To: serusers@lists.iptel.org<BR>>> Sent: Tuesday, April 05, 2005 01:23 PM<BR>>> Subject: [Serusers] Contact Header and SDP not rewritten<BR>>> <BR>>>> Hello,<BR>>>> <BR>>>> I have a problem whereby when a private client rings a public client<BR>>>> only the public user can hear voice and when the public user rings<BR>>>> the private user, no audio is transmitted. After looking at the<BR>>>> messages I have have determined that the contact header and sdp part<BR>>>> of the invite contains the private address of the natted client.<BR>>>> This would lead me to believe that the registration process is<BR>>>> incorrect. My problem is that I believe my script should handle the<BR>>>> registration process correctly and I suspect
that the following<BR>>>> code is being skipped: I tried changing it to nat_uac_test("19") and<BR>>>> fix_nated_sdp("3") but that didnt help.<BR>>>>> if (nat_uac_test("3")){<BR>>>> if (method == "REGISTER" || ! search("^Record-Route:")){<BR>>>> log("Log: Someone trying to register from private<BR>>>> IP,rewriting\n"); fix_nated_contact(); #Rewrite contact with<BR>>>> source IP if (method == "INVITE"){<BR>>>> fix_nated_sdp("1"); #Add direction=active to SDP<BR>>>> force_rtp_proxy();<BR>>>> };<BR>>>> force_rport(); # Add rport parameter to topmost Via<BR>>>> setflag(6); # Mark as Nated<BR>>>> };<BR>>>> };<BR>>>> <BR>>>> I have included the log message below
and my ser.cfg as an<BR>>>> attachment. Please let me know where I could be going wrong.<BR>>>> <BR>>>> Thank you,<BR>>>> Vivienne.<BR>>>>>> 2093 (private) ringing 2092 (public)<BR>>>> <BR>>>> U 84.203.148.14:5060 -> 84.203.148.146:5060<BR>>>> ! INVITE sip:2092@84.203.148.146 SIP/2.0..Via: SIP/2.0/UDP<BR>>>> 172.16.3.31;branch<BR>>>> =z9hG4bK1a48edc121f5bc1f..From: "2093"<BR>>>> <sip:2093@84.203.148.146>;tag=2dc376<BR>>>> dcd4655094..To: <sip:2092@84.203.148.146>..Contact:<BR>>>> <sip:2093@172.16.3.31>.<BR>>>> .Supported: replaces..Call-ID: 44e1ae63c476fbff@172.16.3.31..CSeq:<BR>>>> 10327 IN<BR>>>> VITE..User-Agent: Grandstream BT100 1.0.5.18..Max-Forwards:<BR>>>> 70..Allow: INVI<BR>>>> <BR>>>>
TE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..Content-Type:<BR>>>> applic<BR>>>> ation/sdp..Content-Length: 362....v=0..o=2093 8000 0 IN IP4<BR>>>> 172.16.3.31..s=<BR>>>> SIP Call..c=IN IP4 172.16.3.31..t=0 0..m=audio 500! 4 RTP/AVP 0 8<BR>>>> 4 18 2 15 9<BR>>>> 9 9..a=sendrecv..a=rtpmap:0 PCMU/8000/3..a=rtpmap:8<BR>>>> PCMA/8000/3..a=rtpmap:4<BR>>>> G723/8000/3..a=rt! pmap:18 G729/8000/3..a=rtpmap:2<BR>>>> G726-32/8000/3..a=rtpmap:<BR>>>> 15 G728/8000/3..a=rtpmap:99 iLBC/8000/3..a=fmtp:99<BR>>>> mode=20..a=rtpmap:9 G722<BR>>>> /8000/3..a=ptime:20..<BR>>>> <BR>>>> U 84.203.148.146:5060 -> 84.203.148.14:5060<BR>>>> SIP/2.0 100 trying -- your call is important to us..Via:<BR>>>> SIP/2.0/UDP 172.16<BR>>>> <BR>>>>
.3.31;branch=z9hG4bK1a48edc121f5bc1f;rport=5060;received=84.203.148.14..Fro<BR>>>> m: "2093" <sip:2093@84.203.148.146>;tag=2dc376dcd4655094..To:<BR>>>> <sip:2092@84.<BR>>>> 203.148.146>..Call-ID: 44e1ae63c476fbff@172.16.3.31..CSeq: 10327<BR>>>> INVITE..Se<BR>>>> rver: Sip EXpress router (! 0.8.14 (i386/linux))..Content-Length:<BR>>>> 0..Warning:<BR>>>> 392 84.203.148.146:5060 "Noisy feedback tells: pid=4732<BR>>>> req_src_ip=84.203<BR>>>> .148.14 req_src_port=5060 in_uri=sip:2092@84.203.148.146<BR>>>> out_uri=sip:2092@1<BR>>>> 57.190.74.151 via_cnt==1"....<BR>>>> <BR>>>> U 84.203.148.146:5060 -> 157.190.74.151:5060<BR>>>> INVITE sip:2092@157.190.74.151 SIP/2.0..Via: SIP/2.0/UDP<BR>>>> 84.203.148.146;bra<BR>>>>
nch=z9hG4bK77bc.b54ca216.0..Via: SIP/2.0/UDP<BR>>>> 172.16.3.31;rport=5060;receive<BR>>>> d=84.203.148.14;branch=z9hG4bK1a48edc121f5bc1f..From: "2093"<BR>>>> <sip:2093@84.2<BR>>>> 03.148.146>;tag=2dc376dcd4655094..To:<BR>>>> <sip:2092@84.203.148.146>..Contact: <<BR>>>> sip:2093@84.203.148.14:5060>..Supported: replaces..Call-ID:<BR>>>> 44e1ae63c476fbf<BR>>>> f@172.16.3.31..CSeq: 10327 INVITE..User-Agent: Grandstream BT100<BR>>>> 1.0.5.18..<BR>>>> Max-Forwards: 69..Allow:<BR>>>> INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SU<BR>>>> BSCRIBE..Content-Type: application/sdp..Content-Length:<BR>>>> 443....v=0..o=2093<BR>>>> 8000 0 IN IP4 172.16.3.31..s=SIP Call..c=IN IP4<BR>>>> 84.203.148.1484.203.148.146<BR>>>> ..t=0 0..m=audio
35006 RTP/AVP 0 8 4 18 2 15 99<BR>>>> 9..a=sendrecv..a=rtpmap:0 P<BR>>>> CMU/8000/3..a=rtpmap:8 PCMA/8000/3..a=rtpmap:4<BR>>>> G723/8000/3..a=rtpmap:18 G72<BR>>>> 9/8000/3..a=rtpmap:2 G726-32/8000/3..a=rtpmap:15<BR>>>> G728/8000/3..a=rtpmap:99 i<BR>>>> LBC/8000/3..a=fmtp:99 mode=20..a=rtpmap:9<BR>>>> G722/8000/3..a=ptime:20..a=direct<BR>>>> ion:active..a=oldmediaip:172.16.3.31..a=nortpproxy:yes..<BR>>>> <BR>>>> U 84.203.148.146:5060 -> 157.190.74.150:5060<BR>>>> INVITE sip:2092@157.190.74.150 SIP/2.0..Via: SIP/2.0/UDP<BR>>>> 84.203.148.146;bra<BR>>>> nch=z9hG4bK77bc.b54ca216.1..Via: SIP/2.0/UDP<BR>>>> 172.16.3.31;rport=5060;receive<BR>>>> d=84.203.148.14;branch=z9hG4bK1a48edc121f5bc1f..From: "2093"<BR>>>> <sip:2093@84.2<BR>>>>
03.148.146>;tag=2dc376dcd4655094..To:<BR>>>> <sip:2092@84.203.148.146>..Contact: <<BR>>>> sip:2093@84.203.148.14:5060>..Supported: replaces..Call-ID:<BR>>>> 44e1ae63c476fbf<BR>>>> f@172.16.3.31..CSeq: 10327 INVITE..User-Agent: Grandstream BT100<BR>>>> 1.0.5.18..<BR>>>> Max-Forwards: 69..Allow:<BR>>>> INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SU<BR>>>> BSCRIBE..Content-Type: application/sdp..Content-Length:<BR>>>> 443....v=0..o=2093<BR>>>> 8000 0 IN IP4 172.16.3.31..s=SIP Call..c=IN IP4<BR>>>> 84.203.148.1484.203.148.146<BR>>>> ..t=0 0..m=audio 35006 RTP/AVP 0 8 4 18 2 15 99<BR>>>> 9..a=sendrecv..a=rtpmap:0 P<BR>>>> CMU/8000/3..a=rtpmap:8 PCMA/8000/3..a=rtpmap:4<BR>>>> G723/8000/3..a=rtpmap:18 G72<BR>>>> 9/8000/3..a=rtpmap:2
G726-32/8000/3..a=rtpmap:15<BR>>>> G728/8000/3..a=rtpmap:99 i<BR>>>> LBC/8000/3..a=fmtp:99 mode=20..a=rtpmap:9<BR>>>> G722/8000/3..a=ptime:20..a=direct<BR>>>> ion:active..a=oldmediaip:172.16.3.31..a=nortpproxy:yes..<BR>>>> <BR>>>> U 157.190.74.151:5060 -> 84.203.148.146:5060<BR>>>> SIP/2.0 100 Trying..Via: SIP/2.0/UDP<BR>>>> 84.203.148.146;branch=z9hG4bK77bc.b54c<BR>>>> a216.0..Via: SIP/2.0/UDP<BR>>>> 172.16.3.31;rport=5060;received=84.203.148.14;bran<BR>>>> ch=z9hG4bK1a48edc121f5bc1f..From: "2093"<BR>>>> <sip:2093@84.203.148.146>;tag=2dc3<BR>>>> 76dcd4655094..To: <sip:2092@84.203.148.146>..Call-ID:<BR>>>> 44e1ae63c476fbff@172.<BR>>>> 16.3.31..CSeq: 10327 INVITE..User-Agent: Grandstream BT100<BR>>>> 1.0.5.18..Conten<BR>>>>
t-Length: 0....<BR>>>> <BR>>>> U 157.190.74.151:5060 -> 84.203.148.146:5060<BR>>>> SIP/2.0 180 Ringing! ..Via: SIP/2.0/UDP<BR>>>> 84.203.148.146;branch=z9hG4bK77bc.b54<BR>>>> ca216.0..Via: SIP/2.0/UDP<BR>>>> 172.16.3.31;rport=5060;received=84.203.148.14;bra<BR>>>> nch=z9hG4bK1a48edc121f5bc1f..From: "2093"<BR>>>> <sip:2093@84.203.148.146>;tag=2dc<BR>>>> 376dcd4655094..To:<BR>>>> <sip:2092@84.203.148.146>;tag=10bdf2044401a257..Call-ID:<BR>>>> 44e1ae63c476fbff@172.16.3.31..CSeq: 10327 INVITE..User-Agent:<BR>>>> Grandstream<BR>>>> BT100 1.0.5.18..Content-Length: 0....<BR>>>> <BR>>>> Send instant messages to your online friends<BR>>>> http://uk.messenger.yahoo.com<BR>>>> <BR>>>> <BR>>>> <BR>>>> #<BR>>>> # $Id:
ser.cfg,v 1.21.4.1 2003/11/10 15:35:15 andrei Exp $<BR>>>> #<BR>>>> # simple quick-start config script<BR>>>> #<BR>>>> <BR>>>> # ----------- global configuration parameters<BR>>>> ------------------------<BR>>>> <BR>>>> #debug=3 # deb! ug level (cmd line: -dddddddddd)<BR>>>> #fork=yes<BR>>>> #log_stderror=no # (cmd line: -E)<BR>>>> <BR>>>> /* Uncomment these lines to enter debugging mode<BR>>>> debug=7<BR>>>> fork=no<BR>>>> log_stderror=yes<BR>>>> */<BR>>>> <BR>>>> 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>>>>
<BR>>>> alias="157.190.74.152:5060"<BR>>>> <BR>>>> # ------------------ module loading<BR>>>> ----------------------------------<BR>>>> <BR>>>> # Uncomment this if you want to use SQL database<BR>>>> loadmodule "/usr/lib/ser/modules/mysql.so"<BR>>>> <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"<BR>>>> loadmodule "/usr/lib/ser/modules/registrar.so"<BR>>>> loadmodule "/usr/lib/ser/modules/textops.so"<BR>>>> loadmodule "/usr/lib/ser/modules/nathelper.so"<BR>>>> #loadmodule "/usr/lib/ser/modules/pa.so"<BR>>>> loadmodule "/usr/lib/ser/modules/cpl-c.so"<BR>>>> <BR>>>> # 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"<BR>>>> <BR>>>> # ----------------- setting module-specific parameters<BR>>>> ---------------<BR>>>> <BR>>>> # -- usrloc params --<BR>>>> <BR>>>> #modparam("usrloc", "db_mode", 0)<BR>>>> <BR>>>> # Uncomment this if you want to use SQL database<BR>>>> # for persistent storage and comment the previous line<BR>>>> modparam("usrloc", "db_mode", 2)<BR>>>> <BR>>>> # -- 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<BR>>>> config),<BR>>>> # uncomment also the following
parameter)<BR>>>> #<BR>>>> modparam("auth_db", "password_column", "password")<BR>>>> <BR>>>> # -- rr params --<BR>>>> # add value to ;lr param to make some broken UAs happy<BR>>>> #NB Had to up this value from 1 to 11 because reinvites were<BR>>>> bombarding called phone<BR>>>> modparam("rr", "enable_full_lr", 11)<BR>>>> <BR>>>> #!! Nathelper<BR>>>> modparam("registrar", "nat_flag", 60)<BR>>>> modparam("nathelper", "natping_interval", 30) #Ping interval 30 s<BR>>>> modparam("nathelper", "ping_nated_only", 1) #Ping only clients<BR>>>> behind NAT<BR>>>> modparam("nathelper", "rtpproxy_sock", "/var/run/rtpproxy.sock")<BR>>>> <BR>>>> modparam("tm", "fr_inv_timer", 20)<BR>>>> <BR>>>> #modparam("pa", "default_expires", 3600)<BR>>>> <BR>>>> modparam("usrloc", "db_url",
"sql://root:1alfa156@localhost/ser")<BR>>>> <BR>>>> #modparam("cpl-c", "cpl_db", "mysql://root:1alfa156@localhost/ser")<BR>>>> #modparam("cpl-c", "cpl_table", "cpl")<BR>>>> #modparam("cpl-c", "cpl_dtd_file",<BR>>>> "/work/sip_router/modules/cpl-ccpl-06.dtd")<BR>>>> <BR>>>> # ------------------------- request routing logic<BR>>>> -------------------<BR>>>> <BR>>>> # main routing logic<BR>>>> <BR>>>> route{<BR>>>> <BR>>>> # 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>>>> };<BR>>>> <BR>>>>
#######################################################################################<BR>>>> if (nat_uac_test("3")){<BR>>>> if (method == "REGISTER" || ! search("^Record-Route:")){<BR>>>> log("Log: So! meone trying to register from private<BR>>>> IP,rewriting\n"); fix_nated_contact(); #Rewrite contact with source<BR>>>> IP <BR>>>> if (method == "INVITE"){<BR>>>> fix_nated_sdp("1"); #Add direction=active to SDP<BR>>>> force_rtp_proxy();<BR>>>> };<BR>>>> force_rport(); # Add rport parameter to topmost Via<BR>>>> setflag(6); # Mark as Nated<BR>>>> };<BR>>>> };<BR>>>> ########################################################################################<BR>>>> <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>>> &g! t;<BR>>>> if (method =="REGISTER") record_route();<BR>>>> <BR>>>> # loose-route processing<BR>>>> if (loose_route()) {<BR>>>> #commented 11/02/05<BR>>>> #t_relay();<BR>>>> route(1);<BR>>>> break;<BR>>>> };<BR>>>> <BR>>>> # 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) {<BR>>>> <BR>>>> log(1,"into loop");<BR>>>> if (method=="REGISTER") {<BR>>>> <BR>>>> # Uncomment this if you want to use digest authentication<BR>>>> # if (!www_authorize("157.190.74.152", "subscriber")) {<BR>>>> # www_challenge("157.190.74.152", "0");<BR>>>> # break;<BR>>>> #
};<BR>>>> <BR>>>> #cpl_process_register();<BR>>>> <BR>>>> save("location");<BR>>>> break;<BR>>>> };<BR>>>> <BR>>>> # if (method=="SUBSCRIBE")<BR>>> &g! t; # {<BR>>>> # log(1, "Subscribe\n");<BR>>>> # if(t_newtran())<BR>>>> # {<BR>>>> # log(1, "Registrar\n");<BR>>>> # handle_subscription("registrar");<BR>>>> # };<BR>>>> # break;<BR>>>> # };<BR>>>> <BR>>>> lookup("aliases");<BR>>>> if (!uri==myself) {<BR>>>> append_hf("P-hint: outbound alias\r\n");<BR>>>> route(1);<BR>>>> break;<BR>>>> };<BR>>>> <BR>>>> if (method=="INVITE"){<BR>>>> <BR>>>> log(1,"in ! invite loop");<BR>>>> #break; #no 100 trying<BR>>>> #if (!cpl_run_script("incoming","is_stateless"))<BR>>>> #{<BR>>>> # #script execution
failed<BR>>>> # t_reply("500", "CPL script execution failed");<BR>>>> #};<BR>>>> <BR>>>> t_on_failure("1");<BR>>>> };<BR>>>> <BR>>>> # native SIP destinations are handled using our USRLOC DB<BR>>>> if (!lookup("location")) {<BR>>>> #sl_send_reply("404", "Not Found");<BR>>>> route(2);<BR>>>> break;<BR>>>> };<BR>>>> };<BR>>>> <BR>>>> # forward to current uri now; use stateful forwarding; that<BR>>>> # works reliably even if we forward from TCP to UDP<BR>>>> #commented 11/02/05#######################<BR>>>> if (!t_relay()) {<BR>>>> sl_reply_error();<BR>>>> };<BR>>>> <BR>>>> #route(1);<BR>>>> }<BR>>>> <BR>>>> ######################################entered<BR>>>> 11/02/05############################################################<BR>>>>
route[1]<BR>>>> {<BR>>>> #!!Nathelper<BR>>>> if(uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" &&<BR>>>> !search("^Route:")){<BR>>>> sl_send_reply("479", "We don't forward to private IP addresses");<BR>>>> break;<BR>>>> };<BR>>>> <BR>>>> if (isflagset(6)){<BR>>>> force_rtp_proxy();<BR>>>> }<BR>>>> <BR>>>> t_on_reply("1");<BR>>>> <BR>>>> if(!t_relay()){<BR>>>> sl_reply_error();<BR>>>> break;<BR>>>> };<BR>>>> <BR>>>> }<BR>>>> <BR>>>> ######################################entered<BR>>>> 11/02/05############################################################<BR>>>> #!! Nathelper<BR>>>> onreply_route[1] {<BR>>>> if(isflagset(6) && status =~ "(183)|2[0-9][0-9]"){<BR>>>> fix_nated_contact();<BR>>>>
force_rtp_proxy();<BR>>>> }else if (nat_uac_test("1")){<BR>>>> fix_nated_contact();<BR>>>> };<BR>>>> }<BR>>>> #################################################################################################################<BR>>>> <BR>>>> # ------------- handling of unavai! lable user ------------------<BR>>>> route[2] {<BR>>>> <BR>>>> # non-Voip -- just send "off-line"<BR>>>> if (!(method == "INVITE" ! || method == "ACK" || method ==<BR>>>> "CANCEL")) {<BR>>>> sl_send_reply("404", "Not Found");<BR>>>> break;<BR>>>>
};<BR>>>> <BR>>>> # forward to voicemail now<BR>>>> rewritehostport("157.190.74.152:5062");<BR>>>> t_relay_to_udp("157.190.74.152", "5062");<BR>>>> }<BR>>>> <BR>>>> # if forwarding downstream did not succeed, try voicemail running<BR>>>> # at 172.16.2.120:5062<BR>>>> <BR>>>> failure_route[1] {<BR>>>> revert_uri();<BR>>>> rewritehostport("157.190.74.152:5062");<BR>>>> append_branch();<BR>>>> t_relay_to_udp("157.190.74.152", "5062");<BR>>>> }<BR>>>> <BR>>>> <BR>>>> <BR>>>>
<BR>>>> <BR>>>> _______________________________________________<BR>>>> Serusers mailing list<BR>>>> serusers@lists.iptel.org<BR>>>> http://lists.iptel.org/mailman/listinfo/serusers<BR>>> Send instant messages to your online friends<BR>>> http://uk.messenger.yahoo.com<BR>> Send instant messages to your online friends<BR>> http://uk.messenger.yahoo.com </DIV></BLOCKQUOTE><p>Send instant messages to your online friends http://uk.messenger.yahoo.com