Can't do incoming calls "extension not found in context

Hello,

I’m a newbie.

I setup a FreePBX instance in a VM at my office because the physical PBX we have died abruptly after 9 years of very good service. Physical new PBX cost too much, we don’t need all those features, VM administration is getting us high availability on many different running services and so I’d love to go the VM freePBX route also with VoIP. I also like the interface and the community seems pretty dynamic.

Trunks have been configured and both registered correctly.

Extensions have been configured as well. I have a MicroSIP on desktop to test outgoing and incoming calls, and a physical IP phone to test if extensions can reach each other.

Outbound and Inbound route set.

Call between extensions works.

I can call outside and reach my mobile phone, I cannot call to the office.

Log file says:
[2025-04-22 07:27:00] NOTICE[2219]: res_pjsip_session.c:3985 new_invite: XXXXXXXXXX: Call (UDP:yy.yy.yy.yyy:5060) to extension ‘s’ rejected because extension not found in context ‘from-trunk-sip-XXXXXXXXXX’.

Phone says (don’t know if its FreePBX answering or the SIP server):
“Il numero che hai composto è inesistente” and after that “The number you have dialed is unobtainable”.

I saw the github fix for extension.conf, my extension.conf file is set as the github correction.

SSH to CLI verbose mode does not show anything more than that error message.

After lots of tests I made a new extension ‘237’, removed the old 232, removed it also from groups, removed it everywhere.

In SIP advanced settings I tried to setup:
“Match” – blank, SIP Server public IP, VM IP
“Contect user” – blank, SIP account username, the extension.
“From user” – blank, the VoIP account username
“From domain” – blank, SIP server address
“User = Phone” - both “yes” and “no”

To ease things up I deactivated one of the two trunks, deleted its inbound route and testing only with the one left active. I also got rid of the call groups and set the inbound route to directly go to the active extension.

Inbound route is already set with DID “Any”. Also tried “RINGING/SQUILLO” set to “yes”.

I’m calling both the plain number and with country code +39 (I’m in Italy).

I also tried in my firewall to uncheck/check back “SIP ALG”, and also setup a “Virtual server” plus a simple Port forwarding. Not able to test DMZ because I never used, I’ll try it eventually. I also diabled, for short time, fail2ban.
My first hope is to find a comment on here from a kind person that will be compassionate and tell me how fix this.
Next thing I feel to try is to remove the VM and start from scratch but I don’t think I’ll get a different result.

Thank you to everyone who would take the time to read this.
Cheers,
Alessio

This isn’t a standard context, so we don’t know what extensions it contains.

Please provide the contents of that context, and logs for all the values of Contact User that you have tested.

With the standard context, setting contact user to be the “DID” would normally fix this, assuming only one DID is associated with the trunk. For more than one DID, the alternative standard context, from-pstn-toheader, may help, or you may have to look at the complete request, so see if and where it contains the DID.

1 Like

Hello David,

Thank you very much for the reply!

The content of the string, the part that I cancelled, is just the phone number/username of the SIP server.

I didn’t populate the field, I wrote only inside fields that were blank, I tought were needed and that I supposed I know what they do from the basic experience gained fiddling aroud with the physical PBX, IP phones and softphones. So, I basically filled the strict basic and usual stuff. Only field I overwritten was the extension default/random password.

FreePBX created the context automatically, in the trunk configuration page, with that format: “from-trunk-sip-” + “name of the trunk”. I thounght it was the way it should be and never disputed that.

The first trunk I made has a number provided by EOLO.
The trunk name was “eolo_phoneNumber” and the context was “from-trunk-sip-eolo_phoneNumber

Before to try chaning manually the context field in the existing trunks I tried to create a new one and now the context is “from-pstn”. A truncated version of your suggestion.

Now, the call still don’t come in, but the message from recorded voice is telling something slightly different, first language is english and not italian (which is not there anyway). Maybe it’s FreePBX speaking now and not the provider. Moreover, the log file now shows a lot of stuff. I start getting optimistic.

I’m away from office, doing this via VPN-remote desktop but unfortunately I don’t have more time today to spare on this. I will update the answer after some other trials with the fields “contact user” “from user” and “from domain”.

Keep you updated,
Thank you again,
Alessio