Asterisk connected external SIP trunk provider

I have setup a Asterisk SIP server on a Ubuntu machine. Asterisk is setup to start when machine boots.

I have registered with the external SIP provider to make receive external calls.

Every thing works fine I could make/receive internal and external calls.
Except when the machine shuts down and boots again Asterisk also starts, and I can make and receive calls on my internal extensions but I can not receive or make external calls until I login to Ubuntu machine and restart the Asterisk by following “asterisk restart”.

Please advice what is causing the problem?
Thanks

I think that is likely to involve interactions with routers and dynamic IP addresses. I suspect, for some reason, Asterisk is started before it is able to determine its public address.

Thanks David for the prompt reply. It means Asterisk get started before O/S connect to the network.
Is there a possibility to delay start the Asterisk or Is there any other alternative to fix this issue?

Thanks once again.

JR

That is something you have to do in the OS configuration/ It varies from Linux distribution to distribution. Also, this sequencing should normally be correct. The fact that it isn’t suggests an interaction with an external system of which the OS startup code is unaware.