New to FreePBX Inbound call issue

Hi all,

I am new to FreePBX and need some help.

I can call internally and call out without issue but can not receive inbound calls. I know it must be something simple on my end but cant for the life of me figure out what.

Here is the log of an inbound call.

_localhost*CLI> sip set debug on
SIP Debugging enabled

<— SIP read from UDP:SoftPhoneIP:53231 —>

<------------->
Reliably Transmitting (NAT) to ATAIP:5060:
OPTIONS sip:7000@ATAIP:5060 SIP/2.0
Via: SIP/2.0/UDP ExternalIP:5060;branch=z9hG4bK45b16455;rport
Max-Forwards: 70
From: “Unknown” sip:Unknown@ExternalIP;tag=as369559d5
To: sip:7000@ATAIP:5060
Contact: sip:Unknown@ExternalIP:5060
Call-ID: 0f1ba37436ef3d7b30838edf3a010da7@ExternalIP:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-AsteriskNOW-13.0.163(11.16.0)
Date: Sat, 23 Jul 2016 00:17:22 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLIS H, MESSAGE
Supported: replaces, timer
Content-Length: 0

<— SIP read from UDP:ATAIP:5060 —>
SIP/2.0 200 OK
To: sip:7000@ATAIP:5060;tag=21721a5ac87d5343i0
From: “Unknown” sip:Unknown@ExternalIP;tag=as369559d5
Call-ID: 0f1ba37436ef3d7b30838edf3a010da7@ExternalIP:5060
CSeq: 102 OPTIONS
Via: SIP/2.0/UDP ExternalIP:5060;branch=z9hG4bK45b16455
Server: Cisco/SPA112-1.3.5(004p)
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: replaces

<------------->
— (10 headers 0 lines) —
Really destroying SIP dialog ‘0f1ba37436ef3d7b30838edf3a010da7@ExternalIP:5 060’ Method: OPTIONS
Reliably Transmitting (NAT) to SoftPhoneIP:53231:
OPTIONS sip:7001@SoftPhoneIP:53231;rinstance=3d94fd45d6c729a7 SIP/2.0
Via: SIP/2.0/UDP ExternalIP:5060;branch=z9hG4bK48a68ff6;rport
Max-Forwards: 70
From: “Unknown” sip:Unknown@ExternalIP;tag=as2fed8ada
To: sip:7001@SoftPhoneIP:53231;rinstance=3d94fd45d6c729a7
Contact: sip:Unknown@ExternalIP:5060
Call-ID: 673f59141ba3a6750584dc7b1fabd1da@ExternalIP:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-AsteriskNOW-13.0.163(11.16.0)
Date: Sat, 23 Jul 2016 00:17:22 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLIS H, MESSAGE
Supported: replaces, timer
Content-Length: 0

<— SIP read from UDP:SoftPhoneIP:53231 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP ExternalIP:5060;branch=z9hG4bK48a68ff6;rport=5060;received =10.20.30.104
Contact: sip:SoftPhoneIP:53231
To: sip:7001@SoftPhoneIP:53231;rinstance=3d94fd45d6c729a7;tag=2cb73e2d
From: “Unknown” sip:Unknown@ExternalIP;tag=as2fed8ada
Call-ID: 673f59141ba3a6750584dc7b1fabd1da@ExternalIP:5060
CSeq: 102 OPTIONS
Accept: application/sdp
Accept-Language: en
Allow: SUBSCRIBE, NOTIFY, INVITE, ACK, CANCEL, BYE, REFER, INFO, OPTIONS, MESSAG E
Supported: replaces
User-Agent: X-Lite release 4.9.5 stamp 81136
Allow-Events: talk, hold
Content-Length: 0

<------------->
— (14 headers 0 lines) —
Really destroying SIP dialog ‘673f59141ba3a6750584dc7b1fabd1da@ExternalIP:5 060’ Method: OPTIONS
Reliably Transmitting (NAT) to 125.213.160.81:5060:
OPTIONS sip:sip00.mynetfone.com.au SIP/2.0
Via: SIP/2.0/UDP ExternalIP:5060;branch=z9hG4bK34626045;rport
Max-Forwards: 70
From: “Unknown” sip:09565794@ExternalIP;tag=as27594be4
To: sip:sip00.mynetfone.com.au
Contact: sip:09565794@ExternalIP:5060
Call-ID: 5a2bdb9c2a3b55674347ae53750f462a@ExternalIP:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-AsteriskNOW-13.0.163(11.16.0)
Date: Sat, 23 Jul 2016 00:17:22 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLIS H, MESSAGE
Supported: replaces, timer
Content-Length: 0

<— SIP read from UDP:125.213.160.81:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP ExternalIP:5060;branch=z9hG4bK34626045;rport
Contact: sip:[email protected]:5060
To: sip:sip00.mynetfone.com.au;tag=33f5d8e0-co4525-INS001
From: "Unknown"sip:09565794@ExternalIP;tag=as27594be4
Call-ID: 5a2bdb9c2a3b55674347ae53750f462a@ExternalIP:5060
CSeq: 102 OPTIONS
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, INFO, SUBSCRIBE, NOTIFY, REGIST ER
User-Agent: ENSR3.0.6
Content-Length: 0

<------------->
— (10 headers 0 lines) —
Really destroying SIP dialog ‘5a2bdb9c2a3b55674347ae53750f462a@ExternalIP:5 060’ Method: OPTIONS
Reliably Transmitting (NAT) to 125.213.160.81:5060:
OPTIONS sip:sip00.mynetfone.com.au SIP/2.0
Via: SIP/2.0/UDP ExternalIP:5060;branch=z9hG4bK2ed05e59;rport
Max-Forwards: 70
From: “Unknown” sip:09565795@ExternalIP;tag=as41927fb0
To: sip:sip00.mynetfone.com.au
Contact: sip:09565795@ExternalIP:5060
Call-ID: 25276cf17e28056d6fc70ac50dbe5bb7@ExternalIP:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-AsteriskNOW-13.0.163(11.16.0)
Date: Sat, 23 Jul 2016 00:17:22 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLIS H, MESSAGE
Supported: replaces, timer
Content-Length: 0

<— SIP read from UDP:125.213.160.81:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP ExternalIP:5060;branch=z9hG4bK2ed05e59;rport
Contact: sip:[email protected]:5060
To: sip:sip00.mynetfone.com.au;tag=ce6fb3e-co4571-INS001
From: "Unknown"sip:09565795@ExternalIP;tag=as41927fb0
Call-ID: 25276cf17e28056d6fc70ac50dbe5bb7@ExternalIP:5060
CSeq: 102 OPTIONS
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, INFO, SUBSCRIBE, NOTIFY, REGIST ER
User-Agent: ENSR3.0.6
Content-Length: 0

<------------->
— (10 headers 0 lines) —
Really destroying SIP dialog ‘25276cf17e28056d6fc70ac50dbe5bb7@ExternalIP:5 060’ Method: OPTIONS
_

Current Asterisk Version: 11.16.0
I have forwarded udp ports 5060 and udp range 10000 20000 on the router to the freepbx server.

Any help would be appreciated.

Why do you start with a sip trace. Post a print screen with your inbound routes, also why do you port forward to the freepbx. If you register with a sip provider it is not needed, only when you have remote phones.

Nope. Not true. You need to set up the port redirection from your VSP to your Intranet connected (192.168.x.x, for example) PBX server.

If you have incoming calls for a phone number, you will need to make sure your port redirection is set up correctly for the incoming calls to be allowed. If you do not set this up, you will not be able to receive incoming calls.

Since outgoing calls through your VSP are working, we know you have connectivity. So, let’s go through the obvious stuff first.

  • Turn off any “helper apps” in your router. Some routers do SIP-ALG for you, which will only mess you up.

  • Make sure your internal and external addresses are set correctly in your connection strings.

  • Make sure your registration string is using all the right information (it probably is, because you can make calls).

  • If you are connecting to Chan-SIP for your VSP, make sure you are using the right “destination” port in your router redirect (you may need to send the redir to 5061).

  • If your VSP is using “host security” (you have to have a static IP address or are using DynDNS), make sure you are using Chan-SIP. PJ-SIP doesn’t support “host security” setups yet.

  • Until you get the system working, don’t try to use any “special” incoming routes - just set up an “any/any” route and get the system to accept a call - any call. Once you get the basic connectivity working for incoming calls, then you can tailor your system up.

A better choice for finding the problem here might be a look through the log file “/var/log/asterisk/full”. If there are errors on the incoming connection, you will see them there first before you’ll see them in a SIP trace.

Registration and qualify=yes keeps things working, port forward is needed only in extreme cases. Nevertheless he can try it but should fix his iptables or else we won’t get any sleep from the invites that will be flooding his network.

As you’ve recently experienced, if you open port 5060 up to the world AND allow anonymous calling, you will get flooded with people trying to break into your system.

This is especially true if you use one of the MANY VSPs that do not use registration and “qualify=yes”.

@astbox makes a good point, you do need to get your iptables configuration squared away. The FreePBX-13 integrated firewall takes a couple of tries to get all of the boxes checked right, but that will help you get your system working.