Skip to main content

Outbound route filtering per extension

Posted by Lansalot on Thu, 08/04/2016

Hi
I have a similar request to this:
https://www.thirdlane.com/forum/multiple-outbound-routes

However I would like to explain a little differently. We have a serviced offices where we answer calls for the other offices, but we need them to be able to pay for their own outbound calls. I presume that we can't have extensions from tenant 1 in a hunt group that belongs to tenant 2?

At present we have the setup working nicely on FreePBX using where all extensions are part of the same FreePBX system (not multi-tenant as such) and we use outbound route CID matching to route the outgoing calls. So for example office 1 has extensions 2101 and 2102 so their outbound route goes like this:
prepend: 44
Prefix to remove: 0
match pattern: [123578].
Caller ID: 21XX
Trunk: Office1 Trunk

This means the billing is done by the billing system, not by using CDR Prefixes and end-of-month CDR processing, which also means realtime credit limits work.

Would there be a way to achieve this maybe with an outbound route script?


Submitted by netriplex on Tue, 08/16/2016 Permalink

Allowing extensions from 1 tenant to be used in features from a different tenant in a lot of ways defeats the entire definition of what constitutes multi-tenant. Nevertheless, there are a couple ways you can accomplish what you are after...

Using Single Tenant Edition:
1. Use outbound dialing permissions and outbound dialing "prefixes" to have different dialing patterns for each company so that each is billed for their own outbound calls while preserving all extensions as a single tenant for use in hunt groups, etc. For example, company A is extensions 2100-2109 and company B is extensions 2200-2209. You inform company A that in order to dial out they must dial 8 and the 10 digit number and company B that they must dial 9 and the 10 digit number. You create 2 outbound routes (8/9)NXXNXXXXXX and assign each to the correct trunk that the company is being billed for. Then in the dialing permissions you create an Allow All rule _X. so that all dialing patterns are accepted by default and then you create 2 deny rules. For company A who is supposed to prefix their calls with 8, you set the matching origination pattern to _21XX and the destination pattern to _9X. to deny. You then create the opposite for Company B, origin pattern _22XX and destination pattern _8X. This will prevent each set of extensions from using the other companies trunk. This can be extended to any number of companies although for a large company count this becomes increasingly complex.
2.

Using Multi-Tenant Edition:

2. If it is not necessary to have cross-company extensions in the same queues, you can separate all companies out as individual tenants and when needed to include an "Extension" from a different company in a hunt group, you can use the "other phone numbers to dial field" to input DIDs assigned to the extensions in the other "tenants". This will include these additional extensions in the hunt group. Further, there is a global variable option that can be set in later versions of Thirdlane that prevents using the external trunks in the event a DID is local to the server across tenants, so using this method would not incur any additional billing. If you wanted to get a little fancier you could actually create a dedicated loopback trunk and create "fake" DIDs as virtual extensions to allow cross-company calling using a outbound route that your "fake DID" pattern to send calls to your loopback trunk.

2 ways to do this...