No subject


Mon Jul 28 18:09:54 CEST 2008


incorrectly addressed or being blocked by the NAT configuration.

 

It might be worth - since Asterisk is in the path to relax the NAT fix-up of
Kamailio . If the purpose of having Kamailio there is as a NAT traversal
solution, then you have a couple of choices to either Deploy the RTPProxy
partner to Kamailio or leave Asterisk as the termination point of all media
- whether it is PSTN based or not. It is the latter case I guess your
currently heading towards.

 

Try adding fix_nated_contact() to your INVITE processing:

 

This is some excerpts from my INVITE processing

                if (method == "INVITE") {

                log (1, "Inside INVITE Processing\n");

                 # Basically challenge all end-points that make calls

                 # before we ship the call to gateway

                         if (!proxy_authorize("domain.com","subscriber"))  {

                                proxy_challenge("domain.com", "0");

                                break;

                                };

                # Fixed NATed SDP and contact headers


                if (nat_uac_test("3")) {

                        log(1, "Inside NATed INVITE Processing\n");

                        fix_nated_contact();

                        fix_nated_sdp("3");

                        t_on_reply("1");

                        }

                else {

                log (1, "In else of nated UAC test\n");

                t_on_reply("1");

                        };

 

                };

                log (1, "Sending call to PSTN gateway\n");

           rewritehostport("w.x.y.z:5060");

                forward(uri:host, uri:port);

                break;

                };

And my Reply Route logic.

onreply_route[1] {

 

log (1, "Inside on reply route processing\n");

                if (status =~ "(180)|(183)|2[0-9][0-9]|4[0-9][0-9]") {

                        log(1, "Inside 180|183|200|4XX Processing\n");

                        fix_nated_contact();

                        fix_nated_sdp("3");

                        break;

                };

}

 

 

Neill...;o)



Neill Wilkinson
Principal Consultant
  

Aeonvista Ltd - opening up new ideas

 


 

 

 

 

From: Ross Beer [mailto:ross_beer at hotmail.com] 
Sent: 31 July 2008 14:25
To: neill.wilkinson at btinternet.com; users at lists.kamailio.org
Subject: RE: [Kamailio-Users] NAT Problems

 

Hi Neill,
 
The outgoing audio works fine. The audio that is not passed is from PSTN ->
Phone. 
 
The Snom does have symmetrical RTP set. I did have this working about a week
ago then it stopped working!
 
How does asterisk deal with NAT, as if I connect the phone directly to
Asterisk everything works perfectly! 
 
Both Asterisk & Kamailio are on publically accessible IP addresses.
 
Thank you for your help so far.
 
Ross






  _____  


From: neill.wilkinson at btinternet.com
To: users at lists.kamailio.org
Date: Thu, 31 Jul 2008 13:32:05 +0100
Subject: Re: [Kamailio-Users] NAT Problems



Which direction is the one way audio in - from the Phone to the PSTN or
Vice-Versa - I assume audio outbound is OK and it's the audio returning to
the phone from the PSTN you're missing?

 

Do you  have symmetrical RTP set in the Line settings (under NAT) on the
SNOM?

 

Is Kamailio inside or outside the NAT?

 

Neill...;o)



Neill Wilkinson
Principal Consultant
  

Aeonvista Ltd - opening up new ideas


 

 

 

 

From: users-bounces at lists.kamailio.org
[mailto:users-bounces at lists.kamailio.org] On Behalf Of Ross Beer
Sent: 31 July 2008 12:50
To: users at lists.kamailio.org
Subject: [Kamailio-Users] NAT Problems

 

I am having problems with a NAT device. I have an asterisk server that is
hosted on a public IP and when I connect my Snom phones to it directly audio
passes correctly both ways. When I introduce Kamailio 1.3 into the mix I get
one way audio.
 
I have fixed the SDP and contacts etc and everything appears to be ok with
the sip packet. I would be very grateful for any ideas what the problem
could be.
 
Outgoing calls from Kamailio -> asterisk -> PSTN work fine.
 
Thank you for your help in advance, it is much appreciated.
 
 
=================== config =======================
 
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= 2048 ) {
sl_send_reply("513", "Message too big");
exit;
};
# NAT detection
force_rport();
if(nat_uac_test("3"))
{

fix_nated_contact();
}
if (!method=="REGISTER")
{
record_route();
}
if (loose_route()) {
append_hf("P-hint: rr-enforced\r\n"); 
route(1);
};
if (!uri==myself) {
append_hf("P-hint: outbound\r\n"); 
route(1);
};
if (uri==myself) {
if (method=="REGISTER") 
{
if (!www_authorize("", "subscriber")) {
www_challenge("", "0");
exit;
};


if (isflagset(5)) 
{
# set branch flag -- when someone will call this user
# the INVITE will have branch flag 6 set after lookup("location")
setbflag(6);
 
};

fix_nated_contact();
fix_nated_register();
consume_credentials();
save("location");
exit;
};
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
};
append_hf("P-hint: usrloc applied\r\n"); 
};

if(method=="MESSAGE")
{
if (!lookup("location"))
{
sl_send_reply("404", "User Offline");
exit;
}
route(4);
}

if (method=="REGISTER")
{
save("location");
}
 
route(1);
}
 
route[1] {
if (subst_uri('/(sip:.*);nat=yes/\1/')){
setbflag(6);
};
if (isflagset(5)||isbflagset(6)) {
route(3);
}
t_on_reply("1");
if (!t_relay()) {
sl_reply_error();
};
exit;
}
 
route[3] {
if (is_method("BYE")) 
{
unforce_rtp_proxy();
} 
else if (is_method("INVITE"))
{
fix_nated_sdp("3");
 
};
if (isflagset(5))
{
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
}
t_on_reply("1");
}
route[4]
{
if (!t_relay()) 
{
sl_reply_error();
};
exit;
}
 
 
failure_route[2] {
if (isbflagset(6) || isflagset(5)) 
{
unforce_rtp_proxy();
}
}
onreply_route[1] 
{
fix_nated_contact();
if (((isflagset(5) || isbflagset(6)) && status=~"(183)|(2[0-9][0-9])") ||
is_method("INVITE")) 
{
fix_nated_sdp("2");
force_rport();
 
}
search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');
}
 
 
 
==================== SIP PACKETS ===========================
INVITE sip:10001*202@**** IP ****;line=e25l7qyi SIP/2.0
Record-Route: <sip:*** IP ***;lr=on;ftag=as0a2e0c2e>
Via: SIP/2.0/UDP *** IP ***;branch=z9hG4bKb0a1.cf08f082.0
v: SIP/2.0/UDP *** IP ***:5060;branch=z9hG4bK2bc03835;rport=5060
f: "Name" <sip:*** DOMAIN ***>;tag=as0a2e0c2e
t: <sip:10001*202@** DOMAIN **>
m: <sip:number@**IP**>
i: 74391cce38d7c7f7549c863a651b8f81@*** DOMAIN ****
CSeq: 102 INVITE
User-Agent: asterisk
Max-Forwards: 69
Date: Thu, 31 Jul 2008 11:38:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
k: replaces
c: application/sdp
l: 422
P-hint: usrloc applied

v=0
o=root 5390 5390 IN IP4 194.xxx.xxx.xxx
s=session
c=IN IP4 194.xxx.xxx.xxx
b=CT:384
t=0 0
m=audio 12558 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
m=video 17918 RTP/AVP 34 103 99
a=rtpmap:34 H263/90000
a=rtpmap:103 h263-1998/90000
a=rtpmap:99 H264/90000
a=sendrecv

 
////////////// PHONE REPLY ////////////////////
SIP/2.0 200 Ok
Via: SIP/2.0/UDP **** IP ****:5060;branch=z9hG4bK19d7ec13;rport=5060
Record-Route: <sip:*** IP ***;lr=on;ftag=as486f79a5>
From: "*** NUMBER *****" <sip:*** DOMAIN *****>;tag=as486f79a5
To: <sip:10001*202@*** DOMAIN *****>;tag=jgdy33ee6n
Call-ID: *** ID ***
CSeq: 102 INVITE
Contact: <sip:*** DOMAIN ****:54686;line=e25l7qyi;nat=yes>;reg-id=1
User-Agent: snom370/7.3.7
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK,
MESSAGE, INFO
Allow-Events: talk, hold, refer, call-info
Supported: timer, replaces, from-change
Content-Type: application/sdp
Content-Length: 508
v=0
o=root 1569142945 1569142946 IN IP4 192.168.1.20
s=call
c=IN IP4 ** EXTERNAL IP ***
t=0 0
m=audio 10014 RTP/AVP 0 8 3 101
a=rtpmap:0 pcmu/8000
a=rtpmap:8 pcma/8000
a=rtpmap:3 gsm/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=alt:1 0.9 : user 9kksj== 192.168.1.20 10014
a=sendrecv
m=video 0 RTP/AVP 34 103 99
a=rtpmap:34 H263/90000
a=rtpmap:103 h263-1998/90000
a=rtpmap:99 H264/90000
a=alt:1 0.9 : user 9kksj== 192.168.1.20 10014
a=sendrecv
a=oldmediaip:192.168.1.20

  _____  

Find out how to make Messenger your very own TV! Try it
<http://clk.atdmt.com/UKM/go/101719648/direct/01/>  Now!

 

  _____  

Get fish-slapping on Messenger! Play Now
<http://clk.atdmt.com/UKM/go/101719805/direct/01/> 


------=_NextPart_000_00C2_01C8F31E.1D845780
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<!--[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]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
p.ecmsonormal, li.ecmsonormal, div.ecmsonormal
	{mso-style-name:ec_msonormal;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
p.ecmsoacetate, li.ecmsoacetate, div.ecmsoacetate
	{mso-style-name:ec_msoacetate;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
p.ecmsochpdefault, li.ecmsochpdefault, div.ecmsochpdefault
	{mso-style-name:ec_msochpdefault;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
span.ecmsohyperlink
	{mso-style-name:ec_msohyperlink;}
span.ecmsohyperlinkfollowed
	{mso-style-name:ec_msohyperlinkfollowed;}
span.ecemailstyle18
	{mso-style-name:ec_emailstyle18;}
span.ecballoontextchar
	{mso-style-name:ec_balloontextchar;}
p.ecmsonormal1, li.ecmsonormal1, div.ecmsonormal1
	{mso-style-name:ec_msonormal1;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
span.ecmsohyperlink1
	{mso-style-name:ec_msohyperlink1;
	color:blue;
	text-decoration:underline;}
span.ecmsohyperlinkfollowed1
	{mso-style-name:ec_msohyperlinkfollowed1;
	color:purple;
	text-decoration:underline;}
p.ecmsoacetate1, li.ecmsoacetate1, div.ecmsoacetate1
	{mso-style-name:ec_msoacetate1;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:0cm;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
span.ecemailstyle181
	{mso-style-name:ec_emailstyle181;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
span.ecballoontextchar1
	{mso-style-name:ec_balloontextchar1;
	font-family:"Tahoma","sans-serif";}
p.ecmsochpdefault1, li.ecmsochpdefault1, div.ecmsochpdefault1
	{mso-style-name:ec_msochpdefault1;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:10.0pt;
	font-family:"Times New Roman","serif";}
span.EmailStyle32
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-GB link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Ross,<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>OK &#8211; RTP to asterisk is general to the same address =
as the
SIP signalling, because technically Asterisk is a SIP B2BUA and when =
Asterisk Detects
NAT is will always put its self in the media path. You can also affect =
this by
setting in the SIP.CONF file nat=3Dyes in the peer =
settings.<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>From You description the RTP coming back towards your NAT
firewall is either incorrectly addressed or being blocked by the NAT
configuration.<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>It might be worth &#8211; since Asterisk is in the path =
to relax
the NAT fix-up of Kamailio . If the purpose of having Kamailio there is =
as a
NAT traversal solution, then you have a couple of choices to either =
Deploy the
RTPProxy partner to Kamailio or leave Asterisk as the termination point =
of all
media &#8211; whether it is PSTN based or not. It is the latter case I =
guess
your currently heading towards.<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Try adding fix_nated_contact() to your INVITE =
processing:<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>This is some excerpts from my INVITE =
processing<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (method =3D=3D &quot;INVITE&quot;) {<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
log (1, &quot;Inside INVITE Processing\n&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# Basically challenge all end-points that make =
calls<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# before we ship the call to gateway<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;
if =
(!proxy_authorize(&quot;domain.com&quot;,&quot;subscriber&quot;))&nbsp; =
{<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
proxy_challenge(&quot;domain.com&quot;, =
&quot;0&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
break;<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
};<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# Fixed NATed SDP and contact
headers&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;
<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (nat_uac_test(&quot;3&quot;)) {<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;
log(1, &quot;Inside NATed INVITE =
Processing\n&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal><b><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;
fix_nated_contact();<o:p></o:p></span></b></p>

<p class=3DMsoNormal><b><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;
fix_nated_sdp(&quot;3&quot;);<o:p></o:p></span></b></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;
t_on_reply(&quot;1&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;
}<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
else {<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;log
(1, &quot;In else of nated UAC test\n&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
t_on_reply(&quot;1&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;
};<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
};<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
log (1, &quot;Sending call to PSTN =
gateway\n&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'margin-left:36.0pt'><span =
style=3D'font-size:11.0pt;
font-family:"Courier New";color:#1F497D'>&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rewritehostport(&quot;w.x=
.y.z:5060&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;forward(uri:host,
uri:port);<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<o:p></o:p></span><=
/p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
};<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>And my Reply Route logic.<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>onreply_route[1] {<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>log (1, &quot;Inside on reply route =
processing\n&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (status =3D~ &quot;(180)|(183)|2[0-9][0-9]|4[0-9][0-9]&quot;) =
{<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;
log(1, &quot;Inside 180|183|200|4XX =
Processing\n&quot;);<o:p></o:p></span></p>

<p class=3DMsoNormal><b><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;
fix_nated_contact();<o:p></o:p></span></b></p>

<p class=3DMsoNormal><b><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;
fix_nated_sdp(&quot;3&quot;);<o:p></o:p></span></b></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;
break;<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
};<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Courier New";
color:#1F497D'>}<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Neill...;o)<o:p></o:p></span></p>

<div>

<table class=3DMsoNormalTable border=3D0 cellspacing=3D0 cellpadding=3D0 =
width=3D314
 style=3D'width:235.8pt'>
 <tr>
  <td colspan=3D2 style=3D'border:none;border-top:solid #CCCCCC =
1.0pt;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
  <table class=3DMsoNormalTable border=3D0 cellspacing=3D0 =
cellpadding=3D0 width=3D"95%"
   style=3D'width:95.0%'>
   <tr>
    <td width=3D"50%" valign=3Dtop style=3D'width:50.0%;padding:0cm 0cm =
0cm 0cm'>
    <p class=3DMsoNormal style=3D'mso-line-height-alt:9.0pt'><b><span
    =
style=3D'font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497=
D'>Neill
    Wilkinson</span></b><span =
style=3D'font-size:10.0pt;font-family:"Verdana","sans-serif";
    color:#1F497D'><br>
    Principal Consultant<br>
    &nbsp; <o:p></o:p></span></p>
    <p class=3DMsoNormal style=3D'mso-line-height-alt:9.0pt'><span
    =
style=3D'font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497=
D'>Aeonvista
    Ltd - opening up new ideas<o:p></o:p></span></p>
    <p class=3DMsoNormal style=3D'mso-line-height-alt:9.0pt'><span
    =
style=3D'font-size:10.0pt;font-family:"Verdana","sans-serif";color:#1F497=
D'>&nbsp;<o:p></o:p></span></p>
    </td>
   </tr>
  </table>
  </td>
 </tr>
 <tr>
  <td style=3D'border:none;border-top:solid #CCCCCC 1.0pt;padding:1.2pt =
0cm 0cm 0cm'>
  <p class=3DMsoNormal><span =
style=3D'font-size:6.0pt;font-family:"Arial","sans-serif";
  color:#1F497D'>&nbsp;<o:p></o:p></span></p>
  </td>
  <td style=3D'border:none;border-top:solid #CCCCCC 1.0pt;padding:1.2pt =
0cm 0cm 0cm'>
  <p class=3DMsoNormal align=3Dright style=3D'text-align:right'><span
  =
style=3D'font-size:6.0pt;font-family:"Arial","sans-serif";color:#1F497D'>=
&nbsp;<o:p></o:p></span></p>
  </td>
 </tr>
</table>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt =
0cm 0cm 0cm'>

<p class=3DMsoNormal><b><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=3DEN-US =
style=3D'font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> Ross Beer =
[mailto:ross_beer at hotmail.com] <br>
<b>Sent:</b> 31 July 2008 14:25<br>
<b>To:</b> neill.wilkinson at btinternet.com; users at lists.kamailio.org<br>
<b>Subject:</b> RE: [Kamailio-Users] NAT Problems<o:p></o:p></span></p>

</div>

</div>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><span =
style=3D'font-size:10.0pt;
font-family:"Tahoma","sans-serif";color:black'>Hi Neill,</span><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br>
&nbsp;<br>
<span style=3D'color:black'>The outgoing audio works fine. The audio =
that is not
passed is from PSTN -&gt; Phone. </span><br>
&nbsp;<br>
<span style=3D'color:black'>The Snom does have </span></span><span
style=3D'font-family:"Calibri","sans-serif";color:black'>symmetrical RTP =
set. I
did have this working about a week ago then it stopped =
working!</span><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br>
&nbsp;<br>
</span><span =
style=3D'font-family:"Calibri","sans-serif";color:black'>How does
asterisk deal with NAT, as if I connect the phone directly to Asterisk
everything works perfectly! </span><span =
style=3D'font-size:10.0pt;font-family:
"Tahoma","sans-serif"'><br>
&nbsp;<br>
</span><span =
style=3D'font-family:"Calibri","sans-serif";color:black'>Both
Asterisk &amp; Kamailio are on publically accessible IP =
addresses.</span><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br>
&nbsp;<br>
</span><span =
style=3D'font-family:"Calibri","sans-serif";color:black'>Thank you
for your help so far.</span><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br>
&nbsp;<br>
</span><span =
style=3D'font-family:"Calibri","sans-serif";color:black'>Ross</span><span=

style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br>
<br>
<br>
<br>
<br>
<o:p></o:p></span></p>

<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>

<hr size=3D2 width=3D"100%" align=3Dcenter id=3D"EC_stopSpelling">

</span></div>

<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><span =
style=3D'font-size:10.0pt;
font-family:"Tahoma","sans-serif"'><br>
From: neill.wilkinson at btinternet.com<br>
To: users at lists.kamailio.org<br>
Date: Thu, 31 Jul 2008 13:32:05 +0100<br>
Subject: Re: [Kamailio-Users] NAT Problems<br>
<br>
<o:p></o:p></span></p>

<div>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Which direction is the one way audio in &#8211; from the =
Phone
to the PSTN or Vice-Versa &#8211; I assume audio outbound is OK and =
it&#8217;s
the audio returning to the phone from the PSTN you&#8217;re =
missing?</span><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p></o:p><=
/span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;</span><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p></o:p><=
/span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Do you&nbsp; have symmetrical RTP set in the Line =
settings
(under NAT) on the SNOM?</span><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p></o:p><=
/span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;</span><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p></o:p><=
/span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Is Kamailio inside or outside the NAT?</span><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p></o:p><=
/span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;</span><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p></o:p><=
/span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Neill...;o)</span><span =
style=3D'font-size:10.0pt;font-family:
"Tahoma","sans-serif"'><o:p></o:p></span></p>

<div>

<table class=3DMsoNormalTable border=3D0 cellspacing=3D0 cellpadding=3D0 =
width=3D314
 style=3D'width:235.8pt'>
 <tr>
  <td colspan=3D2 style=3D'border:none;border-top:solid #CCCCCC =
1.0pt;padding:6.0pt 6.0pt 6.0pt 6.0pt'>
  <table class=3DMsoNormalTable border=3D0 cellspacing=3D0 =
cellpadding=3D0 width=3D"95%"
   style=3D'width:95.0%'>
   <tr>
    <td width=3D"50%" valign=3Dtop style=3D'width:50.0%;padding:0cm 0cm =
0cm 0cm'>
    <p class=3DMsoNormal><b><span =
style=3D'font-size:10.0pt;font-family:"Verdana","sans-serif";
    color:#1F497D'>Neill Wilkinson</span></b><span =
style=3D'font-size:10.0pt;
    font-family:"Verdana","sans-serif";color:#1F497D'><br>
    Principal Consultant<br>
    &nbsp; </span><o:p></o:p></p>
    <p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Verdana","sans-serif";
    color:#1F497D'>Aeonvista Ltd - opening up new =
ideas</span><o:p></o:p></p>
    </td>
   </tr>
  </table>
  </td>
 </tr>
 <tr>
  <td style=3D'border:none;border-top:solid #CCCCCC 1.0pt;padding:1.2pt =
0cm 0cm 0cm'>
  <p class=3DMsoNormal><span =
style=3D'font-size:6.0pt;font-family:"Arial","sans-serif";
  color:#1F497D'>&nbsp;</span><o:p></o:p></p>
  </td>
  <td style=3D'border:none;border-top:solid #CCCCCC 1.0pt;padding:1.2pt =
0cm 0cm 0cm'>
  <p class=3DMsoNormal align=3Dright style=3D'text-align:right'><span
  =
style=3D'font-size:6.0pt;font-family:"Arial","sans-serif";color:#1F497D'>=
&nbsp;</span><o:p></o:p></p>
  </td>
 </tr>
</table>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;</span><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p></o:p><=
/span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;</span><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p></o:p><=
/span></p>

<div>

<div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt =
0cm 0cm 0cm'>

<p class=3DMsoNormal><b><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=3DEN-US =
style=3D'font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> users-bounces at lists.kamailio.org
[mailto:users-bounces at lists.kamailio.org] <b>On Behalf Of </b>Ross =
Beer<br>
<b>Sent:</b> 31 July 2008 12:50<br>
<b>To:</b> users at lists.kamailio.org<br>
<b>Subject:</b> [Kamailio-Users] NAT Problems</span><span =
style=3D'font-size:
10.0pt;font-family:"Tahoma","sans-serif"'><o:p></o:p></span></p>

</div>

</div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>&nbsp;<o:p><=
/o:p></span></p>

<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><span =
style=3D'font-size:10.0pt;
font-family:"Tahoma","sans-serif"'>I am having problems with a NAT =
device. I
have an asterisk server that is hosted on a public&nbsp;IP and when I =
connect
my Snom phones to it directly audio passes correctly both ways. When I
introduce Kamailio 1.3 into the mix I get one way audio.<br>
&nbsp;<br>
I have fixed the SDP and contacts etc and everything appears to be ok =
with the
sip packet. I would be very grateful for any ideas what the problem =
could be.<br>
&nbsp;<br>
Outgoing calls from Kamailio&nbsp;-&gt; asterisk -&gt; PSTN work =
fine.<br>
&nbsp;<br>
Thank you for your help in advance, it is much appreciated.<br>
&nbsp;<br>
&nbsp;<br>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D config =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<br>=

&nbsp;<br>
</span><span lang=3DEN =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>if
(!mf_process_maxfwd_header(&quot;10&quot;)) {<br>
sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);<br>
exit;<br>
};<br>
if (msg:len &gt;=3D 2048 ) {<br>
sl_send_reply(&quot;513&quot;, &quot;Message too big&quot;);<br>
exit;<br>
};<br>
# NAT detection<br>
force_rport();<br>
if(nat_uac_test(&quot;3&quot;))<br>
{<br>
<br>
fix_nated_contact();<br>
}<br>
if (!method=3D=3D&quot;REGISTER&quot;)<br>
{<br>
record_route();<br>
}<br>
if (loose_route()) {<br>
append_hf(&quot;P-hint: rr-enforced\r\n&quot;); <br>
route(1);<br>
};<br>
if (!uri=3D=3Dmyself) {<br>
append_hf(&quot;P-hint: outbound\r\n&quot;); <br>
route(1);<br>
};<br>
if (uri=3D=3Dmyself) {<br>
if (method=3D=3D&quot;REGISTER&quot;) <br>
{<br>
if (!www_authorize(&quot;&quot;, &quot;subscriber&quot;)) {<br>
www_challenge(&quot;&quot;, &quot;0&quot;);<br>
exit;<br>
};<br>
<br>
<br>
if (isflagset(5)) <br>
{<br>
# set branch flag -- when someone will call this user<br>
# the INVITE will have branch flag 6 set after =
lookup(&quot;location&quot;)<br>
setbflag(6);<br>
&nbsp;<br>
};<br>
<br>
fix_nated_contact();<br>
fix_nated_register();<br>
consume_credentials();<br>
save(&quot;location&quot;);<br>
exit;<br>
};<br>
if (!lookup(&quot;location&quot;)) {<br>
sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>
exit;<br>
};<br>
append_hf(&quot;P-hint: usrloc applied\r\n&quot;); <br>
};<br>
<br>
if(method=3D=3D&quot;MESSAGE&quot;)<br>
{<br>
if (!lookup(&quot;location&quot;))<br>
{<br>
sl_send_reply(&quot;404&quot;, &quot;User Offline&quot;);<br>
exit;<br>
}<br>
route(4);<br>
}<br>
<br>
if (method=3D=3D&quot;REGISTER&quot;)<br>
{<br>
save(&quot;location&quot;);<br>
}<br>
&nbsp;<br>
route(1);<br>
}<br>
&nbsp;<br>
route[1] {<br>
if (subst_uri('/(sip:.*);nat=3Dyes/\1/')){<br>
setbflag(6);<br>
};<br>
if (isflagset(5)||isbflagset(6)) {<br>
route(3);<br>
}<br>
t_on_reply(&quot;1&quot;);<br>
if (!t_relay()) {<br>
sl_reply_error();<br>
};<br>
exit;<br>
}<br>
&nbsp;<br>
route[3] {<br>
if (is_method(&quot;BYE&quot;)) <br>
{<br>
unforce_rtp_proxy();<br>
} <br>
else if (is_method(&quot;INVITE&quot;))<br>
{<br>
fix_nated_sdp(&quot;3&quot;);<br>
&nbsp;<br>
};<br>
if (isflagset(5))<br>
{<br>
search_append('Contact:.*sip:[^&gt;[:cntrl:]]*', ';nat=3Dyes');<br>
}<br>
t_on_reply(&quot;1&quot;);<br>
}<br>
route[4]<br>
{<br>
if (!t_relay()) <br>
{<br>
sl_reply_error();<br>
};<br>
exit;<br>
}<br>
&nbsp;<br>
&nbsp;<br>
failure_route[2] {<br>
if (isbflagset(6) || isflagset(5)) <br>
{<br>
unforce_rtp_proxy();<br>
}<br>
}<br>
onreply_route[1] <br>
{<br>
fix_nated_contact();<br>
if (((isflagset(5) || isbflagset(6)) &amp;&amp;
status=3D~&quot;(183)|(2[0-9][0-9])&quot;) || =
is_method(&quot;INVITE&quot;)) <br>
{<br>
fix_nated_sdp(&quot;2&quot;);<br>
force_rport();<br>
&nbsp;<br>
}<br>
search_append('Contact:.*sip:[^&gt;[:cntrl:]]*', ';nat=3Dyes');<br>
}<br>
&nbsp;<br>
&nbsp;<br>
&nbsp;<br>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D SIP PACKETS =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<br>
INVITE sip:10001*202@**** IP ****;line=3De25l7qyi SIP/2.0<br>
Record-Route: &lt;sip:*** IP ***;lr=3Don;ftag=3Das0a2e0c2e&gt;<br>
Via: SIP/2.0/UDP *** IP ***;branch=3Dz9hG4bKb0a1.cf08f082.0<br>
v: SIP/2.0/UDP *** IP ***:5060;branch=3Dz9hG4bK2bc03835;rport=3D5060<br>
f: &quot;Name&quot; &lt;sip:*** DOMAIN ***&gt;;tag=3Das0a2e0c2e<br>
t: &lt;sip:10001*202@** DOMAIN **&gt;<br>
m: &lt;sip:number@**IP**&gt;<br>
i: 74391cce38d7c7f7549c863a651b8f81@*** DOMAIN ****<br>
CSeq: 102 INVITE<br>
User-Agent: asterisk<br>
Max-Forwards: 69<br>
Date: Thu, 31 Jul 2008 11:38:39 GMT<br>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY<br>
k: replaces<br>
c: application/sdp<br>
l: 422<br>
P-hint: usrloc applied<br>
<br>
v=3D0<br>
o=3Droot 5390 5390 IN IP4 194.xxx.xxx.xxx<br>
s=3Dsession<br>
c=3DIN IP4 194.xxx.xxx.xxx<br>
b=3DCT:384<br>
t=3D0 0<br>
m=3Daudio 12558 RTP/AVP 0 8 3 101<br>
a=3Drtpmap:0 PCMU/8000<br>
a=3Drtpmap:8 PCMA/8000<br>
a=3Drtpmap:3 GSM/8000<br>
a=3Drtpmap:101 telephone-event/8000<br>
a=3Dfmtp:101 0-16<br>
a=3DsilenceSupp:off - - - -<br>
a=3Dptime:20<br>
a=3Dsendrecv<br>
m=3Dvideo 17918 RTP/AVP 34 103 99<br>
a=3Drtpmap:34 H263/90000<br>
a=3Drtpmap:103 h263-1998/90000<br>
a=3Drtpmap:99 H264/90000<br>
a=3Dsendrecv<br>
<br>
&nbsp;<br>
////////////// PHONE REPLY ////////////////////<br>
SIP/2.0 200 Ok<br>
Via: SIP/2.0/UDP **** IP =
****:5060;branch=3Dz9hG4bK19d7ec13;rport=3D5060<br>
Record-Route: &lt;sip:*** IP ***;lr=3Don;ftag=3Das486f79a5&gt;<br>
From: &quot;***&nbsp;NUMBER *****&quot; &lt;sip:*** DOMAIN
*****&gt;;tag=3Das486f79a5<br>
To: &lt;sip:10001*202@*** DOMAIN *****&gt;;tag=3Djgdy33ee6n<br>
Call-ID: *** ID ***<br>
CSeq: 102 INVITE<br>
Contact: &lt;sip:*** DOMAIN =
****:54686;line=3De25l7qyi;nat=3Dyes&gt;;reg-id=3D1<br>
User-Agent: snom370/7.3.7<br>
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, =
PRACK,
MESSAGE, INFO<br>
Allow-Events: talk, hold, refer, call-info<br>
Supported: timer, replaces, from-change<br>
Content-Type: application/sdp<br>
Content-Length: 508<br>
v=3D0<br>
o=3Droot 1569142945 1569142946 IN IP4 192.168.1.20<br>
s=3Dcall<br>
c=3DIN IP4 ** EXTERNAL IP ***<br>
t=3D0 0<br>
m=3Daudio 10014 RTP/AVP 0 8 3 101<br>
a=3Drtpmap:0 pcmu/8000<br>
a=3Drtpmap:8 pcma/8000<br>
a=3Drtpmap:3 gsm/8000<br>
a=3Drtpmap:101 telephone-event/8000<br>
a=3Dfmtp:101 0-16<br>
a=3Dptime:20<br>
a=3Dalt:1 0.9 : user 9kksj=3D=3D 192.168.1.20 10014<br>
a=3Dsendrecv<br>
m=3Dvideo 0 RTP/AVP 34 103 99<br>
a=3Drtpmap:34 H263/90000<br>
a=3Drtpmap:103 h263-1998/90000<br>
a=3Drtpmap:99 H264/90000<br>
a=3Dalt:1 0.9 : user 9kksj=3D=3D 192.168.1.20 10014<br>
a=3Dsendrecv<br>
a=3Doldmediaip:192.168.1.20</span><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p></o:p><=
/span></p>

<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>

<hr size=3D2 width=3D"100%" align=3Dcenter>

</span></div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Find
out how to make Messenger your very own TV! <a
href=3D"http://clk.atdmt.com/UKM/go/101719648/direct/01/" =
target=3D"_blank">Try it
Now!</a><o:p></o:p></span></p>

</div>

</div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'><o:p>&nbsp;<=
/o:p></span></p>

<div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>

<hr size=3D2 width=3D"100%" align=3Dcenter>

</span></div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Get
fish-slapping on Messenger! <a
href=3D"http://clk.atdmt.com/UKM/go/101719805/direct/01/" =
target=3D"_new">Play Now</a><o:p></o:p></span></p>

</div>

</div>

</body>

</html>

------=_NextPart_000_00C2_01C8F31E.1D845780--




More information about the Users mailing list