Hey Majren, I am having the same issue as yours, i have created an Inbound route for a SIP trunk, and the calls are not getting connected. Will you be able to tell me how you fixed your issue ? Please
Incoming calls through a SIP trunk is not taking the correct context and taking “from-internal” context automatically, even if it is set up for “from-trunk” context.
Inbound Route :-
DID Number = 9000
Destination : Extension 2723 (This is an extension in FreePBX)
Here in the user-details for the sip trunk, the context for all the incoming calls is set to “from-trunk”, but when any incoming call is made, it uses “from-internal” only and does not use “from-trunk” at all. Because of this :-
We are able to call the extensions in FreePBX directly without any Inbound Routes.
Log1 is attached for this call, where the extension 2723 in CUCM is able to call Extension 2723, without any inbound Route config, since it uses “from-internal” context.
We are NOT able to call anything configured in the Inbound Routes. Since the INBOUND route uses “from-trunk” context
The Inbound Route has a DID : 9000, which in turn calls the extension 2723 in FreePBX. But since the number 9000 is searched in the “from-internal” context, it never works.
Log2 is attached for this call, where the extension 2723 in CUCM is trying to call 9000 in FreePBX, 9000 is a DID for an Inbound Route, it uses “from-internal” again as the context and gets a fast busy. The error message 503 Service Unavailable is sent to the CUCM. The FreePBX should have used “from-trunk” to search for the DID 9000. If it had done that, it would have followed the dial-plan below
=========================================================================
Below is the output : dialplan show 9000@from-trunk
[ Included context ‘ext-did-0002’ created by ‘pbx_config’ ]
‘9000’ => 1. Set(__FROM_DID=$
{EXTEN}) [pbx_config]
The CUCM cannot have a SIP trunk which needs registration and nor can it authenticate when challenged.
So the trunk between CUCM and the Asterisk has no Secret set, and it has “allow Anonymous calls” on.
According to the developers in FreePBX, if it is configured in such a way, the FreePBX will consider the SIP trunk to be internal and search for the call flow in “from-internal” context, even though it has been set to use “from-external”.
User Details :-
host=20.1.1.170
type=friend
context=from-trunk
This seems to be a buggy behaviour but as per FreePBX it is working as per design.
The Above calls were not working, since the DIDs in Inbound Routes are in “from-external” context.
Whereas when a call comes from the SIP trunk, it tries to search the context “from-internal”,
Here are the Trace snippets :-
[2015-09-21 04:23:01] VERBOSE[11160][C-0000001c] chan_sip.c: Looking for 2723 in from-internal (domain 20.1.1.59)