My inbound routes come from twillio and are anonymous as there is no registration.
I cannot find where I can set the default inboud sip content globally or in the inbound routes.
The extensions.conf states the below but I cannot find this setting.
;-------------------------------------------------------------------------------
; from-sip-external
;
; This context is the default SIP context unless otherwise changed in the SIP
; Settings module
It is inbound not outbound. Trunks are for outbound correct?
I get in my logs:
[2025-02-24 16:10:50] NOTICE[17176] res_pjsip_session.c: anonymous: Call (UDP:XXX.XXX.XXX.XXX:5060) to extension ‘+1XXXXXXXXXXX’ rejected because extension not found in context ‘from-sip-external’.
I have “Allow Anonymous Inbound SIP Calls” in sip settings enabled so this should come though.
A trunk is to connect your FreePBX instance to your provider. It is for both inbound and outbound. from-pstn is the default context for trunks. The error message you posted is normally due to a misconfigured trunk or no trunk configured for that provider.
But with “Allow Anonymous Inbound SIP Calls” it should work regardless no?
Here is the doc from the setting
“Allowing Inbound Anonymous SIP calls means that you will allow any call coming in form an un-known IP source to be directed to the ‘from-pstn’ side of your dialplan. This is where inbound calls come in. Although FreePBX severely restricts access to the internal dialplan, allowing Anonymous SIP calls does introduced additional security risks. If you allow SIP URI dialing to your PBX or use services like ENUM, you will be required to set this to Yes for Inbound traffic to work. This is NOT an Asterisk sip.conf setting, it is used in the dialplan in conjuction with the Default Context. If that context is changed above to something custom this setting may be rendered useless as well as if ‘Allow SIP Guests’ is set to no.”
The allow anonymous option was basically used when you had a provider that could source calls from a large number of different addresses, and you were using chan_sip. Now that you should be using chan_pjsip, normal users (those that rely on providers for incoming traffic) should not need to use it, and should not use it, as the “match/permit” option allows multiple addresses and address ranges to be specified. This also means the pair of inbound and outbound settings commonaly used with chan_sip (even when not actually needed) should not be needed with chan_pjsip.
Also, from the error message, the calls are being delivered to the from-sip-external context, but you have failed to configure an inbound route, which matches +1XXXXXXXXXXX.
Not sure what to say the +1XXXXXXXXXX is exactly what is in the DID for the inbound route. I copy and pasted from the log into the inbound route. The issue is I see they are under from-pstn but the sip calls are hitting from-sip-external looking at the generated config files.
Regarding the match/permit where are those specified? I see no option to do so for the trunk. Do you mean in
I do thank you for your insight. It used to work but upgrade to the newer Freepbx and seem to have issues.
EDIT:
Fond it. There were 2 issues. One the inbound prefixes not longer needed the leading +!, and someone kindly changed the snat on our router so the wrong source ip address was being provided so the matching would not work. Thanks for giving that hint.