Chan_SIP Won't Register

Hello
I have FreePBX 13 / Asterisk 13 running.

PBX Firmware:
10.13.66-17
PBX Service Pack:
1.0.0.0

Asterisk 13.13.1

I can’t make outgoing calls “The number you have dialed is not in service” and the “Module Administration” doesn’t update any modules.
The FreePBX is behind a router and I can ping 8.8.8.8 as well as resolve "google.com"
I have NAT set to “no” under Settings > Asterisk SIP Settings > Chan SIP Settings
I have 5060, 5160 port forwarded to the FreePBX
From my SIP provider I can see that my SIP trunk isn’t registered

On my previous system I was running Asterisk11 and didn’t have any connection issues. I’ve compared both systems and have verified that they match (so I know my SIP login credentials work with my provider).
I have white listed the network that FreePBX is on.
I have set eth0 to external in the firewall.

Channel Location State Application(Data)
0 active channels
0 active calls
0 calls processed

== Everyone is busy/congested at this time (1:0/0/1)
– Executing [[email protected]:24] NoOp(“SIP/204-00000002”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 1”) in new stack
– Executing [[email protected]:25] GotoIf(“SIP/204-00000002”, “0?continue,1:s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [[email protected]:1] Set(“SIP/204-00000002”, “RC=1”) in new stack
– Executing [[email protected]:2] Goto(“SIP/204-00000002”, “1,1”) in new stack
– Goto (macro-dialout-trunk,1,1)
– Executing [[email protected]:1] Goto(“SIP/204-00000002”, “s-INVALIDNMBR,1”) in new stack
– Goto (macro-dialout-trunk,s-INVALIDNMBR,1)
– Executing [[email protected]:1] NoOp(“SIP/204-00000002”, “Dial failed due to trunk reporting Address Incomplete - giving up”)

Can you please point me in the right direction. What am I missing in my set up?

Thanks in advance for any help that can be provided.

You’re working a step to far. Your trunk connectivity problem is the issue. Look in the /var/log/asterisk/full file and see what it happening with the authentication on your host.

The fact that you have NAT set to NO on your connections is a likely cause of problems, since your PBX would then be telling your ITSP to connect to your local PBX, which I suspect is probably not routable. Also, you need to know if you are authenticating by address or by username. If by address, you should be getting some notice back from your ITSP about why the connection is failing. If by name, you are probably using the wrong username or password.

Those are just guesses, of course.

Hi Dave.
Thank you for your response. I still can’t figure out the cause of my issue.
I tried looking in the /var/log/asterisk/full but couldn’t make heads of tales of it. Let me clarify the situation here and maybe that will help.
Machine “A” Chan_Sip Trunk has been logged into the ITSP for over a year.
Machine “B” is a new server with the exact same set up as “A”. When I shut down machine “A” and turn on machine “B” the Chan_Sip Trunk no longer registers.
I’ve changed NAT. It’s now set to “yes” under Settings > Asterisk SIP Settings > Chan SIP Settings
I’ve manually re-entered the following under Trunk > sip setting > outgoing

context=from-trunk
type=peer
insecure=very
qualify=yes
sendrpid=yes
trustrpid=yes
dtmfmode=rfc2833
username=xxxxxxxxxx
secret=xxxxxxxxxx
host=IPAddress
disallow=all
allow=ulaw&g729

I did have it like this:
username=xxxxxxxx
type=peer
trustrpid=yes
sendrpid=yes
secret=xxxxxxxxxx
qualify=yes
insecure=very
host=IPAddress
dtmfmode=rfc2833
disallow=all
context=from-trunk
allow=ulaw&g729

Hello
Here’s an update. I took a look at the logs and did a search for “Pantechnicon”. They’re my SIP trunk provider. It looks as though the trunk isn’t even trying to connect and register. Also the “Module Admin” won’t even update and download the latest module. Are the two issue’s related?

Here’s a portion of the log file from yesterday. Any suggestions are greatly appreciated.

[2017-01-14 14:25:59] VERBOSE[12552] pbx.c: Registered extension context ‘from-trunk-sip-Pantechnicon’; registrar: pbx_config
[2017-01-14 14:25:59] VERBOSE[12552] pbx.c: Including context ‘from-trunk-sip-Pantechnicon-custom’ in context ‘from-trunk-sip-Pantechnicon’
[2017-01-14 14:25:59] WARNING[12552] pbx_config.c: The use of ‘.’ for an extension is strongly discouraged and can have unexpected behavior. Please use ‘X.’ instead at line 3130 of /etc/asterisk/extensions_additional.conf
[2017-01-14 14:25:59] VERBOSE[12552] pbx.c: Added extension '
.’ priority 1 to from-trunk-sip-Pantechnicon
[2017-01-14 14:25:59] WARNING[12552] pbx_config.c: The use of '
.’ for an extension is strongly discouraged and can have unexpected behavior. Please use ‘X.’ instead at line 3131 of /etc/asterisk/extensions_additional.conf
[2017-01-14 14:25:59] VERBOSE[12552] pbx.c: Added extension '
.’ priority 2 to from-trunk-sip-Pantechnicon

Pantechnicon’ tries to include nonexistent context 'from-trunk-sip-Pa[2017-01-14 14:25:59] WARNING[12552] pbx.c: Context ‘from-trunk-sip-ntechnicon-custom’

If your DNS is failing you in this specific set of actions, I’d probably want to make sure that is working before you try to troubleshoot anything else.

Here’s some testing I’ve done regarding DNS. Any feed back is greatly appreciated. Thanks Michael

cat /etc/resolv.conf

Configuration automatically generated via Sysadmin RPM

MODIFICATIONS TO THIS FILE WILL BE OVERWRITTEN.

Generated at: Sun, 15 Jan 2017 14:12:39 +0000

nameserver 127.0.0.1
nameserver 192.168.2.1
nameserver 4.2.2.2

Confirms that UDP Port 53 is open
nmap -sU -p 53 4.2.2.2
Starting Nmap 5.51 ( http://nmap.org ) at 2017-01-16 20:09 EST
Nmap scan report for b.resolvers.Level3.net (4.2.2.2)
Host is up (0.031s latency).
PORT STATE SERVICE
53/udp open domain

Confirms that TCP port 53 is open
nmap -sT -p 53 4.2.2.2
Starting Nmap 5.51 ( http://nmap.org ) at 2017-01-16 20:12 EST
Nmap scan report for b.resolvers.Level3.net (4.2.2.2)
Host is up (0.032s latency).
PORT STATE SERVICE
53/tcp open domain

Test of name resolution to Google.com
dig google.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6_6.3 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4104
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com. IN A

;; ANSWER SECTION:
google.com. 58 IN A 216.58.219.206

;; Query time: 29 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Jan 16 20:18:58 2017
;; MSG SIZE rcvd: 44

Test Authoritative DNS Server
whois google.com | grep -i "name server"
Name Server: ns2.google.com
Name Server: ns3.google.com
Name Server: ns4.google.com
Name Server: ns1.google.com

Network Script
localhost network-scripts]# cat ifcfg-eth0

FreePBX Sysadmin Generated network configuration.

This file was generated at 2017-01-15T14:52:22+00:00

DEVICE=eth0
BOOTPROTO=static
ONBOOT='yes’
IPADDR=192.168.2.2
NETMASK=255.255.255.0
GATEWAY=192.168.2.1

I’ve figured it out and got the SIP trunk to register.

Thanks
Moderator, this can be closed.

Michael, what did you do to get it to register? Please share your findings. I’m having the same issue (can’t register).
Thanks

Hi Joao
Sorry it took so long to get back to you. In my case I was looking at old screen shot documentation and missed the “Registration String” found in Connectivity > Trunks > Your SIP Trunk > SIP Settings > Incoming Tab. This is in addition to the the “Peer Details” found under Connectivity > Trunks > Your SIP Trunk > SIP Settings > Outgoing Tab. Hope this helps.