<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word" xmlns:st1 =
"urn:schemas-microsoft-com:office:smarttags"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1491" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><o:SmartTagType name="place"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><o:SmartTagType
name="PersonName"
namespaceuri="urn:schemas-microsoft-com:office:smarttags"></o:SmartTagType><!--[if !mso]>
<STYLE>
st1\:*{behavior:url(#default#ieooui) }
</STYLE>
<![endif]-->
<STYLE>
<!--
/* Font Definitions */
@font-face
        {font-family:PMingLiU;
        panose-1:2 1 6 1 0 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@PMingLiU";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:PMingLiU;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</STYLE>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue bgColor=white>
<DIV>Hi,</DIV>
<DIV> </DIV>
<DIV>In fact, my PSTN GW does not support STUN. If it support STUN, then I
will not use rtpproxy.</DIV>
<DIV> </DIV>
<DIV>The following problem happens:</DIV>
<DIV>I try to use a fix IP for PSTN GW to register with SER, if I don't
enable rtpproxy, only ringing tones could be heard, but no voice passing through
it. Why does this happen?</DIV>
<DIV> </DIV>
<DIV>Another question is that where could I download and install ngrep? If I use
a capture program to capture all packets, could I replace ngrep with
it?</DIV>
<DIV> </DIV>
<DIV>Thank you for the advice.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Best Regards,</DIV>
<DIV> </DIV>
<DIV>Thomas</DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt 新細明體">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt 新細明體; font-color: black"><B>From:</B>
<A title=vitaly@voipsonic.com href="mailto:vitaly@voipsonic.com">Vitaly
Nikolaev</A> </DIV>
<DIV style="FONT: 10pt 新細明體"><B>To:</B> <A title=support@cybertel.biz
href="mailto:support@cybertel.biz">'support'</A> ; <A title=serusers@lists.iptel.org
href="mailto:serusers@lists.iptel.org">serusers@lists.iptel.org</A> </DIV>
<DIV style="FONT: 10pt 新細明體"><B>Sent:</B> Thursday, January 03, 2002 3:37
AM</DIV>
<DIV style="FONT: 10pt 新細明體"><B>Subject:</B> RE: [Serusers] ser + rtpproxy -
call disconnected</DIV>
<DIV><BR></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Even if half of all
RTP packets get lost you will just have bad quality of
call.<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">In your case it very
looks like you have problem with ACK<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">DO ngrep and see if
PSTN GW receive ACK packet after OK (otherwise GW will repeat OK few times and
then disconnect call) if it is an issue just do search in this list with
keyword ACK<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><FONT
face=PMingLiU size=3><SPAN style="FONT-SIZE: 12pt">
<HR tabIndex=-1 align=center width="100%" SIZE=2>
</SPAN></FONT></DIV>
<P class=MsoNormal><B><FONT face=Tahoma size=2><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT
face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> <A
href="mailto:serusers-bounces@iptel.org">serusers-bounces@lists.iptel.org</A>
[mailto:serusers-bounces@lists.iptel.org] <B><SPAN style="FONT-WEIGHT: bold">On
Behalf Of </SPAN></B>support<BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Saturday, February 26, 2005 12:24
AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B>
serusers@lists.iptel.org<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B>
[Serusers] ser + rtpproxy - call
disconnected</SPAN></FONT><o:p></o:p></P></DIV>
<P class=MsoNormal><FONT face=PMingLiU size=3><SPAN
style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">Hi,</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> </SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">When I try to make a
call using rtpproxy and ser-0.8.14 (SIP UA <---> PSTN), most of the time
the call will be disconnected within 1 minutes. Sometimes, it will be so
unstable that the call be disconnected after 15 seconds. The above scenarios
happens</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> </SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">Will this problem
related to unstable rtpproxy? Because I know that all packets will route
through the server. once rtp packet get loss, the call will be disconnected.
Is this correct?</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> </SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">Perhaps it depends on
my ser.cfg.</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> </SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> </SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">Thomas</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> </SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> </SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">My
ser.cfg:</SPAN></FONT><o:p></o:p></P></DIV>
<DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">#<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>#<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># ----------- global
configuration parameters
------------------------<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">debug=3
# debug level (cmd line: -dddddddddd)<BR>fork=yes<BR>log_stderror=no #
(cmd line: -E)<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">check_via=no #
(cmd. line:
-v)<BR>dns=no #
(cmd. line: -r)<BR>rev_dns=no # (cmd. line:
-R)<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">listen=""<BR>port=5060<BR>children=4<BR>fifo_mode=0666<BR>fifo="/tmp/ser_fifo"<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># ------------------
module loading
----------------------------------<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">loadmodule
"/usr/local/lib/ser/modules/mysql.so"<BR>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/auth.so"<BR>loadmodule
"/usr/local/lib/ser/modules/auth_db.so"<BR>loadmodule
"/usr/local/lib/ser/modules/nathelper.so"<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># -----------------
setting module-specific parameters
---------------<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># -- usrloc params
--<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># Uncomment this if
you want to use SQL database <BR># for persistent storage and comment the
previous line<BR>modparam("usrloc", "db_mode",
2)<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># -- 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")<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># -- rr params --<BR>#
add value to ;lr param to make some broken UAs happy<BR>modparam("rr",
"enable_full_lr", 1)<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># -- Nathelper params
--<BR>modparam("registrar", "nat_flag", 6)<BR>modparam("nathelper",
"natping_interval", 30) # <st1:place w:st="on">Ping</st1:place>
interval<BR>modparam("nathelper", "ping_nated_only", 1) # <st1:place
w:st="on">Ping</st1:place> only clients behind
NAT<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">#
------------------------- request routing logic
-------------------<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># main routing
logic<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">route{<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">#
-----------------------------------------------<BR># Sanity Check Section<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> };<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">#
-----------------------------------------------<BR># NOTIFY Keep-Alive
Section<BR># -----------------------------------------------<BR> if
((method=="NOTIFY") && search("^Event: keep-alive"))
{<BR>
sl_send_reply("200","OK");<BR>
break;<BR>
};<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> #
Nathelper<BR> if (nat_uac_test("3")) {<BR> # Allow RR-ed
requests, as these may indicate that<BR> # a NAT-enabled proxy
takes care of it; unless it is<BR> # a
REGISTER<BR> <BR> if (method == "REGISTER" || !
search("^Record-Route:")) {<BR>
fix_nated_contact(); # Rewrite contact with source IP of
signalling<BR> if (method == "INVITE")
{<BR>
fix_nated_sdp("1"); # Add direction=active to
SDP<BR> };<BR>
force_rport(); # Add rport parameter to topmost
Via<BR> setflag(6); # Mark as
NATed<BR> };<BR> };<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> # 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(); <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> # 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> };<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> if
(!uri==myself) {<BR> # mark routing logic in
request<BR> append_hf("P-hint: outbound\r\n");
<BR> route(1);<BR> break;<BR> };<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> # 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) {<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> if
(method=="REGISTER") {<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># Uncomment this if
you want to use digest authentication<BR> if
(!www_authorize("", "subscriber"))
{<BR> www_challenge("",
"0");<BR> break;<BR> };<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> save("location");<BR> break;<BR> };<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> # if the
dialed number lies in the range 35891500-35891799, don't forward it to T1
Trunk GW <BR> if ((uri=~"^sip:(852|)358915[0-9][0-9]@") ||
(uri=~"^sip:(852|)358916[0-9][0-9]@") ||
(uri=~"^sip:(852|)358917[0-9][0-9]@")) {<BR> if
(uri=~"^sip:852*")
{<BR> strip(3);<BR> };<BR> };<BR> <BR> lookup("aliases");<BR> <BR> if
(!uri==myself) {<BR> append_hf("P-hint: outbound alias\r\n");
<BR> route(1);<BR> break;<BR> };<BR> <BR> #
native SIP destinations are handled using our USRLOC <st1:PersonName
w:st="on">DB</st1:PersonName><BR> # Call Routing
Section<BR> if (!lookup("location")) {<BR> if
(uri=~"^sip:(852|)[0-9]{8}@") {<BR> # Send to PSTN
Gateway<BR> route(2);<BR> break;<BR> };<BR> sl_send_reply("404",
"User Not
Found");<BR> break;<BR> };<BR> };<BR> append_hf("P-hint:
usrloc applied\r\n");<BR> route(1);<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">}<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">route[1]
<BR>{<BR> # Nathelper<BR> if
(uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" &&
!search("^Route:")){<BR> sl_send_reply("479", "We
don't forward to private IP addresses");<BR>
break;<BR>
};<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> # if client or
server know to be behind a NAT, enable relay<BR> if (isflagset(6))
{<BR>
force_rtp_proxy();<BR> };<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> # NAT processing
of replies; apply to all transactions (for example,<BR> # re-INVITEs from
public to private UA are hard to identify as<BR> # NATed at the moment of
request processing); look at
replies<BR> t_on_reply("1");<BR> <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> break;<BR> };<BR>}<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># PSTN Call to T1
Trunk GW<BR>route[2] {<BR> rewritehostport("");<BR> if
(isflagset(6)) {<BR> force_rtp_proxy();<BR> };
<BR> t_on_reply("1");<BR> if (!t_relay())
{<BR> sl_reply_error();<BR> break;<BR> };<BR>}<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"># !!
Nathelper<BR>onreply_route[1] {<BR> # NATed transaction
?<BR> if (isflagset(6) && status =~
"(183)|2[0-9][0-9]") {<BR>
fix_nated_contact();<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> <o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'"> # Not all 2xx
messages have a content body so here we make sure<BR> # out
Content-Length > 0 to avoid a parse error<BR> if
(!search("^Content-Length:\0"))
{<BR> force_rtp_proxy();<BR>
};<BR> # otherwise, is it a transaction behind a NAT and we
did not<BR> # know at time of request processing ? (RFC1918
contacts)<BR> } else if (nat_uac_test("1"))
{<BR>
fix_nated_contact();<BR>
};<BR>}<o:p></o:p></SPAN></FONT></P></DIV>
<DIV>
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'">---------end of config
-----------<o:p></o:p></SPAN></FONT></P></DIV></DIV></DIV></BLOCKQUOTE></BODY></HTML>