Calls between accounts

145 views
Skip to first unread message

James_259

unread,
Jun 25, 2017, 1:13:22 PM6/25/17
to 2600hz-users
Hi,

I have have seen posts and bits of documentation that touch on this subject in a number of ways.

I am hoping someone can help me clarify a few things in relation to my scenario.


I will explain what I want to achieve first.

The system has numerous, mostly isolated tenants.  Each has its own account/realm.
Internal numbering in those clients are 3 digits in the 2XX range.
Obviously, calls to these 3 digit numbers should never cross from one account to another.

I then want to assign an external telephone number to deliver calls to one of their extensions.
This seems pretty straight forward, just add the external number to the dialplan for that extension.

So, pretty basic so far.
Now, while the above lets the accounts make and receive calls to the outside world and within their own realms, (after adding a couple dial plans and a trunk) I also would like the tenants to be able to dial each others external numbers and have the call routed internally.

I read a long discussion on here about marking a number in number_manager as public to achieve this. This post was very old and after other things I have seen (below) I am not sure if its still valid and/or has been superseded by the reconcile_regex thing.   Also, the basic guides I have followed don't seem to have me adding any numbers to number_manager - just suggests I need to list them in dial plans. Maybe I am missing something here.  I also read some guides where the dialplans had a "realms" array that might help me define the scope of a number, but the current .md document in git doesn't suggest it is there anymore.

In addition to this, i would also like to have inter account short codes that can be used to place calls between the accounts.   I was thinking 5 digit numbers, which we assign one to each account (like it were an external number I suppose) and any calls placed to any given 5 digit number would connect to a dialplan in the destination account.

Now, I was reading the following page about setting the "reconcile_regex" to differentiate between globally rout-able numbers.

I am unclear if this relates to incoming calls that come down external trunks, calls going out of external trunks or even if setting this to include my 5 digit numbers described above (as well as all externals) will achieve what I am looking at trying to do above - and also, if this is the correct way to do it.

I was also reading about system level dialplans that were defined outside of any accounts and wondered if defining my 5-digit intra-account numbers there (or even on the master account) would work to pick up calls routed out of an account as though it was external and then somehow forward the call back into another account, instead of out of a trunk.


This is probably really basic stuff to many of you guys and I am sorry if I am being really daft.
If someone could give me a pointer in the right direction so that I know what is the correct way to do this, it would be much appreciated.
I am running 4.0 from the stable repo.


James Aimonetti

unread,
Jun 26, 2017, 12:15:30 PM6/26/17
to 2600hz...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Answering inline, hopefully providing clarification :)
When you "add" numbers to Kazoo, the default is to tag them with
"knm_local" as the "carrier" module. This means the number is untrusted,
system-wide, and will not be directly routable between accounts. Which
means if Account A adds a DID and Account B dials it, the call will go
out to your upstream carriers first. If the call is routed back to Kazoo
it will go to Account A and proceed as expected.

As a system administrator, you can change the behaviour based on what
you want to allow. You can enable the carrier module(s) of upstream
carriers (like Bandwidth, VoIP Innovations, etc; see
https://github.com/2600hz/kazoo/tree/master/core/kazoo_number_manager/src/carriers
for the available carrier modules).

You can also use "knm_other" to mark the number as "trusted".

>
> In addition to this, i would also like to have inter account short codes
> that can be used to place calls between the accounts. I was thinking 5
> digit numbers, which we assign one to each account (like it were an
> external number I suppose) and any calls placed to any given 5 digit number
> would connect to a dialplan in the destination account.
>
> Now, I was reading the following page about setting the "reconcile_regex"
> to differentiate between globally rout-able numbers.
> https://github.com/2600hz/kazoo/blob/master/doc/internationalization/numbers.md

You're on the right track if you want 5-digit short codes to be
considered "globally" routable.

>
> I am unclear if this relates to incoming calls that come down external
> trunks, calls going out of external trunks or even if setting this to
> include my 5 digit numbers described above (as well as all externals) will
> achieve what I am looking at trying to do above - and also, if this is the
> correct way to do it.

It relates to how Kazoo matches numbers sent by carriers. In the 5-digit
shortcode case, you can think of the account dialing the short code as
the "carrier" sending the call into Kazoo for processing.

Do note that there is a ticket for providing inter-account dialing more
easily but I'm not sure the status on it at the moment. AFAIR it would
allow whitelisting of accounts who could call an account's extensions
directly, so maybe not as generally applicable as your 5-digit codes
(not sure if you're planning on whitelisting/blacklisting accounts who
can dial a particular short code).

>
> I was also reading about system level dialplans that were defined outside
> of any accounts and wondered if defining my 5-digit intra-account numbers
> there (or even on the master account) would work to pick up calls routed
> out of an account as though it was external and then somehow forward the
> call back into another account, instead of out of a trunk.

Dialplans allow for dialing local number patterns and having them be
"corrected" before Kazoo starts processing them as a call. It depends on
how your 5-digit codes are setup whether dialplans would work. One idea
is you could have a non-routable area code (maybe a 5xx code?
https://en.wikipedia.org/wiki/Personal_communications_service_(NANP) )
and assign DIDs to accounts' short codes to using that 5xx area code.

If account A's short code is 12345, you could assign DID +15555512345 to
the account's main callflow. Then create a dialplan with a regex like
"^(\\d{5})$" to capture just 5-digit dials, add a prefix of "+155555",
and now Kazoo will route the call as if the caller had dialed a DID.

This is all untested, back-of-the-napkin here so test it out yourself,
but I think it then avoids needing to muck with the reconcile_regex to
account for 5-digit "global" numbers.

>
>
> This is probably really basic stuff to many of you guys and I am sorry if I
> am being really daft.
> If someone could give me a pointer in the right direction so that I know
> what is the correct way to do this, it would be much appreciated.
> I am running 4.0 from the stable repo.

I thought these were great questions so thanks for asking! I'm sure
others will get ideas of their own generated off your post.

Really curious to hear how this goes!

- --
James Aimonetti

Lead Systems Architect
"If Dialyzer don't care, I don't care"
2600HzPDX | http://2600hz.com
sip:ja...@2600hz.com
tel:415.886.7905
irc:mc_ @ freenode
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEvSh+xZ5hP1H8lVIU1Mpr4k9cJWAFAllRMxsACgkQ1Mpr4k9c
JWC34wf/aNWpSOS4bapAG5OgSDzjUNdX57/cXa0tGdZorqOiHgtR23/X0JJ7GbCW
18MtAslPcVJcyB5txHoBzoQm7HxeP+gAOydOSWxDVc4VCnUAvca/qDO/bG4cw9yf
KSNMssTlkQoogo8ciyJSOFNFDLIWlgTxIC+4dy3tAn6te3y+z9fyMYFBpFnxFVYr
mJev5TSKuYOCK4346Ny5HscoR1RFbFnVvAorM3LsAgGwq6QEWHHHv+ZgN03WCqBn
2iiccdG0kvQfFTXZ8Hnu1hYefAvMBBVLvTdGfmSowsRsGU7SkzT/5i9zerZy+NSu
K+XbnaJ4CRd8YRL3nSVHA0dnMPJ0Gw==
=jlx1
-----END PGP SIGNATURE-----

James Sefton

unread,
Jun 26, 2017, 12:26:14 PM6/26/17
to 2600hz...@googlegroups.com
Hi James

Really appreciate you taking the time to provide these answers. I will give them a try and let you know how I get on.

Cheers,

James
--
You received this message because you are subscribed to the Google Groups "2600hz-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 2600hz-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages