NAT/One way Audio/RTP problem

Hi,
I have configured my firewall router to allow sip connections to asterisk server using port forwarding. I believe I did it correctly.

  1. When I call the phone from inside out or outside in, I(inside private network) cannot hear anything but the outside can hear me.
  2. The call then disconnect automatically within 10-20 seconds with this message:
    [Mar 14 17:08:39] NOTICE[3926]: chan_sip.c:22697 check_rtp_timeout: Disconnecting call ‘SIP/1515-0000003c’ for lack of RTP activity in 31 seconds
    – Executing [h@macro-dial-one:1] Macro(“SIP/1515-0000003c”, “hangupcall,”) in new stack
    – Executing [s@macro-hangupcall:1] GotoIf(“SIP/1515-0000003c”, “1?theend”) in new stack
    – Goto (macro-hangupcall,s,3)
    – Executing [s@macro-hangupcall:3] Hangup(“SIP/1515-0000003c”, “”) in new stack

any suggestions?

Hi,
you should also forward the port range that your box is using for rtp stream.
do you have a sip debug of the call?

this is the sip debug when I dont make any calls…

Reliably Transmitting (NAT) to PPP.PPP.PPP.PPP:36402:
OPTIONS sip:1513@PPP.PPP.PPP.PPP:36402;rinstance=a289675db7a81cb8 SIP/2.0
Via: SIP/2.0/UDP XXX.XXX.XXX.XXX:5060;branch=z9hG4bK0add95aa;rport
Max-Forwards: 70
From: “Unknown” sip:Unknown@XXX.XXX.XXX.XXX;tag=as6ce8047a
To: sip:1513@PPP.PPP.PPP.PPP:36402;rinstance=a289675db7a81cb8
Contact: sip:Unknown@XXX.XXX.XXX.XXX
Call-ID: 702863902c84c39758b190b76aabe8ad@XXX.XXX.XXX.XXX
CSeq: 102 OPTIONS
User-Agent: FPBX-2.9.0beta2(1.6.2.17)
Date: Mon, 14 Mar 2011 22:38:49 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0


<— SIP read from UDP:PPP.PPP.PPP.PPP:36402 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.1.0.200:5060;branch=z9hG4bK0add95aa;rport=5060
Contact: sip:PPP.PPP.PPP.PPP:36402
To: sip:1513@PPP.PPP.PPP.PPP:36402;rinstance=a289675db7a81cb8;tag=6c55a10b
From: "Unknown"sip:Unknown@XXX.XXX.XXX.XXX;tag=as6ce8047a
Call-ID: 702863902c84c39758b190b76aabe8ad@XXX.XXX.XXX.XXX
CSeq: 102 OPTIONS
Accept: application/sdp
Accept-Language: en
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Supported: replaces
User-Agent: X-Lite 4 release 4.0 stamp 58832
Content-Length: 0

<------------->
— (13 headers 0 lines) —
Really destroying SIP dialog '702863902c84c39758b190b76aabe8ad@XXX.XXX.XXX.XXX’ Method: OPTIONS
[Mar 14 18:38:58] NOTICE[3926]: chan_sip.c:12913 check_auth: Correct auth, but based on stale nonce received from ‘"TEST6"sip:1516@10.1.0.200;tag=a5706b1a’

<— SIP read from UDP:PPP.PPP.PPP.PPP:36402 —>

where PPP.PPP.PPP.PPP is the public ip from where I am trying to call(my home connection) and xxx.xxx.xxdx.xxx is the public ip of my company

That’s not useful. You need to provide the SDP payload for a problem call.

Does this help?
Note: extension 1515 is the remote extension which called the internal extension 1114.

<— Transmitting (NAT) to P.P.P.P:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP P.P.P.P:5060;branch=z9hG4bK-d87543-c45d6f3975612b49-1–d87543-;received=P.P.P.P;rport=5060
From: "TEST5"sip:1515@X.X.X.X;tag=10260c51
To: "1114"sip:1114@X.X.X.X;tag=as6a7c7111
Call-ID: 801f89628f77a462YjBjMjMxMWZiNWZiNzhlZWRiZGQ4YWI0OWQ1ZjE0NmY.
CSeq: 2 INVITE
Server: FPBX-2.9.0beta2(1.6.2.17)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: sip:1114@X.X.X.X
Content-Length: 0

<------------>
– SIP/1114-00000003 is ringing

<— Transmitting (NAT) to P.P.P.P:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP P.P.P.P:5060;branch=z9hG4bK-d87543-c45d6f3975612b49-1–d87543-;received=P.P.P.P;rport=5060
From: "TEST5"sip:1515@X.X.X.X;tag=10260c51
To: "1114"sip:1114@X.X.X.X;tag=as6a7c7111
Call-ID: 801f89628f77a462YjBjMjMxMWZiNWZiNzhlZWRiZGQ4YWI0OWQ1ZjE0NmY.
CSeq: 2 INVITE
Server: FPBX-2.9.0beta2(1.6.2.17)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: sip:1114@X.X.X.X
Content-Length: 0

<------------>
– SIP/1114-00000003 answered SIP/1515-00000002
Audio is at X.X.X.X port 11716
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding codec 0x2 (gsm) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
== Extension Changed 1114[ext-local] new state InUse for Notify User 151

<— Reliably Transmitting (NAT) to P.P.P.P:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP P.P.P.P:5060;branch=z9hG4bK-d87543-c45d6f3975612b49-1–d87543-;received=P.P.P.P;rport=5060
From: "TEST5"sip:1515@X.X.X.X;tag=10260c51
To: "1114"sip:1114@X.X.X.X;tag=as6a7c7111
Call-ID: 801f89628f77a462YjBjMjMxMWZiNWZiNzhlZWRiZGQ4YWI0OWQ1ZjE0NmY.
CSeq: 2 INVITE
Server: FPBX-2.9.0beta2(1.6.2.17)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: sip:1114@X.X.X.X
Content-Type: application/sdp
Content-Length: 290

v=0
o=root 1460544558 1460544558 IN IP4 X.X.X.X
s=Asterisk PBX 1.6.2.17
c=IN IP4 X.X.X.X
t=0 0
m=audio 11716 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=sendrecv

<------------>

<— SIP read from UDP:P.P.P.P:5060 —>
ACK sip:1114@X.X.X.X SIP/2.0
Via: SIP/2.0/UDP P.P.P.P:5060;branch=z9hG4bK-d87543-a25f621b981fed5d-1–d87543-;rport
Max-Forwards: 70
Contact: sip:1515@P.P.P.P:5060
To: "1114"sip:1114@X.X.X.X;tag=as6a7c7111
From: "TEST5"sip:1515@X.X.X.X;tag=10260c51
Call-ID: 801f89628f77a462YjBjMjMxMWZiNWZiNzhlZWRiZGQ4YWI0OWQ1ZjE0NmY.
CSeq: 2 ACK
User-Agent: X-Lite release 1002tx stamp 29712
Authorization: Digest username=“1515”,realm=“asterisk”,nonce=“6178af8b”,uri=“sip:1114@X.X.X.X”,response=“3637d75a1ebe0106deaa2ef23c439b68”,algorithm=MD5
Content-Length: 0

<------------->

<— SIP read from UDP:P.P.P.P:5060 —>

<------------->
[Mar 15 09:33:40] NOTICE[4308]: chan_sip.c:22697 check_rtp_timeout: Disconnecting call ‘SIP/1515-00000002’ for lack of RTP activity in 31 seconds
– Executing [h@macro-dial-one:1] Macro(“SIP/1515-00000002”, “hangupcall,”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/1515-00000002”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] Hangup(“SIP/1515-00000002”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 3) exited non-zero on ‘SIP/1515-00000002’ in macro ‘hangupcall’
== Spawn extension (macro-dial-one, s, 38) exited non-zero on ‘SIP/1515-00000002’ in macro ‘dial-one’
== Spawn extension (macro-exten-vm, s, 7) exited non-zero on ‘SIP/1515-00000002’ in macro ‘exten-vm’
== Spawn extension (from-internal, 1114, 2) exited non-zero on 'SIP/1515-00000002’
Scheduling destruction of SIP dialog ‘801f89628f77a462YjBjMjMxMWZiNWZiNzhlZWRiZGQ4YWI0OWQ1ZjE0NmY.’ in 9920 ms (Method: ACK)
set_destination: Parsing sip:1515@P.P.P.P:5060 for address/port to send to
set_destination: set destination to P.P.P.P, port 5060
Reliably Transmitting (NAT) to P.P.P.P:5060:
BYE sip:1515@P.P.P.P:5060 SIP/2.0
Via: SIP/2.0/UDP X.X.X.X:5060;branch=z9hG4bK3030a56d;rport
Max-Forwards: 70
From: "1114"sip:1114@X.X.X.X;tag=as6a7c7111
To: "TEST5"sip:1515@X.X.X.X;tag=10260c51
Call-ID: 801f89628f77a462YjBjMjMxMWZiNWZiNzhlZWRiZGQ4YWI0OWQ1ZjE0NmY.
CSeq: 102 BYE
User-Agent: FPBX-2.9.0beta2(1.6.2.17)
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


== Extension Changed 1114[ext-local] new state Idle for Notify User 151

<— SIP read from UDP:P.P.P.P:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.1.0.200:5060;branch=z9hG4bK3030a56d;rport=5060
Contact: sip:1515@P.P.P.P:5060
To: "TEST5"sip:1515@X.X.X.X;tag=10260c51
From: "1114"sip:1114@X.X.X.X;tag=as6a7c7111
Call-ID: 801f89628f77a462YjBjMjMxMWZiNWZiNzhlZWRiZGQ4YWI0OWQ1ZjE0NmY.
CSeq: 102 BYE
User-Agent: X-Lite release 1002tx stamp 29712
Content-Length: 0

<------------->
— (9 headers 0 lines) —
SIP Response message for INCOMING dialog BYE arrived
Really destroying SIP dialog ‘801f89628f77a462YjBjMjMxMWZiNWZiNzhlZWRiZGQ4YWI0OWQ1ZjE0NmY.’ Method: ACK
Reliably Transmitting (NAT) to P.P.P.P:5060:
OPTIONS sip:1515@P.P.P.P:5060;rinstance=68778e44ca0c1fd4 SIP/2.0
Via: SIP/2.0/UDP X.X.X.X:5060;branch=z9hG4bK1eb9f76f;rport
Max-Forwards: 70
From: “Unknown” sip:Unknown@X.X.X.X;tag=as72e46566
To: sip:1515@P.P.P.P:5060;rinstance=68778e44ca0c1fd4
Contact: sip:Unknown@X.X.X.X
Call-ID: 2d56520728c6e48e399ad9536c28fb22@X.X.X.X
CSeq: 102 OPTIONS
User-Agent: FPBX-2.9.0beta2(1.6.2.17)
Date: Tue, 15 Mar 2011 13:33:43 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0


<— SIP read from UDP:P.P.P.P:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.1.0.200:5060;branch=z9hG4bK1eb9f76f;rport=5060
Contact: sip:P.P.P.P:5060
To: sip:1515@P.P.P.P:5060;rinstance=68778e44ca0c1fd4;tag=d566683b
From: "Unknown"sip:Unknown@X.X.X.X;tag=as72e46566
Call-ID: 2d56520728c6e48e399ad9536c28fb22@X.X.X.X
CSeq: 102 OPTIONS
Accept: application/sdp
Accept-Language: en
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
User-Agent: X-Lite release 1002tx stamp 29712
Content-Length: 0

<------------->
— (12 headers 0 lines) —
Really destroying SIP dialog '2d56520728c6e48e399ad9536c28fb22@X.X.X.X’ Method: OPTIONS

Hi,you need to check if you opened rtp port range on your firewall and if those ports are forwarded to your asterisk box.
In the answer’s sdp (200 OK message sent to the caller) asterisk should provide externip:
o=root 1460544558 1460544558 IN IP4 X.X.X.X
s=Asterisk PBX 1.6.2.17
c=IN IP4 X.X.X.X

In sip-general.conf you should set:
externaddr=firewallip
and:
localnet=your local network address

ps: also your remote extension should have in it’s configuration:
nat=yes
if it’s behind a NAT.