<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2604" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2>Ok I found the problem, i wasn;t including the module 
group.so, thats why i receievd the below error.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2>This is my issue now:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2>budgetone with stun server set as fwd's , this phone works 
fine</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2>All others behind nat are broken, cant even dial to the 
asterisk system.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2>If I use a live ip on a phone it works 
phone.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2>All i want to do is allow nat users to receive calls, i 
seem to be heading round in circles.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2>My personal config allowed for nat users to call the 
asterisk pabx &amp; live ip phones, now the cfg </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2>from onsip allows only calls between live ip 
users.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2>When trying to call from my cisco 7940 which is behind nat 
i receive this via ngrep:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2>U 202.150.105.150:5060 -&gt; 203.167.185.23:50268<BR>&nbsp; 
SIP/2.0 401 Unauthorized..Via: SIP/2.0/UDP 
10.23.19.154:5060;branch=z9hG4bK3ab93baf;rport=50268;received=203.167.185.23.<BR>&nbsp; 
.From: sip:64273040757@voip.fast.co.nz..To: 
sip:64273040757@voip.fast.co.nz;tag=18deaabfa18843cd727e04c65fce5192.da71..C<BR>&nbsp; 
all-ID: <A 
href="mailto:0011219c-48830002-1e661ee5-7150bc32@10.23.19.154..CSeq">0011219c-48830002-1e661ee5-7150bc32@10.23.19.154..CSeq</A>: 
106 REGISTER..WWW-Authenticate: Digest realm="voip.fast.<BR>&nbsp; co.nz", 
nonce="4258b6d3ce0fecbbc523351ad0735ad555100a30"..Server: Sip EXpress router 
(0.9.1 (i386/freebsd))..Content-Len<BR>&nbsp; gth: 0..Warning: 392 
202.150.105.150:5060 "Noisy feedback tells:&nbsp; pid=5699 
req_src_ip=203.167.185.23 req_src_port=50268<BR>&nbsp; 
in_uri=sip:voip.fast.co.nz out_uri=sip:voip.fast.co.nz via_cnt==1"....<BR>#<BR>U 
202.150.105.150:5060 -&gt; 203.167.185.23:5060<BR>&nbsp; SIP/2.0 200 OK..Via: 
SIP/2.0/UDP 
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Route: 
&lt;sip:20<BR>&nbsp; 
2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on&gt;..From: "Barry 
Murphy" &lt;sip:64273040757@voip.fast.co.nz&gt;;tag=<BR>&nbsp; 
0011219c488300030377e0ea-4b9af92f..To: 
&lt;sip:04@voip.fast.co.nz&gt;;tag=as77998ba9..Call-ID: 
0011219c-48830005-00bda4e9-5f27<BR>&nbsp; <A 
href="mailto:bdc3@10.23.19.154..CSeq">bdc3@10.23.19.154..CSeq</A>: 101 
INVITE..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, 
REFER..Contact:<BR>&nbsp;&nbsp; 
&lt;sip:04@202.150.105.150:5070&gt;..Content-Type: 
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 
202<BR>&nbsp; .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 
19330 RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10<BR>&nbsp; 1 
telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..<BR>#<BR>U 
203.167.185.23:50268 -&gt; 202.150.105.150:5060<BR>&nbsp; INVITE 
sip:04@voip.fast.co.nz SIP/2.0..Via: SIP/2.0/UDP 
10.23.19.154:5060;branch=z9hG4bK0d4fa640..From: "Barry Murphy" &lt;<BR>&nbsp; 
sip:64273040757@voip.fast.co.nz&gt;;tag=0011219c488300030377e0ea-4b9af92f..To: 
&lt;sip:04@voip.fast.co.nz&gt;..Call-ID: 0011219c-<BR>&nbsp; <A 
href="mailto:48830005-00bda4e9-5f27bdc3@10.23.19.154..Date">48830005-00bda4e9-5f27bdc3@10.23.19.154..Date</A>: 
Sun, 10 Apr 2005 05:12:06 GMT..CSeq: 101 INVITE..User-Agent: 
CSCO/7..Cont<BR>&nbsp; act: &lt;sip:64273040757@10.23.19.154:5060&gt;..Expires: 
180..Content-Type: application/sdp..Content-Length: 247..Accept: appl<BR>&nbsp; 
ication/sdp....v=0..o=Cisco-SIPUA 26488 12465 IN IP4 10.23.19.154..s=SIP 
Call..c=IN IP4 10.23.19.154..t=0 0..m=audio 235<BR>&nbsp; 72 RTP/AVP 0 8 18 
101..a=rtpmap:0 PCMU/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:18 
G729/8000..a=rtpmap:101 telephone-event/8<BR>&nbsp; 000..a=fmtp:101 
0-15..<BR>#<BR>U 202.150.105.150:5060 -&gt; 203.167.185.23:5060<BR>&nbsp; 
SIP/2.0 200 OK..Via: SIP/2.0/UDP 
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Route: 
&lt;sip:20<BR>&nbsp; 
2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on&gt;..From: "Barry 
Murphy" &lt;sip:64273040757@voip.fast.co.nz&gt;;tag=<BR>&nbsp; 
0011219c488300030377e0ea-4b9af92f..To: 
&lt;sip:04@voip.fast.co.nz&gt;;tag=as77998ba9..Call-ID: 
0011219c-48830005-00bda4e9-5f27<BR>&nbsp; <A 
href="mailto:bdc3@10.23.19.154..CSeq">bdc3@10.23.19.154..CSeq</A>: 101 
INVITE..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, 
REFER..Contact:<BR>&nbsp;&nbsp; 
&lt;sip:04@202.150.105.150:5070&gt;..Content-Type: 
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 
202<BR>&nbsp; .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 
19330 RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10<BR>&nbsp; 1 
telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..<BR>#<BR>U 
202.150.105.150:5060 -&gt; 203.167.185.23:5060<BR>&nbsp; SIP/2.0 200 OK..Via: 
SIP/2.0/UDP 
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Route: 
&lt;sip:20<BR>&nbsp; 
2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on&gt;..From: "Barry 
Murphy" &lt;sip:64273040757@voip.fast.co.nz&gt;;tag=<BR>&nbsp; 
0011219c488300030377e0ea-4b9af92f..To: 
&lt;sip:04@voip.fast.co.nz&gt;;tag=as77998ba9..Call-ID: 
0011219c-48830005-00bda4e9-5f27<BR>&nbsp; <A 
href="mailto:bdc3@10.23.19.154..CSeq">bdc3@10.23.19.154..CSeq</A>: 101 
INVITE..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, 
REFER..Contact:<BR>&nbsp;&nbsp; 
&lt;sip:04@202.150.105.150:5070&gt;..Content-Type: 
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 
202<BR>&nbsp; .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 
19330 RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10<BR>&nbsp; 1 
telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..<BR>#<BR>U 
202.150.105.150:5060 -&gt; 203.167.185.23:5060<BR>&nbsp; SIP/2.0 200 OK..Via: 
SIP/2.0/UDP 
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Route: 
&lt;sip:20<BR>&nbsp; 
2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on&gt;..From: "Barry 
Murphy" &lt;sip:64273040757@voip.fast.co.nz&gt;;tag=<BR>&nbsp; 
0011219c488300030377e0ea-4b9af92f..To: 
&lt;sip:04@voip.fast.co.nz&gt;;tag=as77998ba9..Call-ID: 
0011219c-48830005-00bda4e9-5f27<BR>&nbsp; <A 
href="mailto:bdc3@10.23.19.154..CSeq">bdc3@10.23.19.154..CSeq</A>: 101 
INVITE..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, 
REFER..Contact:<BR>&nbsp;&nbsp; 
&lt;sip:04@202.150.105.150:5070&gt;..Content-Type: 
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 
202<BR>&nbsp; .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 
19330 RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10<BR>&nbsp; 1 
telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..<BR>#<BR>U 
10.23.14.16:5060 -&gt; 202.150.105.150:5060<BR>&nbsp; ..<BR>#<BR>U 
203.167.185.23:50268 -&gt; 202.150.105.150:5060<BR>&nbsp; INVITE 
sip:04@voip.fast.co.nz SIP/2.0..Via: SIP/2.0/UDP 
10.23.19.154:5060;branch=z9hG4bK0d4fa640..From: "Barry Murphy" &lt;<BR>&nbsp; 
sip:64273040757@voip.fast.co.nz&gt;;tag=0011219c488300030377e0ea-4b9af92f..To: 
&lt;sip:04@voip.fast.co.nz&gt;..Call-ID: 0011219c-<BR>&nbsp; <A 
href="mailto:48830005-00bda4e9-5f27bdc3@10.23.19.154..Date">48830005-00bda4e9-5f27bdc3@10.23.19.154..Date</A>: 
Sun, 10 Apr 2005 05:12:06 GMT..CSeq: 101 INVITE..User-Agent: 
CSCO/7..Cont<BR>&nbsp; act: &lt;sip:64273040757@10.23.19.154:5060&gt;..Expires: 
180..Content-Type: application/sdp..Content-Length: 247..Accept: appl<BR>&nbsp; 
ication/sdp....v=0..o=Cisco-SIPUA 26488 12465 IN IP4 10.23.19.154..s=SIP 
Call..c=IN IP4 10.23.19.154..t=0 0..m=audio 235<BR>&nbsp; 72 RTP/AVP 0 8 18 
101..a=rtpmap:0 PCMU/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:18 
G729/8000..a=rtpmap:101 telephone-event/8<BR>&nbsp; 000..a=fmtp:101 
0-15..<BR>#<BR>U 202.150.105.150:5060 -&gt; 203.167.185.23:5060<BR>&nbsp; 
SIP/2.0 200 OK..Via: SIP/2.0/UDP 
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Route: 
&lt;sip:20<BR>&nbsp; 
2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on&gt;..From: "Barry 
Murphy" &lt;sip:64273040757@voip.fast.co.nz&gt;;tag=<BR>&nbsp; 
0011219c488300030377e0ea-4b9af92f..To: 
&lt;sip:04@voip.fast.co.nz&gt;;tag=as77998ba9..Call-ID: 
0011219c-48830005-00bda4e9-5f27<BR>&nbsp; <A 
href="mailto:bdc3@10.23.19.154..CSeq">bdc3@10.23.19.154..CSeq</A>: 101 
INVITE..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, 
REFER..Contact:<BR>&nbsp;&nbsp; 
&lt;sip:04@202.150.105.150:5070&gt;..Content-Type: 
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 
202<BR>&nbsp; .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 
19330 RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10<BR>&nbsp; 1 
telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..<BR>#<BR>U 
202.150.105.150:5060 -&gt; 203.167.185.23:5060<BR>&nbsp; SIP/2.0 200 OK..Via: 
SIP/2.0/UDP 
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Route: 
&lt;sip:20<BR>&nbsp; 
2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on&gt;..From: "Barry 
Murphy" &lt;sip:64273040757@voip.fast.co.nz&gt;;tag=<BR>&nbsp; 
0011219c488300030377e0ea-4b9af92f..To: 
&lt;sip:04@voip.fast.co.nz&gt;;tag=as77998ba9..Call-ID: 
0011219c-48830005-00bda4e9-5f27<BR>&nbsp; <A 
href="mailto:bdc3@10.23.19.154..CSeq">bdc3@10.23.19.154..CSeq</A>: 101 
INVITE..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, 
REFER..Contact:<BR>&nbsp;&nbsp; 
&lt;sip:04@202.150.105.150:5070&gt;..Content-Type: 
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 
202<BR>&nbsp; .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 
19330 RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10<BR>&nbsp; 1 
telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - 
-..<BR>^Cexit<BR>608 received, 0 dropped<BR></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=755340805-10042005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV><BR>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> serusers-bounces@lists.iptel.org 
  [mailto:serusers-bounces@lists.iptel.org] <B>On Behalf Of </B>Barry 
  Murphy<BR><B>Sent:</B> Sunday, 10 April 2005 4:50 p.m.<BR><B>To:</B> 'Java 
  Rockx'<BR><B>Cc:</B> serusers@lists.iptel.org<BR><B>Subject:</B> RE: [Serusers] Nat 
  incoming call<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>Ok, so ser worked for a few minutes 
  in the following way:</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>Me on live IP calling a nat user, 
  their phone would ring, however me the A party got no ring, after 20 seconds I 
  received NU tone.<BR>NAT user is able to call me with no problem.<BR>Then 
  things just died and now when I run ser I get the following:</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><A 
  href="mailto:ser@max:/home/icepick$">ser@max:/home/icepick$</A> ser 
  -Edddddd<BR>&nbsp;0(5134) read 244542925 from /dev/urandom<BR>&nbsp;0(5134) 
  seeding PRNG with 1357656199<BR>&nbsp;0(5134) test random number 
  985922484<BR>ERROR: bad config file (1 errors)</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>ser.cfg (as per onsip.org, exact 
  copy of the rtpproxy.cfg with 2 additional fields for linking 
  asterisk)</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff 
  size=2>debug=3<BR>fork=yes<BR>log_stderror=no<BR>dns=no<BR>rev_dns=no<BR>fifo="/home/ser/ser_fifo"<BR>fifo_db_url="mysql://asterisk:4ster1skrawk5@localhost/ser"</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>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/auth.so"<BR>loadmodule 
  "/usr/local/lib/ser/modules/auth_db.so"<BR>loadmodule 
  "/usr/local/lib/ser/modules/nathelper.so"<BR>loadmodule 
  "/usr/local/lib/ser/modules/textops.so"<BR>loadmodule 
  "/usr/local/lib/ser/modules/uri_db.so"<BR>loadmodule 
  "/usr/local/lib/ser/modules/uri.so"<BR>loadmodule 
  "/usr/local/lib/ser/modules/domain.so"<BR>loadmodule 
  "/usr/local/lib/ser/modules/acc.so"</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff 
  size=2>modparam("acc|auth_db|usrloc|uri_db", "db_url", 
  "mysql://ser:ser@localhost/ser")</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>modparam("auth_db", 
  "calculate_ha1", 1)<BR>modparam("auth_db", "password_column", 
  "password")</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>modparam("acc", "log_level", 
  2)<BR>modparam("acc", "log_flag", 1 )<BR>modparam("acc", "log_missed_flag", 
  2)<BR>modparam("acc", "log_fmt", "cdfimorstup") modparam("acc", 
  "failed_transactions", 1) modparam("acc", "report_cancels", 1) modparam("acc", 
  "db_flag", 1) modparam("acc", "db_missed_flag", 2)</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>modparam("nathelper", 
  "natping_interval", 30) <BR>modparam("nathelper", "ping_nated_only", 
  1)&nbsp;&nbsp; <BR>modparam("nathelper", "rtpproxy_sock", 
  "unix:/var/run/rtpproxy.sock")</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>modparam("usrloc", "db_mode", 
  2)</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>modparam("registrar", "nat_flag", 
  6)</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>modparam("rr", "enable_full_lr", 
  1)</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff 
  size=2>alias="voip.fast.co.nz"<BR>alias=""</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>route {</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>&nbsp;# 
  -----------------------------------------------------------------<BR>&nbsp;# 
  Sanity Check Section<BR>&nbsp;# 
  -----------------------------------------------------------------<BR>&nbsp;if 
  (!mf_process_maxfwd_header("10")) {<BR>&nbsp;&nbsp;sl_send_reply("483", "Too 
  Many Hops");<BR>&nbsp;&nbsp;break;<BR>&nbsp;};</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>&nbsp;if (msg:len &gt; max_len) 
  {<BR>&nbsp;&nbsp;sl_send_reply("513", "Message 
  Overflow");<BR>&nbsp;&nbsp;break;<BR>&nbsp;};</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>&nbsp;# 
  -----------------------------------------------------------------<BR>&nbsp;# 
  Record Route Section<BR>&nbsp;# 
  -----------------------------------------------------------------<BR>&nbsp;if 
  (method!="REGISTER") {<BR>&nbsp;&nbsp;record_route();<BR>&nbsp;};</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>&nbsp;if (method=="BYE" || 
  method=="CANCEL") {<BR>&nbsp;&nbsp;unforce_rtp_proxy();<BR>&nbsp;} 
  </FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>&nbsp;# 
  -----------------------------------------------------------------<BR>&nbsp;# 
  Loose Route Section<BR>&nbsp;# 
  -----------------------------------------------------------------<BR>&nbsp;if 
  (loose_route()) {</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff size=2>&nbsp;&nbsp;if (has_totag() 
  &amp;&amp; method=="INVITE") {<BR>&nbsp;&nbsp;&nbsp;if (nat_uac_test("19")) 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;setflag(6);<BR>&nbsp;&nbsp;&nbsp;&nbsp;force_rport();<BR>&nbsp;&nbsp;&nbsp;&nbsp;fix_nated_contact();<BR>&nbsp;&nbsp;&nbsp;};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  force_rtp_proxy("l");<BR>&nbsp;&nbsp;};<BR>&nbsp; 
  &nbsp;&nbsp;route(1);<BR>&nbsp;&nbsp;break;<BR>&nbsp;};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  # 
  -----------------------------------------------------------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  # send out 0 prefix to asterisk for IVR 
  options<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 
  -----------------------------------------------------------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;if (uri=~"^sip:0[1-9]*@voip.fast.co.nz") 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  setflag(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  rewritehostport("202.150.105.150:5070");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  log("free call");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;if 
  (!t_relay()) 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;};<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 face=Arial color=#0000ff 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 
  -----------------------------------------------------------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  # send out 00 prefix to wholesale voip.fast.co.nz 
  termination<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 
  -----------------------------------------------------------------<BR>&nbsp;if 
  (uri=~"^sip:00[0-9].*@voip.fast.co.nz") 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;if (!is_user_in("From", 
  "ld")) 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;sl_send_reply("403", "Payment 
  required");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;break;</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=Arial color=#0000ff 
  size=2>&nbsp;&nbsp;&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;setflag(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;rewritehostport("voip.fast.co.nz:5070");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;if (!t_relay()) 
  {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &nbsp;};<BR>&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><FONT face=Arial color=#0000ff size=2>
  <DIV><BR>&nbsp;# 
  -----------------------------------------------------------------<BR>&nbsp;# 
  Call Type Processing Section<BR>&nbsp;# 
  -----------------------------------------------------------------<BR>&nbsp;if 
  (uri==myself) {<BR>&nbsp;&nbsp;if (method=="INVITE") 
  {<BR>&nbsp;&nbsp;&nbsp;route(3);<BR>&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;} 
  else &nbsp;if (method=="REGISTER") 
  {<BR>&nbsp;&nbsp;&nbsp;route(2);<BR>&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;};</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;if (!lookup("location")) 
  {<BR>&nbsp;&nbsp;&nbsp;sl_send_reply("404", "User Not 
  Found");<BR>&nbsp;&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;};</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;route(1);<BR>&nbsp;};<BR>}</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>route[1] {</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;# 
  -----------------------------------------------------------------<BR>&nbsp;# 
  Default Message Handler<BR>&nbsp;# 
  -----------------------------------------------------------------</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;t_on_reply("1");</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;if (!t_relay()) {<BR>&nbsp;&nbsp;if (method=="INVITE" &amp;&amp; 
  isflagset(6)) {<BR>&nbsp;&nbsp;&nbsp; 
  unforce_rtp_proxy();<BR>&nbsp;&nbsp;};<BR>&nbsp;&nbsp;sl_reply_error();<BR>&nbsp;};<BR>}</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>route[2] {</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;# 
  -----------------------------------------------------------------<BR>&nbsp;# 
  REGISTER Message Handler<BR>&nbsp;# 
  ----------------------------------------------------------------</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;if (!search("^Contact: \*") &amp;&amp; nat_uac_test("19")) 
  {<BR>&nbsp;&nbsp;setflag(6);<BR>&nbsp;&nbsp;fix_nated_register();<BR>&nbsp;&nbsp;force_rport();<BR>&nbsp;};</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;sl_send_reply("100", "Trying");</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;if (!www_authorize("","subscriber")) 
  {<BR>&nbsp;&nbsp;www_challenge("","0");<BR>&nbsp;&nbsp;break;<BR>&nbsp;};</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;if (!check_to()) {<BR>&nbsp;&nbsp;sl_send_reply("401", 
  "Unauthorized");<BR>&nbsp;&nbsp;break;<BR>&nbsp;};</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;&nbsp;&nbsp; consume_credentials();</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;if (!save("location")) 
  {<BR>&nbsp;&nbsp;sl_reply_error();<BR>&nbsp;};<BR>}</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>route[3] {</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;# 
  -----------------------------------------------------------------<BR>&nbsp;# 
  INVITE Message Handler<BR>&nbsp;# 
  -----------------------------------------------------------------</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;if (nat_uac_test("19")) 
  {<BR>&nbsp;&nbsp;setflag(6);<BR>&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;if (!lookup("location")) {<BR>&nbsp;&nbsp;sl_send_reply("404", 
  "User Not Found");<BR>&nbsp;&nbsp;break;<BR>&nbsp;};</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;if (!proxy_authorize("voip.fast.co.nz","subscriber")) 
  {<BR>&nbsp;&nbsp;proxy_challenge("voip.fast.co.nz","0");<BR>&nbsp;&nbsp;break;<BR>&nbsp;} 
  else if (!check_from()) {<BR>&nbsp;&nbsp;sl_send_reply("403", "Use 
  From=ID");<BR>&nbsp;&nbsp;break;<BR>&nbsp;};</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;&nbsp;&nbsp; consume_credentials();</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;if (isflagset(6)) 
  {<BR>&nbsp;&nbsp;force_rport();<BR>&nbsp;&nbsp;fix_nated_contact();<BR>&nbsp;&nbsp;force_rtp_proxy();<BR>&nbsp;};</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;t_on_reply("1");</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;if (!t_relay()) {<BR>&nbsp;&nbsp;if(isflagset(6)) 
  {<BR>&nbsp;&nbsp;&nbsp;unforce_rtp_proxy();<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;sl_reply_error();<BR>&nbsp;};<BR>}</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>onreply_route[1] {</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;if (isflagset(6) &amp;&amp; status=~"(180)|(183)|2[0-9][0-9]") 
  {<BR>&nbsp; &nbsp;if (!search("^Content-Length:\ 0")) 
  {<BR>&nbsp;&nbsp;&nbsp;force_rtp_proxy();<BR>&nbsp;&nbsp;};<BR>&nbsp;} else if 
  (nat_uac_test("1")) 
  {<BR>&nbsp;&nbsp;fix_nated_contact();<BR>&nbsp;};<BR>}</DIV>
  <DIV>&nbsp;</DIV>
  <DIV></FONT>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>