[Help] Asterisk won't load Trunk after system restart

So I am currently having an issue where I can be running Asterisk (Raspberry Pi 3) perfectly fine with all my SIP phones working properly and outbound and incoming calls working perfectly. However, if I restart my PI while the asterisk service does indeed start (as can be seen by running ps -A, and checking logger) I can only make internal calls and no outbound or incoming calls will work. When I check the logs here is what is inside:

[Apr 3 01:44:29] Asterisk 11.13.1~dfsg-2+b1 built by buildd @ bm-wb-03 on a armv7l running Linux on 2015-01-08 19:21:28 UTC
[Apr 3 08:44:13] Asterisk 11.13.1~dfsg-2+b1 built by buildd @ bm-wb-03 on a armv7l running Linux on 2015-01-08 19:21:28 UTC
[Apr 3 08:44:13] NOTICE[641] loader.c: 3 modules will be loaded.
[Apr 3 08:44:13] NOTICE[641] res_smdi.c: Unable to load config smdi.conf: SMDI disabled
[Apr 3 08:44:13] NOTICE[641] res_smdi.c: No SMDI interfaces are available to listen on, not starting SMDI listener.
[Apr 3 08:44:13] WARNING[641] res_phoneprov.c: Unable to load users.conf
[Apr 3 08:44:13] ERROR[641] config_options.c: Unable to load config file ‘acl.conf’
[Apr 3 08:44:13] NOTICE[641] manager.c: Unable to open AMI configuration manager.conf, or configuration is invalid.
[Apr 3 08:44:13] NOTICE[641] cdr.c: CDR simple logging enabled.
[Apr 3 08:44:13] WARNING[641] cel.c: Could not load cel.conf
[Apr 3 08:44:13] ERROR[641] config_options.c: Unable to load config file ‘udptl.conf’
[Apr 3 08:44:13] NOTICE[641] udptl.c: Could not load udptl config; using defaults
[Apr 3 08:44:13] WARNING[641] ccss.c: Could not find valid ccss.conf file. Using cc_max_requests default
[Apr 3 08:44:13] WARNING[641] ccss.c: Could not find valid ccss.conf file. Using cc_[state]_devstate defaults
[Apr 3 08:44:13] NOTICE[641] loader.c: 19 modules will be loaded.
[Apr 3 08:44:14] ERROR[641] netsock2.c: getaddrinfo(“sanjose2.voip.ms”, “(null)”, …): Temporary failure in name resolution
[Apr 3 08:44:14] WARNING[641] acl.c: Unable to lookup ‘sanjose2.voip.ms
[Apr 3 08:44:14] WARNING[641] acl.c: Cannot connect
[Apr 3 08:44:14] WARNING[641] chan_sip.c: sip_xmit of 0x56e5ce40 (len 560) to 192.168.1.148:5060 returned -2: Network is unreachable
[Apr 3 08:44:14] ERROR[641] chan_sip.c: Serious Network Trouble; __sip_xmit returns error for pkt data
[Apr 3 08:44:14] WARNING[641] acl.c: Cannot connect
[Apr 3 08:44:14] WARNING[641] chan_sip.c: sip_xmit of 0x56e6c498 (len 560) to 192.168.1.148:5070 returned -2: Network is unreachable
[Apr 3 08:44:14] ERROR[641] chan_sip.c: Serious Network Trouble; __sip_xmit returns error for pkt data
[Apr 3 08:44:14] WARNING[641] acl.c: Cannot connect
[Apr 3 08:44:14] WARNING[641] chan_sip.c: sip_xmit of 0x56e7b5f8 (len 560) to 192.168.1.148:5080 returned -2: Network is unreachable
[Apr 3 08:44:14] ERROR[641] chan_sip.c: Serious Network Trouble; __sip_xmit returns error for pkt data
[Apr 3 08:44:14] WARNING[641] acl.c: Cannot connect
[Apr 3 08:44:14] WARNING[641] chan_sip.c: sip_xmit of 0x56e8a760 (len 560) to 192.168.1.148:5090 returned -2: Network is unreachable
[Apr 3 08:44:14] ERROR[641] chan_sip.c: Serious Network Trouble; __sip_xmit returns error for pkt data
[Apr 3 08:44:14] WARNING[652] acl.c: Cannot connect
[Apr 3 08:44:14] WARNING[652] chan_sip.c: sip_xmit of 0x7640bd98 (len 560) to 192.168.1.148:5060 returned -2: Network is unreachable
[Apr 3 08:44:14] ERROR[652] chan_sip.c: Serious Network Trouble; __sip_xmit returns error for pkt data
[Apr 3 08:44:14] WARNING[652] acl.c: Cannot connect
[Apr 3 08:44:14] WARNING[652] chan_sip.c: sip_xmit of 0x76414d08 (len 560) to 192.168.1.148:5070 returned -2: Network is unreachable
[Apr 3 08:44:14] ERROR[652] chan_sip.c: Serious Network Trouble; __sip_xmit returns error for pkt data
[Apr 3 08:44:14] WARNING[652] acl.c: Cannot connect
[Apr 3 08:44:14] WARNING[652] chan_sip.c: sip_xmit of 0x764145b0 (len 560) to 192.168.1.148:5080 returned -2: Network is unreachable
[Apr 3 08:44:14] ERROR[652] chan_sip.c: Serious Network Trouble; __sip_xmit returns error for pkt data
[Apr 3 08:44:14] WARNING[652] acl.c: Cannot connect
[Apr 3 08:44:14] WARNING[652] chan_sip.c: sip_xmit of 0x76427050 (len 560) to 192.168.1.148:5090 returned -2: Network is unreachable
[Apr 3 08:44:14] ERROR[652] chan_sip.c: Serious Network Trouble; _sip_xmit returns error for pkt data
[Apr 3 08:44:14] ERROR[667] netsock2.c: getaddrinfo(“sanjose2.voip.ms”, “(null)”, …): Temporary failure in name resolution
[Apr 3 08:44:14] WARNING[667] acl.c: Unable to lookup ‘sanjose2.voip.ms
[Apr 3 08:44:14] WARNING[667] acl.c: Cannot connect
[Apr 3 08:44:14] WARNING[667] chan_sip.c: sip_xmit of 0x76430568 (len 391) to (null) returned -1: Invalid argument
[Apr 3 08:44:14] WARNING[667] chan_sip.c: sip_xmit of 0x76430568 (len 391) to (null) returned -1: Invalid argument
[Apr 3 08:44:15] WARNING[667] chan_sip.c: sip_xmit of 0x76430568 (len 391) to (null) returned -1: Invalid argument
[Apr 3 08:44:17] WARNING[667] chan_sip.c: sip_xmit of 0x76430568 (len 391) to (null) returned -1: Invalid argument
[Apr 3 08:44:21] WARNING[667] chan_sip.c: sip_xmit of 0x76430568 (len 391) to (null) returned -1: Invalid argument
[Apr 3 08:44:25] WARNING[667] chan_sip.c: sip_xmit of 0x76430568 (len 391) to (null) returned -1: Invalid argument
[Apr 3 08:45:43] WARNING[667] chan_sip.c: Retransmission timeout reached on transmission 127fe0c505e3df646aa8ce7060f68f23@127.0.1.1 for seqno 102 (Critical Request) – See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 89679ms with no response
[Apr 3 08:45:44] NOTICE[667] chan_sip.c: – Registration for ‘185786@sanjose2.voip.ms’ timed out, trying again (Attempt #2)
[Apr 3 08:47:05] WARNING[814][C-00000000] app_dial.c: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
[Apr 3 08:49:33] Asterisk 11.13.1~dfsg-2+b1 built by buildd @ bm-wb-03 on a armv7l running Linux on 2015-01-08 19:21:28 UTC
[Apr 3 08:49:33] NOTICE[817] loader.c: 3 modules will be loaded.
[Apr 3 08:49:33] NOTICE[817] res_smdi.c: Unable to load config smdi.conf: SMDI disabled
[Apr 3 08:49:33] NOTICE[817] res_smdi.c: No SMDI interfaces are available to listen on, not starting SMDI listener.
[Apr 3 08:49:33] WARNING[817] res_phoneprov.c: Unable to load users.conf
[Apr 3 08:49:33] ERROR[817] config_options.c: Unable to load config file ‘acl.conf’
[Apr 3 08:49:33] NOTICE[817] manager.c: Unable to open AMI configuration manager.conf, or configuration is invalid.
[Apr 3 08:49:33] NOTICE[817] cdr.c: CDR simple logging enabled.
[Apr 3 08:49:33] WARNING[817] cel.c: Could not load cel.conf
[Apr 3 08:49:33] ERROR[817] config_options.c: Unable to load config file ‘udptl.conf’
[Apr 3 08:49:33] NOTICE[817] udptl.c: Could not load udptl config; using defaults
[Apr 3 08:49:33] WARNING[817] ccss.c: Could not find valid ccss.conf file. Using cc_max_requests default
[Apr 3 08:49:33] WARNING[817] ccss.c: Could not find valid ccss.conf file. Using cc
[state]_devstate defaults
[Apr 3 08:49:33] NOTICE[817] loader.c: 19 modules will be loaded.

It appears to me that for some reason it can not find the trunk, however, as can be seen from the log, if I do a restart of asterisk it immediately starts working without an issue.

Can anyone help me troubleshoot this?

Looks like you are starting Asterisk before you have started the networking and DNS.

Looks like that’s it.
While I know this isn’t relevant to Asterisk would doing this fix the issue?

Change /etc/init.d/asterisk
Required-Start: $network $remote_fs

Then,
update-rc.d

Would that help?

I’m not familiar with that startup mechanism, but just from the names of things it might well do.

bridges86406, what distro are you using on your RPi3? I’m using RasPbx on my RPi2 and it doesn’t have that startup script. Did you compile from scratch?

Sorry I missed your reply. I’m using standard Raspbian OS.

Well RasPBX is a customized distro so I assume they used a different startup mechanism.