<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>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>
=================== config =======================<BR>
&nbsp;<BR><SPAN lang=EN>
if (!mf_process_maxfwd_header("10")) {<BR>
sl_send_reply("483","Too Many Hops");<BR>
exit;<BR>
};<BR>
if (msg:len &gt;= 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>
&nbsp;<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>
&nbsp;<BR>
route(1);<BR>
}<BR>
&nbsp;<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>
&nbsp;<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>
&nbsp;<BR>
};<BR>
if (isflagset(5))<BR>
{<BR>
search_append('Contact:.*sip:[^&gt;[: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>
&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=~"(183)|(2[0-9][0-9])") || is_method("INVITE")) <BR>
{<BR>
fix_nated_sdp("2");<BR>
force_rport();<BR>
&nbsp;<BR>
}<BR>
search_append('Contact:.*sip:[^&gt;[:cntrl:]]*', ';nat=yes');<BR>
}<BR>
&nbsp;<BR>
&nbsp;<BR>
&nbsp;<BR>
==================== SIP PACKETS ===========================<BR>
INVITE sip:10001*202@**** IP ****;line=e25l7qyi SIP/2.0<BR>Record-Route: &lt;sip:*** IP ***;lr=on;ftag=as0a2e0c2e&gt;<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" &lt;sip:*** DOMAIN ***&gt;;tag=as0a2e0c2e<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=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>
&nbsp;<BR>
////////////// PHONE REPLY ////////////////////<BR>
SIP/2.0 200 Ok<BR>Via: SIP/2.0/UDP **** IP ****:5060;branch=z9hG4bK19d7ec13;rport=5060<BR>Record-Route: &lt;sip:*** IP ***;lr=on;ftag=as486f79a5&gt;<BR>From: "***&nbsp;NUMBER *****" &lt;sip:*** DOMAIN *****&gt;;tag=as486f79a5<BR>To: &lt;sip:10001*202@*** DOMAIN *****&gt;;tag=jgdy33ee6n<BR>Call-ID: *** ID ***<BR>
CSeq: 102 INVITE<BR>Contact: &lt;sip:*** DOMAIN ****:54686;line=e25l7qyi;nat=yes&gt;;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<BR></SPAN><br /><hr />Find out how to make Messenger your very own TV! <a href='http://clk.atdmt.com/UKM/go/101719648/direct/01/' target='_new'>Try it Now!</a></body>
</html>