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(a)btinternet.comTo: users(a)lists.kamailio.orgDate: Thu, 31 Jul 2008
13:32:05 +0100Subject: 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 WilkinsonPrincipal Consultant
Aeonvista Ltd - opening up new ideas
From: users-bounces(a)lists.kamailio.org [mailto:users-bounces@lists.kamailio.org] On Behalf
Of Ross BeerSent: 31 July 2008 12:50To: users(a)lists.kamailio.orgSubject: [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
detectionforce_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.0Record-Route: <sip:*** IP ***;lr=on;ftag=as0a2e0c2e>Via:
SIP/2.0/UDP *** IP ***;branch=z9hG4bKb0a1.cf08f082.0v: SIP/2.0/UDP *** IP
***:5060;branch=z9hG4bK2bc03835;rport=5060f: "Name" <sip:*** DOMAIN
***>;tag=as0a2e0c2et: <sip:10001*202@** DOMAIN **>m: <sip:number@**IP**>i:
74391cce38d7c7f7549c863a651b8f81@*** DOMAIN ****CSeq: 102 INVITEUser-Agent:
asteriskMax-Forwards: 69Date: Thu, 31 Jul 2008 11:38:39 GMTAllow: INVITE, ACK, CANCEL,
OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFYk: replacesc: application/sdpl: 422P-hint: usrloc
appliedv=0o=root 5390 5390 IN IP4 194.xxx.xxx.xxxs=sessionc=IN IP4
194.xxx.xxx.xxxb=CT:384t=0 0m=audio 12558 RTP/AVP 0 8 3 101a=rtpmap:0 PCMU/8000a=rtpmap:8
PCMA/8000a=rtpmap:3 GSM/8000a=rtpmap:101 telephone-event/8000a=fmtp:101
0-16a=silenceSupp:off - - - -a=ptime:20a=sendrecvm=video 17918 RTP/AVP 34 103
99a=rtpmap:34 H263/90000a=rtpmap:103 h263-1998/90000a=rtpmap:99 H264/90000a=sendrecv
////////////// PHONE REPLY ////////////////////SIP/2.0 200 OkVia: SIP/2.0/UDP **** IP
****:5060;branch=z9hG4bK19d7ec13;rport=5060Record-Route: <sip:*** IP
***;lr=on;ftag=as486f79a5>From: "*** NUMBER *****" <sip:*** DOMAIN
*****>;tag=as486f79a5To: <sip:10001*202@*** DOMAIN *****>;tag=jgdy33ee6nCall-ID:
*** ID ***CSeq: 102 INVITEContact: <sip:*** DOMAIN
****:54686;line=e25l7qyi;nat=yes>;reg-id=1User-Agent: snom370/7.3.7Allow: INVITE, ACK,
CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE, PRACK, MESSAGE, INFOAllow-Events: talk,
hold, refer, call-infoSupported: timer, replaces, from-changeContent-Type:
application/sdpContent-Length: 508v=0o=root 1569142945 1569142946 IN IP4
192.168.1.20s=callc=IN IP4 ** EXTERNAL IP ***t=0 0m=audio 10014 RTP/AVP 0 8 3
101a=rtpmap:0 pcmu/8000a=rtpmap:8 pcma/8000a=rtpmap:3 gsm/8000a=rtpmap:101
telephone-event/8000a=fmtp:101 0-16a=ptime:20a=alt:1 0.9 : user 9kksj== 192.168.1.20
10014a=sendrecvm=video 0 RTP/AVP 34 103 99a=rtpmap:34 H263/90000a=rtpmap:103
h263-1998/90000a=rtpmap:99 H264/90000a=alt:1 0.9 : user 9kksj== 192.168.1.20
10014a=sendrecva=oldmediaip:192.168.1.20
Find out how to make Messenger your very own TV! Try it Now!
_________________________________________________________________
Invite your Facebook friends to chat on Messenger
http://clk.atdmt.com/UKM/go/101719649/direct/01/