Ports forwarded, but no incoming calls?

I having a regular problem with my RasPBX (Asterisk 11.21.0, FreePBX 12.0.76.2) box for incoming calls. Outgoing calls work fine. The RasPBX box is behind NAT (BT Home Hub with ports 5060,5061 and 10000-20000 forwarded. SIP trunk provider is Voipfone.

One of two things happens. Either caller hears American female voice: “The number you have dialled is not in service, please check the number and try again [then Voipfone account number, which is set up as the DID number for the incoming route]”

OR caller hears a British female voice: “Welcome to Voipfone voicemail. The person you have called is currently unavailable [etc…]”

Nothing happens in /var/log/asterisk/full. Not a flicker.

Restarting asterisk fixes the issue temporarily.

Here is the output of sip show peers, which doesn’t seem to change regardless of whether incoming calls get through. Local IP is a grandstream IP phone:

Name/username Host Dyn Forcerport Comedia ACL Port Status Description 201/201 192.168.1.96 D Yes Yes A 5060 OK (11 ms) Voipfone-SIP/[account num] 195.189.XXX.XX Yes Yes 5060 OK (22 ms) 2 sip peers [Monitored: 2 online, 0 offline Unmonitored: 0 online, 0 offline]

This may be unrelated, but I am also getting these warnings in the logs:

[2016-01-21 12:02:33] WARNING[18290] chan_sip.c: Timeout on [32-length hex] on non-critical invite transaction.
I have read on one forum that this can be caused by bad NAT/router setup but on another that they are caused by botnets attacking SIP. We do get IPs being banned by Fail2Ban.

Pointers greatly appreciated! :smiley:

May have found the problem: a ‘subscriber absent’ error, even though ‘sip show peers’ shows both the SIP trunk and my Grandstream IP phone as ‘OK’.

I am not even sure which has gone away. Is the ‘subscriber’ here the SIP trunk or the IP phone?

Anyway, with an incoming call from the telephone network, looking in Asterisk CLI with SIP debugging on first we get …

Followed by …

<--- Reliably Transmitting (NAT) to <SIP trunk IP>:5060 ---> SIP/2.0 503 Service Unavailable Via: SIP/2.0/UDP <SIP trunk IP>:5060;branch=z9hG4bK1f072430;received=<SIP trunk IP>;rport=5060 From: "<incoming phone number>" <sip:<incoming phone number>@<SIP trunk IP>>;tag=VF1a652684b9859ff8360c4cea3a26 To: <sip:<SIP trunk login username>@<RasPBX box IP>:5060>;tag=as0784267c Call-ID: VFb6acdb1dd88c7542e38213093ecb89@voipfone CSeq: 102 INVITE Server: FPBX-12.0.76.2(11.20.0) Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE Supported: replaces, timer X-Asterisk-HangupCause: Subscriber absent X-Asterisk-HangupCauseCode: 20 Content-Length: 0 <------------>

Full log below:

[code]<------------->
— (12 headers 0 lines) —
[2016-01-22 14:48:17] NOTICE[1403]: chan_sip.c:23710 handle_response_register: Outbound Registration: Expiry for sip.voipfone.net is 60 sec (Scheduling reregistration in 45 s)
Really destroying SIP dialog ‘68adf7f8405b43236c9345725f7880eb@127.0.0.1’ Method: REGISTER

<— SIP read from UDP::5060 —>
INVITE sip:@:5060 SIP/2.0
Via: SIP/2.0/UDP :5060;branch=z9hG4bK1f072430;rport
From: “” <sip:@>;tag=VF1a652684b9859ff8360c4cea3a26
To: <sip:@:5060>
Contact: <sip:@:5060>
Call-ID: VFb6acdb1dd88c7542e38213093ecb89@voipfone
CSeq: 102 INVITE
User-Agent: Voipfone Sip Network
Date: Fri, 22 Jan 2016 14:48:19 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Content-Type: application/sdp
Content-Length: 335

v=0
o=root 3300 3300 IN IP4
s=session
c=IN IP4
t=0 0
m=audio 14260 RTP/AVP 8 2 97 3 110 101
a=sendrecv
a=rtpmap:8 PCMA/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:97 iLBC/8000
a=rtpmap:3 GSM/8000
a=rtpmap:110 speex/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
<------------->
— (12 headers 15 lines) —
Sending to :5060 (NAT)
Sending to :5060 (NAT)
Using INVITE request as basis request - VFb6acdb1dd88c7542e38213093ecb89@voipfone
Found peer ‘Voipfone-SIP’ for ‘’ from :5060
Found RTP audio format 8
Found RTP audio format 2
Found RTP audio format 97
Found RTP audio format 3
Found RTP audio format 110
Found RTP audio format 101
Found audio description format PCMA for ID 8
Found audio description format G726-32 for ID 2
Found audio description format iLBC for ID 97
Found audio description format GSM for ID 3
Found audio description format speex for ID 110
Found audio description format telephone-event for ID 101
Capabilities: us - (alaw), peer - audio=(gsm|alaw|g726|speex|ilbc)/video=(nothing)/text=(nothing), combined - (alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port :14260
Looking for in from-pstn (domain )
list_route: hop: <sip:@:5060>

<— Transmitting (NAT) to :5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP :5060;branch=z9hG4bK1f072430;received=;rport=5060
From: “” <sip:@>;tag=VF1a652684b9859ff8360c4cea3a26
To: <sip:@:5060>
Call-ID: VFb6acdb1dd88c7542e38213093ecb89@voipfone
CSeq: 102 INVITE
Server: FPBX-12.0.76.2(11.20.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:@:5060>
Content-Length: 0

<------------>
[2016-01-22 14:48:19] WARNING[8654][C-0000004b]: func_channel.c:538 func_channel_read: Unknown or unavailable item requested: ‘reversecharge’
[2016-01-22 14:48:19] WARNING[8654][C-0000004b]: func_callerid.c:917 callerpres_read: CALLERPRES is deprecated. Use CALLERID(name-pres) or CALLERID(num-pres) instead.
Really destroying SIP dialog ‘447afe4068a1fa7f350eda9f0fc80d06@127.0.0.1:5060’ Method: INVITE
[2016-01-22 14:48:19] WARNING[8654][C-0000004b]: app_dial.c:2437 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
[2016-01-22 14:48:19] WARNING[8654][C-0000004b]: translate.c:338 framein: no samples for alawtolin

<— Reliably Transmitting (NAT) to :5060 —>
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP :5060;branch=z9hG4bK1f072430;received=;rport=5060
From: “” <sip:@>;tag=VF1a652684b9859ff8360c4cea3a26
To: <sip:@:5060>;tag=as0784267c
Call-ID: VFb6acdb1dd88c7542e38213093ecb89@voipfone
CSeq: 102 INVITE
Server: FPBX-12.0.76.2(11.20.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-Asterisk-HangupCause: Subscriber absent
X-Asterisk-HangupCauseCode: 20
Content-Length: 0

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

<— SIP read from UDP::5060 —>
ACK sip:@:5060 SIP/2.0
Via: SIP/2.0/UDP :5060;branch=z9hG4bK1f072430;rport
From: “” <sip:@>;tag=VF1a652684b9859ff8360c4cea3a26
To: <sip:@:5060>;tag=as0784267c
Contact: <sip:@:5060>
Call-ID: VFb6acdb1dd88c7542e38213093ecb89@voipfone
CSeq: 102 ACK
User-Agent: Voipfone Sip Network
Content-Length: 0

<------------->
— (9 headers 0 lines) —
Really destroying SIP dialog ‘VFb6acdb1dd88c7542e38213093ecb89@voipfone’ Method: ACK
[/code]