We have configured a Bulgarian trunk for inbound calls for Bulgarian residents. This was first set up several years ago. Sometime in the last 8-12 months it stopped working. Part of the reason it has gone this long is we have few Bulgarian callers, and also it seemed to start working by itself a few times. But lately it never works. We reviewed everything with the trunk provider (Avoxi), tried different tests, to no avail.
We are consistently getting this error, the only variation being alternating between 2 Avoxi addresses. No one at Avoxi knows what is causing this rejection or how to resolve it. Neither does any online documentation or forum search bring me any light.
res_pjsip_session.c: anonymous: Call (TCP:104.196.177.56:5060) to extension '+35932571240' rejected because extension not found in context 'from-sip-external'.
This is the general pjsip settings. No, authentication is not required, and, yes, I have tried using dummy auth credentials, with no change in behaviour.
The trunk isn’t being recognized. That probably means that trunk-production-us1.avoxi.com doesn’t resolve to any address that corresponds to the one from which the request is actually coming. You need to set Match/Permit to include all the address ranges from which the provider can send to you.
It might also be a SIP ALG (application level gateway) in the router, meaning call appears to come from the router. These should be disabled.
Thanks for your reply. The 2 addresses that the requests come from are both in Match/Permit. They are in the format of 104.196.177.203/32, 104.196.177.56/32
At the Asterisk command prompt, type pjsip set logger on
make a test call (from an outside number such as your mobile) to one of the BG numbers, paste the Asterisk log for the call at pastebin.com and post the link here.
Hello,
Can you check if your trunk is registered in Report => Asterisk Info => Registries => PJSIP
If ok it should look like : trunk_provider/sip:hostname:PORT Provider_name Registered (exp. XXXs)
where trunk_provider is the name of your trunk provider, hostname the name of the server, PORT the port for the SIP server and XXX the time in s since last connection
If yes, you could try to do a broad outbound route to be sure to accept any call like :
Have you tried to set a wild card inbound route for the dial pattern, like that you could test if it is the dial pattern that is the problem, also have you added informations like the header,
(in the trunk => PJSIP Settings => Advanced)
Contact User : +4127xxxyy00 (your phone number)
From Domain : swisscom.ch (same as server domain name)
From User : +4127xxxyy00 (your phone number)
For those settings :
I used ChatGPT to try to understand why from-sip-external is a problem. It recommended adding a rule for this phone number to the from-sip-eternal context. In the process, I discovered that Asterisk uses this context for anonymous calls, with the default action being reject.
Here’s the rule I added to extensions_custom.conf. Incoming calls on this trunk work now.
Yes. That’s the basis on which I’ve been working, but the problem I’m trying to solve is why it is it being considered anonymous, rather than given that it is, how to you get it back into the normal processing route.