How do we prevent internal calls from going out to the trunk and back in when users dialing 10 digits instead of extension?

Status
Not open for further replies.

Ryan_VIQ

Silver Partner
Advanced Certified
Joined
Jul 10, 2019
Messages
19
Reaction score
3
If this feature doesnt exist it probably should. Lets set the scene:

Normally this isnt an issue. If location A in 1 city wants to call location B in a different city, instead of referring to a company directory and dialing the RG for that store, they dial the full 7 or 10 digit number because they have it memorized. The call goes out our voip provider, back in our voip provider, routes location B's RG, nobody knows any different.

Well one of our voip providers is having issues tracking down the issue for why this doesnt work. I tore apart and followed 3 wireshark captures (phoneA - SBC A), (phoneB - SBC B), and the 2 calls that were (cloud based 3CX to voip provider) and everything looks great on call setup and the first 2 seconds of the call. I receive a BYE from the carrier on the outbound call followed by a BYE from same carrier (different sip server) on the inbound call. Im still working on the carrier for this and they were able to fix it so it went from 0% successful calls to 80% successful calls.

Training the users to dial 801 for store A, 802 for store B, etc... yea forget it. Id rather not go on a tirade why but they are the type where "dialing less numbers" is a "serious inconvenience and is unacceptable"

I remember when we were able to use SIP IDs to make aliases but allowing Direct SIP calls opens up some vulnerabilities that we arent willing to sign off on.

Are there any solutions out there that involve setting up IF 7, 10, 11 digit number matches any in this list THEN route to (unknown method) so calls stay internal.???? Is there a 3CX method or some other method using the current version?
 
Ive pondered 2 potential ideas which I am wondering if anybody has done either.

1- Set up a voip provider (say 10004) that just sends call to the main trunk (say 10000) where all these DIDs reside.
1a- set outbound rules to go out 10004 first, if a DID is in 10000's list the call goes through and no packets technically leave the 3cx server. If the called number isnt in that trunk's DID list, it fails, the calls now attempt to go out route 2, 3, so on.
1b- set outbound rules with a call prefix of (10 digit number) to route to 10004 then normal failover routes. I would have to make 3 rules per store (7 10 and 11 digit) and have them above all the normal outbound rules.

2- set up an SBC (not a 3cx one, but an adtran, audiocodes, grandstream, cisco, whatever) that has this table. If the call is in this list of DIDs, it handles sending it to 10000 (or maybe would have to be a separate provider since my 10000 might only be able to communicate with that provider, in this case its IP based, not registration). If the call isnt in this SBC's table, allow it to fail so it goes route 2, or let the SBC take care of it as thats how allworx and other carrier supplied SBCs do it anyways.

3- dial plans at the phone level? I have PTSD from this so Id rather not.

The SBC method is probably a no-go because this is either an Azure or AWS instance.... Id love to know an easy way to do this because I know there are many of my clients that are like this, some of them are massive and cutting down on the un-necessary traffic would be a positive. I have 1 client, close to 1000 extensions, all with their own DID and nobody uses extensions. Their multinational corporate structure doesnt even use extensions but luckily their 3CX all external is on banks of PRIs so I dont have this trunk-to-trunk problem at that site. (each call does eat 2 external channels though)
 
The two common methods to achieve this are making use of the SIP ID for each extension and putting in the dialed number. As long as it matches, the call will ring that extension ignoring the outbound rules. This means you must enable Direct SIP calls, on the PBX.

The other method, is to create new outbound rules, for the numbers dialed and route them to a loop trunk, that uses IP 127.0.0.1 so the call comes right back in. Place these rules above the "catch-all rules. You will have to create inbound rules Each of these calls will use two SC instances, out and in.
 
  • Like
Reactions: YiannisH_3CX
...This means you must enable Direct SIP calls, on the PBX.
I am avoiding Direct SIP like the plague. From what I gathered in my research from this earlier in the year that this opens up some vulnerabilities, which as ChrisC_3CX said: "....this will open the PBX to accept external direct SIP calls too."

Perhaps there's a way to do this which doesn't open this can of worms up? Especially since the cloud instances we have we dont as much ability to police traffic as we would if we were on-prem with our own firewalls. Plus I would have to create 3 phantom extensions for each DID, 7, 10, 11 digit even if Direct SIP was acceptable.

I am currently trying to set up a loop trunk and first few attempts were not successful and havent found any info to help me along. I have found 2 posts from you (2014 and 2022) regarding creating loopback trunks so I am going to take another crack at it and maybe I figure it out. My failed attempts are probably me overcomplicating it.

In finding your posts it looks like everybody seems to always be looking for the same thing. I wonder how many more years we have to wait for this "feature" to be implemented as a core functionality.... /s
 
Ok so I have a Generic SIP Trunk, Registrar & outbound set to 127.0.0.1, IP based auth (auth ID and pw are null), main trunk number 5555555555, inbound set to a destination. At this point there are no DIDs except the fake 5555555555 one on this trunk.

I set an outbound rule, calls from my test extension. out loop trunk, no strip / prepend etc... secondary is out my normal trunk, no strip / prepend.

If I dial my literal cell phone, say 7775551234, I see it go out and in the generic trunk and goes to the endpoint assigned to 5555555555 instead of sending it out route 2.

Ive added an auth ID, removed the outbound proxy, etc... with no change in results.

Im very confused because my route 2, its a provider that is also IP based, uses an auth id, no pw and when I assign a DID to this trunk and dont set it up in 3cx it will just end the call (the intended result that I expected)

How do all the other (almost identical) generic sip trunks using IP based w/ auth ID reject all DIDs that dont exist on the trunk where the loopback one just lets it through? How do you set these loops up?
 
Hi @Ryan_VIQ

Obviously setting up a loopback trunk is not the most tested scenario but it generally works.
The way 3CX does source identification and routes inbound calls is described here.
I would guess that the PBX is able to match a parameter in the call and routes the call to the main trunk number destination.
 
Status
Not open for further replies.

Forum statistics

Threads
111,992
Messages
590,171
Members
164,929
Latest member
Cloudstar