Inter Tenant Dialing

Status
Not open for further replies.

Timothy J. McGary

New Member
Jul 21, 2017
20
1
3
68
I have read all I could find on the forum (two articles) but still do not have any idea on exactly how to make this work...If I tell my local call rule (i.e. hard code domain name in) to dial another domain it works, my difficulty is getting it to work from the dial pad. I have three related tenants on my switch that would like to cross tenant dial. Each tenant has a series of extensions 1xx, 2xx, etc. I am trying to have a rule for each tenant that would allow them to dial a ext like 1101 would reach extension 101 of domain 1 from domain 2, and 2101 would reach ext 101 of domain 2 from domain 1. I understand it is a dial plan that lives in front of local_extension. I am looking for a way to add a statement which would strip away the leading number in a 4 digit extension, assign it to a variable and, then use that variable to set the domain name, using a conditional statement, then dial the extension (remaining three digits) in the defined domain.
 

Timothy J. McGary

New Member
Jul 21, 2017
20
1
3
68
Yes, although they are related entities i.e. owned by different family members, they are separate entities and are required to be do by the regulations governing their respective industries, so they are very conscious of making sure there is separation even if it is not actually required.
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,073
577
113
Do the others all have individual DIDs? That would be the easy way, then you could just map say 1101 ro transfer to did number of 101 on other domain
 

Timothy J. McGary

New Member
Jul 21, 2017
20
1
3
68
No they do not have DID's. I have, on the stock local_extension dialplan simply changed the line 120 to read "domain_name=xxx.xxxx.net" (where x's are another domain name) and it will dial cross domain. I am trying to figure out how to programically change that variable base on a four digit extension no. with the leading number being stripped. I think it might be a function of a lua (which appears to be a script routine) call but do not have enough experience to be sure. Thanks
 

Jim Lam

New Member
Apr 5, 2017
20
2
3
60
Hi,

I just do a similar thing for some tenants.

To do inter-domain dialling, I do the following in an outgoing route:

1. use a prefix like in the destination number: ^\*64\*(\d{3})$ <- I am using *64* as the prefix, and we are using 3 digit extensions
2. The other normal call setup like callee_id_number, etc.
3. set the domain_name variable to the target domain
4. set the domain_uuid variable to the target domain's uuid
5. transfer $1 XML ${domain_name}

Hope that helps.
Jim
 

Timothy J. McGary

New Member
Jul 21, 2017
20
1
3
68
I think I understand about 1/2 the dial string aspect. I am still trying to figure out the balance of the setup you suggest. If I set up an outgoing route it asks me for a gateway in the setup process,. if I leave blank it will not let me proceed. could you post your compete route (obviously redacting any inside information)

Thanks.
 
  • Like
Reactions: cengbrecht

Jim Lam

New Member
Apr 5, 2017
20
2
3
60
I just go thru the motion of setting up an outgoing route, and then go in there and change it to my needs.

Please see the screen capture attached for the entire route, obviously I had removed the domain_name and domain_uuid fields.

Cheers

Screen Shot 2017-08-18 at 12.02.03 pm.png
 
  • Like
Reactions: tyler2p

Timothy J. McGary

New Member
Jul 21, 2017
20
1
3
68
Thanks. Did all that and it is ringing to local domain, I think it has to do with the UUID. Googled and can't find how to ascertain the UUID. I thank you for your help.
 

Jim Lam

New Member
Apr 5, 2017
20
2
3
60
To ascertain the UUID, login to FusionPBX, under "Administration" - "Adminer", then on the left column, look for "v_domains", click on it.

Then on the right side, click on "select data", and you will see a list of all domains, with domain_name and domain_uuid.

Regards
 

Timothy J. McGary

New Member
Jul 21, 2017
20
1
3
68
Jim, first thank you so much for your input it has been invaluable, I finally got back to this and made changes you suggested and it works like a champ...but...when dial your same number on the remote domain it goes straight to their voice mail and asks for a password. For example my number extension is 102 I have my dial string set to 1*xxx to dial remote tenant. When I dial 1*102 I get her voicemail asking for password (I know its hers because when I put in my vm password I get an error)...
 

Timothy J. McGary

New Member
Jul 21, 2017
20
1
3
68
figured it out I think the caller_id_number settign cannot be the same. Adding a rule of "action set caller_id_number=888" resolved the issue. I don't know how it will effect the display on other end but that is for another day. thanks again for your help
 

AIC2000

Member
Feb 15, 2018
162
3
18
35
Is there a way to (for example) if you know you have an inbound route of 212-34 56-7890 for example, and any tennant dials out that number, that FusionPBX / Freeswitch could say "that number is hosted here" and route it internally, rather than out via a trunk? (To effectively provide free calls?)
 

c0reM

New Member
Jan 19, 2017
12
1
3
74
I'm also wondering about making such a dialplan on the outbound routes. Looking over my termination, I was surprised to find that about 3% of our total outbound calling costs are inter-tenant. Actually now that I think about it it also consumes an inbound channel as well which is kind of silly. Anyways, it's not significant but it would be interesting to provide a direct HD audio path inter-tenant without going out to the POTS and if we can save 3% on termination costs at the same time too, why not? :D
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,073
577
113
On a multitenant single box, in dialplan manager there is a a dialplan named 'is_local' that is disabled by default. If you enable this, calls to the other tenant will not go out of the PBX but the number dialled must match the DID exactly.
 

AIC2000

Member
Feb 15, 2018
162
3
18
35
That sounds cool!

Are there any downsides to this?
Is there a way to alias other DID formats to make it slightly more dynamic? (Like someone dialling using international format)
 
  • Like
Reactions: cengbrecht

tag915

Member
Sep 24, 2018
67
6
8
This works but it doesn't seem to follow outbound route rules.

For example:

The DID is set as 12145551212.
We have outbound route rules for local calling in the 214 area code.
The number dialed is 5551212 and the outbound route adds the 1214 before sending to the gateway.

If another user dials 12145551212 it does use the "is_local" and route internally. However if they use the 7 digit dialing of 5551212 then it still goes out through our gateway.

Can someone explain the call flow here? I'm assuming the Outbound Route is never processed for these "local" calls. So is there a way to accomplish the same thing when its a "local" call as we do with the Outbound Route?

Also should the is_local be set as a Global setting or kept as a domain setting?
 

Len

Member
Mar 8, 2017
95
3
8
52
You can get around around it by editing "index.lua" (/usr/share/freeswitch/scripts/app/is_local). Change the line sql = sql .. "WHERE destination_number = :destination_number " to something like sql = sql .. "WHERE destination_number LIKE :%destination_number ". This will just match the end of the DID instead of the entire. Perhaps you need to get the correct synthex as I'm not sure what the : does..
 
Status
Not open for further replies.