<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><FONT color=#000000>Hi Neill,</FONT><BR>
<FONT color=#000000></FONT> <BR>
<FONT color=#000000>The outgoing audio works fine. The audio that is not passed is from PSTN -> Phone. </FONT><BR>
<FONT color=#000000></FONT> <BR>
<FONT color=#000000>The Snom does have <FONT face=Calibri size=3>symmetrical RTP set. I did have this working about a week ago then it stopped working!</FONT></FONT><BR>
<FONT face=Calibri color=#000000 size=3></FONT> <BR>
<FONT face=Calibri color=#000000 size=3>How does asterisk deal with NAT, as if I connect the phone directly to Asterisk everything works perfectly! </FONT><BR>
<FONT face=Calibri color=#000000 size=3></FONT> <BR>
<FONT face=Calibri color=#000000 size=3>Both Asterisk & Kamailio are on publically accessible IP addresses.</FONT><BR>
<FONT face=Calibri color=#000000 size=3></FONT> <BR>
<FONT face=Calibri color=#000000 size=3>Thank you for your help so far.</FONT><BR>
<FONT face=Calibri color=#000000 size=3></FONT> <BR>
<FONT face=Calibri color=#000000 size=3>Ross</FONT><BR>
<BR><BR><BR><BR><BR>
<HR id=EC_stopSpelling>
<BR>
From: neill.wilkinson@btinternet.com<BR>To: users@lists.kamailio.org<BR>Date: Thu, 31 Jul 2008 13:32:05 +0100<BR>Subject: Re: [Kamailio-Users] NAT Problems<BR><BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass .EC_shape
{;}
</STYLE>
<STYLE>
.ExternalClass p.EC_MsoNormal, .ExternalClass li.EC_MsoNormal, .ExternalClass div.EC_MsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass a:link, .ExternalClass span.EC_MsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.EC_MsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass p.EC_MsoAcetate, .ExternalClass li.EC_MsoAcetate, .ExternalClass div.EC_MsoAcetate
{margin-bottom:.0001pt;font-size:8.0pt;font-family:'Tahoma','sans-serif';}
.ExternalClass span.EC_EmailStyle18
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass span.EC_BalloonTextChar
{font-family:'Tahoma','sans-serif';}
.ExternalClass .EC_MsoChpDefault
{font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;}
.ExternalClass div.EC_Section1
{page:Section1;}
</STYLE>
<DIV class=EC_Section1>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">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?</SPAN></P>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Do you have symmetrical RTP set in the Line settings (under NAT) on the SNOM?</SPAN></P>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Is Kamailio inside or outside the NAT?</SPAN></P>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'">Neill...;o)</SPAN></P>
<DIV>
<TABLE class=EC_MsoNormalTable style="WIDTH: 235.8pt" cellSpacing=0 cellPadding=0 width=314 border=0>
<TBODY>
<TR>
<TD style="BORDER-RIGHT: medium none; PADDING-RIGHT: 6pt; BORDER-TOP: #cccccc 1pt solid; PADDING-LEFT: 6pt; PADDING-BOTTOM: 6pt; BORDER-LEFT: medium none; PADDING-TOP: 6pt; BORDER-BOTTOM: medium none" colSpan=2>
<TABLE class=EC_MsoNormalTable style="WIDTH: 95%" cellSpacing=0 cellPadding=0 width="95%" border=0>
<TBODY>
<TR>
<TD style="PADDING-RIGHT: 0cm; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; WIDTH: 50%; PADDING-TOP: 0cm" vAlign=top width="50%">
<P class=EC_MsoNormal><B><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Verdana','sans-serif'">Neill Wilkinson</SPAN></B><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Verdana','sans-serif'"><BR>Principal Consultant<BR> </SPAN></P>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Verdana','sans-serif'">Aeonvista Ltd - opening up new ideas</SPAN></P></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #cccccc 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 1.2pt; BORDER-BOTTOM: medium none">
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 6pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"> </SPAN></P></TD>
<TD style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #cccccc 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 1.2pt; BORDER-BOTTOM: medium none">
<P class=EC_MsoNormal style="TEXT-ALIGN: right" align=right><SPAN style="FONT-SIZE: 6pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"> </SPAN></P></TD></TR></TBODY></TABLE>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"> </SPAN></P>
<DIV>
<DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=EC_MsoNormal><B><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> users-bounces@lists.kamailio.org [mailto:users-bounces@lists.kamailio.org] <B>On Behalf Of </B>Ross Beer<BR><B>Sent:</B> 31 July 2008 12:50<BR><B>To:</B> users@lists.kamailio.org<BR><B>Subject:</B> [Kamailio-Users] NAT Problems</SPAN></P></DIV></DIV>
<P class=EC_MsoNormal> </P>
<P class=EC_MsoNormal style="MARGIN-BOTTOM: 12pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">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.<BR> <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> <BR>Outgoing calls from Kamailio -> asterisk -> PSTN work fine.<BR> <BR>Thank you for your help in advance, it is much appreciated.<BR> <BR> <BR>=================== config =======================<BR> <BR></SPAN><SPAN lang=EN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">if (!mf_process_maxfwd_header("10")) {<BR>sl_send_reply("483","Too Many Hops");<BR>exit;<BR>};<BR>if (msg:len >= 2048 ) {<BR>sl_send_reply("513", "Message too big");<BR>exit;<BR>};<BR># NAT detection<BR>force_rport();<BR>if(nat_uac_test("3"))<BR>{<BR><BR>fix_nated_contact();<BR>}<BR>if (!method=="REGISTER")<BR>{<BR>record_route();<BR>}<BR>if (loose_route()) {<BR>append_hf("P-hint: rr-enforced\r\n"); <BR>route(1);<BR>};<BR>if (!uri==myself) {<BR>append_hf("P-hint: outbound\r\n"); <BR>route(1);<BR>};<BR>if (uri==myself) {<BR>if (method=="REGISTER") <BR>{<BR>if (!www_authorize("", "subscriber")) {<BR>www_challenge("", "0");<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("location")<BR>setbflag(6);<BR> <BR>};<BR><BR>fix_nated_contact();<BR>fix_nated_register();<BR>consume_credentials();<BR>save("location");<BR>exit;<BR>};<BR>if (!lookup("location")) {<BR>sl_send_reply("404", "Not Found");<BR>exit;<BR>};<BR>append_hf("P-hint: usrloc applied\r\n"); <BR>};<BR><BR>if(method=="MESSAGE")<BR>{<BR>if (!lookup("location"))<BR>{<BR>sl_send_reply("404", "User Offline");<BR>exit;<BR>}<BR>route(4);<BR>}<BR><BR>if (method=="REGISTER")<BR>{<BR>save("location");<BR>}<BR> <BR>route(1);<BR>}<BR> <BR>route[1] {<BR>if (subst_uri('/(sip:.*);nat=yes/\1/')){<BR>setbflag(6);<BR>};<BR>if (isflagset(5)||isbflagset(6)) {<BR>route(3);<BR>}<BR>t_on_reply("1");<BR>if (!t_relay()) {<BR>sl_reply_error();<BR>};<BR>exit;<BR>}<BR> <BR>route[3] {<BR>if (is_method("BYE")) <BR>{<BR>unforce_rtp_proxy();<BR>} <BR>else if (is_method("INVITE"))<BR>{<BR>fix_nated_sdp("3");<BR> <BR>};<BR>if (isflagset(5))<BR>{<BR>search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');<BR>}<BR>t_on_reply("1");<BR>}<BR>route[4]<BR>{<BR>if (!t_relay()) <BR>{<BR>sl_reply_error();<BR>};<BR>exit;<BR>}<BR> <BR> <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)) && status=~"(183)|(2[0-9][0-9])") || is_method("INVITE")) <BR>{<BR>fix_nated_sdp("2");<BR>force_rport();<BR> <BR>}<BR>search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');<BR>}<BR> <BR> <BR> <BR>==================== SIP PACKETS ===========================<BR>INVITE sip:10001*202@**** IP ****;line=e25l7qyi SIP/2.0<BR>Record-Route: <sip:*** IP ***;lr=on;ftag=as0a2e0c2e><BR>Via: SIP/2.0/UDP *** IP ***;branch=z9hG4bKb0a1.cf08f082.0<BR>v: SIP/2.0/UDP *** IP ***:5060;branch=z9hG4bK2bc03835;rport=5060<BR>f: "Name" <sip:*** DOMAIN ***>;tag=as0a2e0c2e<BR>t: <sip:10001*202@** DOMAIN **><BR>m: <sip:number@**IP**><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=0<BR>o=root 5390 5390 IN IP4 194.xxx.xxx.xxx<BR>s=session<BR>c=IN IP4 194.xxx.xxx.xxx<BR>b=CT:384<BR>t=0 0<BR>m=audio 12558 RTP/AVP 0 8 3 101<BR>a=rtpmap:0 PCMU/8000<BR>a=rtpmap:8 PCMA/8000<BR>a=rtpmap:3 GSM/8000<BR>a=rtpmap:101 telephone-event/8000<BR>a=fmtp:101 0-16<BR>a=silenceSupp:off - - - -<BR>a=ptime:20<BR>a=sendrecv<BR>m=video 17918 RTP/AVP 34 103 99<BR>a=rtpmap:34 H263/90000<BR>a=rtpmap:103 h263-1998/90000<BR>a=rtpmap:99 H264/90000<BR>a=sendrecv<BR><BR> <BR>////////////// PHONE REPLY ////////////////////<BR>SIP/2.0 200 Ok<BR>Via: SIP/2.0/UDP **** IP ****:5060;branch=z9hG4bK19d7ec13;rport=5060<BR>Record-Route: <sip:*** IP ***;lr=on;ftag=as486f79a5><BR>From: "*** NUMBER *****" <sip:*** DOMAIN *****>;tag=as486f79a5<BR>To: <sip:10001*202@*** DOMAIN *****>;tag=jgdy33ee6n<BR>Call-ID: *** ID ***<BR>CSeq: 102 INVITE<BR>Contact: <sip:*** DOMAIN ****:54686;line=e25l7qyi;nat=yes>;reg-id=1<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=0<BR>o=root 1569142945 1569142946 IN IP4 192.168.1.20<BR>s=call<BR>c=IN IP4 ** EXTERNAL IP ***<BR>t=0 0<BR>m=audio 10014 RTP/AVP 0 8 3 101<BR>a=rtpmap:0 pcmu/8000<BR>a=rtpmap:8 pcma/8000<BR>a=rtpmap:3 gsm/8000<BR>a=rtpmap:101 telephone-event/8000<BR>a=fmtp:101 0-16<BR>a=ptime:20<BR>a=alt:1 0.9 : user 9kksj== 192.168.1.20 10014<BR>a=sendrecv<BR>m=video 0 RTP/AVP 34 103 99<BR>a=rtpmap:34 H263/90000<BR>a=rtpmap:103 h263-1998/90000<BR>a=rtpmap:99 H264/90000<BR>a=alt:1 0.9 : user 9kksj== 192.168.1.20 10014<BR>a=sendrecv<BR>a=oldmediaip:192.168.1.20</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"></SPAN></P>
<DIV class=EC_MsoNormal style="TEXT-ALIGN: center" align=center><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">
<HR align=center width="100%" SIZE=2>
</SPAN></DIV>
<P class=EC_MsoNormal><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">Find out how to make Messenger your very own TV! <A href="http://clk.atdmt.com/UKM/go/101719648/direct/01/" target=_blank>Try it Now!</A></SPAN></P></DIV></DIV><br /><hr />Get fish-slapping on Messenger! <a href='http://clk.atdmt.com/UKM/go/101719805/direct/01/' target='_new'>Play Now</a></body>
</html>