The number you have dialled is not in service

Hi everyone,

I am trying to set up my Freepbx system to work with my trunk provider. Currently it works with the trunk provider, however this is when I have the trunk provider SIP Endpoint set to static IP, and i write in my public IP address.

The problem is my ISP keeps giving me new IPs. I have asked them for a static one, and they currently are not able to although they said to check back in a few days.

So every time our IP changes, customers cant ring until I go in and manually change it.

I am trying to get the trunk provider SIP Endpoint to work in ‘Dynamic’ mode.

Currently when I ring my business number, instead of going to the inbound route destination as it does with Static, it says ‘the number you have dialled is not in service’.

One line of the logs shows in red writing, perhaps this is the error or problem?

[2022-09-08 22:37:34] ERROR[15226][C-000000b8] pbx_functions.c: Function SIP_HEADER not registered (this line is in red)
[2022-09-08 22:37:34] VERBOSE[15226][C-000000b8] pbx.c: Executing [[email protected]:3] Log(“PJSIP/GT_test-000002bc”, "WARNING,Friendly Scanner from ") in new stack
[2022-09-08 22:37:34] WARNING[15226][C-000000b8] Ext. s: Friendly Scanner from
[2022-09-08 22:37:34] VERBOSE[15226][C-000000b8] pbx.c: Executing [[email protected]:4] Wait(“PJSIP/GT_test-000002bc”, “2”) in new stack
[2022-09-08 22:37:36] VERBOSE[15226][C-000000b8] pbx.c: Executing [[email protected]:5] Playback(“PJSIP/GT_test-000002bc”, “ss-noservice”) in new stack
[2022-09-08 22:37:36] VERBOSE[15226][C-000000b8] file.c: <PJSIP/GT_test-000002bc> Playing ‘ss-noservice.ulaw’ (language ‘en’)

Thank you for your help.

EDIT: In trunks → my trunk → pjsip settings, if I change ‘Context’ to from-pstn-toheader, it seems to now hit the inbound route. However, it will not make a call and it goes straight to voicemail. In fact it actually goes to a voicemail of a different user than that which is set as the inbound route destination…?! I have ext 1 set as the inbound route destination so it should ring ext 1. However, it instantly goes to the voicemail of ext 2

I think by dynamic you mean that Asterisk registers with the provider, and by static, that the provider matches you by IP address.

The provider isn’t sending the DID in the user part of the request URI. Normally this will be what you set in the Contact User setting.

If it is being misrouted from the To header, that suggests the To header doesn’t contain the DID, either. That would have to be addressed at the provider end.

You need to use pjsip set logger on to find out what you are actually receiving.

“I think by dynamic you mean that Asterisk registers with the provider, and by static, that the provider matches you by IP address.”

Yes that is correct.

Something weird is happening, it seems to be unable to allow calls. I am getting the extension to ring for like a moment and it instantly goes to voicemail, it ends so fast i cant even answer it

It seems to be getting to the right inbound route, but it instantly goes through the ring groups and straight to the final destination (voicemail) instead of ringing the phones and allowing an answer

edit: In call event log, here is the call coming in. It all seems to start and end within a few seconds