Call from SIP extension to inbound route is internal but uses trunk

When calling from a SIP extension on my system to another SIP extension on the same system I bypass external trunks and route the call internally. However when I dial from the same SIP extension to an number listed as inbound route on my system it uses a trunk and is dialed as an external call. Why? Both numbers are on my system. How would I configure it to not use a trunk and dial it as internal call?

yes but the part that I don’t get is if one side is not setup correctly then I will have problems no matter how I route the call. Maybe I don’t understand the concept but to me if my sip phone is [email protected] and the receiving party is 2126657688 ([email protected]) then a normal call would go out my trunk to e.g. TATA who then would route the call the receiver.com DID provider who would then send the call to [email protected] which is many hoops.

With enum (if I understand correctly) I would get the sip address for 2126657688 and send the call directly to [email protected] bypassing all hoops. This would of course fail if the receiving sip phone is configured wrong but so would all other calls.

Am I missing something?

With enum you are talking directly between the PBXs - effectively an anonymous SIP call.

There are a lot of things you could configure that are proper, work right, and based on your specific provider, that don’t work well otherwise.

Or as an extreme case, someone could have a PRI for their DIDs, register their DIDs also with ENUM, and have crapy QoS because they use their PRI most of the time and haven’t done anything for the QoS. A normal call will come into their PRI and be fine, an ENUM call will be a direct SIP call to their PBX…

yeah and they may not accept anonymous SIP calls if they have direct trunks or PRIs with their providers like PIAF systems. I get it now. Thanks.

interesting comment since I thought enumplus was setup by the freepbx team.

On a technical note though I don’t see the quality issue. Either a number is voip then calls are ultimately routed there via VoIP (and enum just gives us the direct address) or they are not VoIP and it’s routed same as before.

Yes. System overhead would go up significantly since every call has to be checked with enum to benefit from the potential savings so that’s probably a deal breaker for me but I appreciate additional comments especially about my other questions. Thanks everyone.

It doesn’t matter who setup enum to be more overhead.

If you call on your local trunk, you are looking purely within the dialplan. If you use enum, you are going out to the internet to make lookup calls, that is going to be more overhead and more delay.

As far as quality, and other potential issues, it’s pretty straight forward. Hopefully you have maximized the quality and made sure your networking is all setup for you to talk with your trunk providers.

The same goes for the ultimate owner of the number that may go through enum.

Now in theory, with ENUM you could end up having a better quality connection because your rtp packets should stream directly between your PBX and their PBX, thus eliminating latency and potential transcoding that could be happening between your trunk and their ultimate trunk.

However, you can also run into issues where one side or the other does not have things setup right (thus one way/no way audio issues), that QoS has not been setup properly such that these direct calls end up suffering, etc. The crux of all this being, if you run into even a single problem, you may spend more time dealing with the cost of support then the few pennies you may save. Of course if you happen to know you have a high incident of calls that are available through enum then this could be worth the “risk.” But … hopefully that helps understand the “Quality” issue.

I looked at enumPlus and a couple of questions come to mind.

  1. I tried to enter a phone number but the problem is each number has to be verified and since they are live customer numbers, that is not possible.

  2. Can I upload ascii or csv files to add numbers? I would not want to enter 1,000 number one at a time.

  3. does anyone know how many numbers are currently registered with enum plus sources? When I google e.164 it says they registered 100 million numbers back in 2006 but there is nothing later on. I am trying to estimate the potential savings benefit of installing the module.

  4. If we submit all our DIDs to enumplus, would there still be any benefit to run DUNDI on our 3 servers? If understand the functionality correctly, both services tell each machine where a DID is registered.

using enum will add more overhead then what you are currently doing. Also, it is more likely to result in poorer quality calls or other issues if you do find numbers that are available through enum.

For any minimal savings it may give you (given that calls are very inexpensive these days), it’s probably not worth the potential support issues you could run into.

it’s an interesting idea (because of the potential savings) but wouldn’t that add the same overhead to the system as my previous solution since every outbound call would have to be checked against the enum database?

You can also install the EnumPlus module for FreePBX and register all your DID’s with EnumPlus/e164. You add the enum trunk as the first trunk in outbound routes. When you dial one of your own numbers, EnumPlus responds with your own IP address and the call does not go out over the network. You also gain possible savings when calling other numbers which are registered with e164.

Thanks. I did something similar and while it seems to work I am not sure it’s correct. Your comments would be appreciated.

I built a custom trunk “Local/[email protected]” and then put it as first choice on my outbound trunk. The idea is that every call tries the custom trunk first and if the inbound route exists then it loops back into the system. If the inbound route does not exist then the custom trunk fails and it tries the next trunk for that outbound route.

Would this approach cause any errors and/or take up too much system resources?

I don’t want to maintain a list of DIDs that need to be routed to the loop around trunk.

That may work fine though it may have unknown consequences since it is not really “controlled.”

It does add some overhead since I suspect that most of your calls will never use that trunk and it will be running the dialplan each time before going on to other trunks.

You would be best off simply setting the first outbound route to that trunk and using dialpatterns to control it. It would be relatively trivial to generate a script that maintains the patterns for that route in the outbound route’s db table, or a module that hooks the DID module and does that for you any time you add/del/modify a DID.

However, if it works and doesn’t have a noticeable impact and you are not worried at “controlling” the numbers that hit that trunk, then it may be a very clever way of getting what you need with very little work since it is even taking advantage of area code prepending and other manipulation that you may already be doing thus catching numbers whether they dial 7, 10 or 11 digits where as other methods get pretty complicated for that.

You need to build a loop around trunk (custom trunk with Local/[email protected]) in the dial field) then build an outbound route with all your DID’s that is routed to the loop around trunk.