I have some non-geographic numbers that, if routed via SIP, are delivered free.
To test this I have set-up the routing for a number to be delivered to [email protected] which is delivered to the extension with sip_alias.
This is all working OK, but it does mean I can’t do any call filtering, e.g. on CLI, or routing to call groups, etc.
The number supplier does not support SIP trunks, so my question is, does anyone know if FreePBX can be configured for calls routed to [email protected] to actually be delivered to a destinations other than the sip_alias? If so how?
You can of course tune the CODEC etc. They may be using other fields to put the domain data so it is important to review all the variables available for a trunk.
The idea is to build a trunk with the least number of parameters that you need to uniquely identify the peer.
I’m not completely clear on what you’re asking, but if you want FreePBX to be able to route inbound calls to a SIP ALIAS, you just need to create a trunk to accept inbound calls or allow anonymous inbound SIP calls, and then you can configure a SIP Alias in the extension settings.
If you want to place an outbound call to SIP ALIAS, you set up a custom trunk with the dial string
Then, you can set-up an inbound route for 2125551212 and the calls will be routed using that inbound route.
To ensure that your system will accept those calls, you either need to allow anonymous inbound calls in the general settings, or set-up a basic trunk that will tell FreePBX to accept the calls:
Where sip_alias is the alias specified for an extension in FreePBX (and is the only place I’ve found sip_alias is able to be set) and “Allow Anonymous Inbound SIP Calls” is set to yes. The rest of @domain.com is one of my domains which points to the PBX. So there are no third parties involved with the [email protected] address.
This is all working.
But because the calls (inbound only as the number supplier does not support outbound calls in this case) are delivered directly to the extension (of sip_alias) FreePBX can’t route the call based on CLI or deliver to a ring group.
From previous experience I would expect this to have been possible by setting up a SIP trunk, but I’ve not defined a trunk where I owned [email protected] rather than a third party.
As I would like to be able to have more control of the call I asked my original question.
If your sip_alias is a number, any number, you can place that number into an inbound route and inbound calls will be delivered to the destination specified in that route.
OK - while I’m sure there are a number of solutions to this, while looking at the call logs as calls were being presented I finally had the penny dropping moment.
Given I could see “DID=sip_alias” I changed the config so that the number delivery is presented as:
Great job, I should have added that the real reason for doing this is so the trunk name is properly displayed in call traces and CDR’s. Also allows you to route calls to a custom context. Something you can’t do if you don’t have a working trunk.
Also changed the SIP address to [email protected] to remove the need for a DNS lookup. I did this as some of the inbound calls take a long time to arrive. Though it does not look like DNS was the culprit.