News:

On Tuesday September 6th the forum will be down for maintenance from 9:30 PM to 11:59 PM PDT

Main Menu

DigitMap rules in ITSP B not working in ITSP A

Started by illicit, September 03, 2017, 04:06:20 PM

Previous topic - Next topic

illicit

I have the following. The bold portion is what I want to be dialed with SP1. I moved it from ITSP B DigitMap to ITSP A DigitMap and the numbers don't work. I don't want to make SP1 (freephoneline.ca) the primary line as SP2 (Google Voice) makes all calls including international BUT ones to a CAN # (hence all the CAN area codes in ITSP A DigitMap).


Phone Primary Line: SP2

Added to beginning of Phone OutboundCallRoute:
{(Msp1):sp1},

ITSP A DigitMap: (1204xxxxxxx|1226xxxxxxx|1236xxxxxxx|1249xxxxxxx|1250xxxxxxx|1289xxxxxxx|1306xxxxxxx|1343xxxxxxx|1365xxxxxxx|1403xxxxxxx|1416xxxxxxx|1418xxxxxxx|1431xxxxxxx|1437xxxxxxx|1438xxxxxxx|1450xxxxxxx|1506xxxxxxx|1514xxxxxxx|1519xxxxxxx|1581xxxxxxx|1587xxxxxxx|1579xxxxxxx|1604xxxxxxx|1613xxxxxxx|1639xxxxxxx|1647xxxxxxx|1705xxxxxxx|1709xxxxxxx|1778xxxxxxx|1780xxxxxxx|1782xxxxxxx|1807xxxxxxx|1819xxxxxxx|1825xxxxxxx|1873xxxxxxx|1902xxxxxxx|1905xxxxxxx|911)

ITSP B DigitMap:
(1xxxxxxxxxx|<1>[2-9]xxxxxxxxx|011xx.S3|<211:14163974636>|<311:14163922489>|<511:14162354686>|<611:14164772010>|<811:18667970000>|!1900xxxxxxx|!900xxxxxxx)

azrobert

I assume you're getting a fast busy. The OBi 1st validates the dialed number with the Phone Port DigitMap, so you need to add 211, 311 and 511 to it. It works with the primary line because rule (Mpli) in the Phone DigitMap includes the Primary Line's DigitMap rules. Do not do the transformation in the Phone DigitMap because the Outbound Route will only see the transformed number and won't route the call correctly.

illicit

Last question, do I need to add 911 to Phone DigitMap too? The default doesn't include it. But 911 is routed in the Phone OutboundCallRoute.

I don't want to try and test as freephoneline.ca charges $35 for a 911 call.

azrobert

Routing an outbound call is a 2 step process.
The Phone Port DigitMap validates the dialed number.
Rule (Mpli) will include the rules in primary line's DigitMap.
If the dialed number doesn't match a rule, you will receive a fast busy.

If the dialed number matches a rule in the DigitMap, the phone port OutboundCallRoute will get control and route the call to the primary line using rule {(Mpli):pli}. In your case 211, 311 and 511 will be routed by rule {(Msp1):sp1}.

My default phone DigitMap has 911. If yours doesn't, you should add it. The default ITSP DigitMaps don't contain 911, so you should add 911 to the correct ITSP DigitMap. The phone DigitMap is used only to validate the number. The ITSP DigitMap is used to route the call.

Several providers use 933 for 911 testing. Add 933 to the phone and ITSP DigitMaps. Even if your provider doesn't have this feature, you can see if 933 routes correctly by looking at the call history. The call will fail, but who cares.

illicit

Just curious, why not simply add (Msp2) to Phone DigitMap? In fact, why is Mpli included and not Msp1-4?

azrobert

QuoteJust curious, why not simply add (Msp2) to Phone DigitMap?

I think you meant (Msp1) since (Msp2) is you primary line.

Good question. It shows you are thinking. In most cases you can add (Msp1), but you might get in trouble when transforming numbers and your setup will. When you transform a number in the phone DigitMap, the OutboundCallRoute will see the transformed number, not the original dialed number.

When you dial 211 it is transformed to 14163974636 and will not match (Msp1) in the OutboundCallRoute. It will match (Mpli) and be routed to SP2.

QuoteIn fact, why is Mpli included and not Msp1-4?

Msp1-4 are include in the DigitMap and OutboundCallroute, but with the **1-4 prefix. To include these in the DigitMap without a prefix wouldn't accomplish anything without rules in the OutboundCallRoute. All the default ITSP DigitMaps are the same, so to include these in the OutboundCallRoute without a prefix will take precedence over the primary line rule and route the call to the wrong trunk.

ProfTech

#6
The way(s) the Obi digit maps process calls can be a bit curious but you are correct, {(Mpli):pli} does not have to be in the outbound call route. It's use there merely simplifies things in certain cases. I like to put all "paste ups" like your <611:14164772010> in the phone port digit map. Then in the service provider map put exactly what is acceptable [and what you want to be used] for that provider. What is in the sp map isn't used by the Obi at all unless A:the service provider is part of a trunk group or B: you reference it in either the Phone map or Outbound call route or C:the sp is the primary service provider [this is why I don't put paste ups in the sp map]. Trunk groups are a whole different subject.

A simple example:
Phone Map: (911|<611:14164772010>|1[2-9]xx[2-9]xxxxxx) - allows you to dial 911, 611[replaces it with 14164772010, and standard 11 digit dialing beginning with 1.

sp1 map: (1[2-9]xx[2-9]xxxxxx)

Outbound call route: {911:sp1},{1[2-9]xx[2-9]xxxxxx:sp1}

IF sp1 is the primary line then:
Outound call route could also be {911:sp1},{(Mpli):pli} (we are referencing what we put in the sp. field)

Note that 911 isn't specified in the sp1 map. It isn't required but can be there for clarity. The outbound call route has control. If the Obi sends something that is "illegal" to the sp the sp will respond with some sort of error.

Important note : The outbound call route is processed in left-to-right order. That is why 911 is listed by itself and is first. Consider this Outbound call route:

{911:sp3},{14172234567:sp2},{1[2-9]xx[2-9]xxxxxx:sp1}
14172234567 falls in the map for sp1 but since it is first in the order it will be sent to sp2. Everything else gets sent to sp1.

This last note allows you to send certain numbers or groups of numbers to a specific service provider without dialing **2,**3, etc as is the default in the Obi. The first match wins.






illicit

Thank you both for the informative replies.

I setup our Linksys PAP2T NA back when I was beginning high school. Configuring it was a pain as I barely understood how it worked.

Now that I'm past uni, and using an Obihai I'm beginning to understand more how digit maps and routing work. They're no longer random numbers that I'm copy pasting & mixing matching from random threads LOL.

Configuring has now gone from being a chore to actually quite fun. I can make complex rules and look forward to doing more with the device.

Oh how far VoIP has come for me, it's been almost a decade since I switched over.


Is there anything else you 2 could suggest doing to get more out of the Obihai? I use FreePhoneLine for CAN calling and Google Voice for US & international. What more can I do with this nifty piece of tech?

ProfTech

It's kind of a broad statement but I like to put everything into Notepad before ever trying to put it into the Obi. Then after looking at the whole picture I sometimes can say, I can simplify by doing this... a little differently. I usually list the ITSP map first

ITSP map nnnnnnnn - this is what is valid for the service provider.

then the phone map has to look like this yyyyy in order to be able to dial and/or transform certain numbers

lastly the outbound call route to make it all happen.

I mostly use the default maps to show me the correct syntax not specifics. The downloadable admin guide is very helpful when learning also.



azrobert

Quote from: illicit on September 04, 2017, 02:31:58 PM
What more can I do with this nifty piece of tech?

I use a free service to make tollfree calls. GV doesn't work with some tollfree numbers. Actually, GV will not work with any number that uses early media.

You can have failover when a trunk is down. If freephoneline is down, you can automatically route Canadian numbers to GV and possibly visa versa. You would use a Trunk Group to accomplish this.

illicit

Hmm can you show me how to setup the trunk?

Also what free service do you use for tollfree calls?

ProfTech

#11
IMO trunk a trunk group is only useful in the case where you need to be able to send a number [or group of numbers] out either of 2 trunks. As AZ robert said, I don't route toll free calls to Google Voice for the reason he spoke of. I use a user defined map given to me by another Obi expert for Toll Free numbers "tfree = (18(00|33|44|55|66|77|88)xxxxxxx)". You may be able to use in your outbound call route to send Toll Free to a certain provider by something similar to {(Mtfree):sp1}.

CallWithUs provides toll free service for 6 cents per hour which is nearly free. Flowroute is free.

azrobert

Voice Services -> Gateways and Trunk Groups:

Voice Gateway 1

Name: TollFree
DigitMap: (18(00|88|77|66|55|44|33)xxxxxxx)
AccessNumber: sp1(tf.arctele.com)
AuthUserID: 4805551212

The person receiving the call will see AuthUserID as your CallerID.
AccessNumber must point to an SP defined as SIP.
SP2 will not work because it's defined as GV.

Physical Interfaces -> Phone Port
Add this to the beginning of the OutboundCallRoute:
{(Mvg1):vg1},

Below is my list of tollfree providers.
I haven't tested these for awhile.
In the past several other providers stopped working.
I'm currently using Arctele

Providers:
tf.arctele.com
tollfree.alcazarnetworks.com
sipbroker.com prefix number with "*"
switch.starcompartners.com

QuoteHmm can you show me how to setup the trunk?

Do you mean tollfree trunk or a trunk group?

illicit

Quote from: azrobert on September 04, 2017, 04:44:28 PM
Do you mean tollfree trunk or a trunk group?

I meant trunk group in case FPL goes down I can route calls through GV. This will work well as GV can do both CAN & US calling and is setup as primary anyways for international/other calls.

ProfTech

#14
To Illicit: I just read your initial post closer and noticed you said you are in Canada. I noticed your map for Canadian numbers and have a recommendation. The maps in the Obi are limited to 512 [or 511 not sure which] characters. Pasting yours into Notepad I show around 450 characters but I recommend using the User defined maps in the Obi to your fullest advantage. Leaving out the 911 the map for Canada becomes (1(204|226|236|249|250|289|306|343|365|403|416|418|431|437|438|450|506|514|519|581|587|579|604|613|639|647|705|709|778|780|782|807|819|825|873|902|905)xxxxxxx) for readibility and maintainability, using the toll free map as a model. Your outbound call route might then be {(Mcan):sp1}. The "expanded" length still counts but is much clearer and maintainable.

Since everything in your original post falls into the 416 area code except for the 811 number you don't need to put them into the outbound call route at all. You just need to make allowance for the 811 number and block the 900 numbers in the phone map. Keep it all simple. I'll let someone else delve into the intricacies of setting up a trunk group. As AZRobert noted, you can't use a VG unless the reference sp is sip. There may be other hidden paramaters from the sp section that are in effect that could effect the VG. IMO this can limit the usefulness of gateways. Also you can't specify your caller ID when using a gateway with Flowroute. :-(

illicit

Quote from: ProfTech on September 04, 2017, 05:34:38 PM
To Illicit: [...]

Thank you! I actually took the toolfree model and adapted it as you posted that XD

Thank you you two, you've both been lots of help and I appreciate all the advice!

azrobert

#16
This is how I configured my OBi200. I removed all code that wasn't required including the **x prefix code. If you need the **x prefix, I'll show you how (it has to be different than the default). I copied ProfTech's Canadian rules. I assumed you are using VG1 for tollfree numbers. I didn't spend a lot of time with this configuration. Hopefully, I didn't make too many errors.

Phone DigitMap:
([1-9]S9|[1-9][0-9]S9|911|933|***|!1900xxxxxxx|!900xxxxxxx|1xxxxxxxxxx|<1>[2-9]xxxxxxxxx|011xx.S3|211|311|411|511|611|811)

Phone outbound route:
{***:aa2},{(Mpli):pli}

Phone Primary Line: Trunk Group 1

ITSP A DigitMap:
(911|933|1(204|226|236|249|250|289|306|343|365|403|416|418|431|437|438|450|506|514|519|581|587|579|604|613|639|647|705|709|778|780|782|807|819|825|873|902|905)xxxxxxx|<211:14163974636>|<311:14163922489>|<511:14162354686>|<611:14164772010>|<811:18667970000>)

ITSP B DigitMap:
(1xxxxxxxxxx|011xx|<211:14163974636>|<311:14163922489>|<511:14162354686>|<611:14164772010>|<811:18667970000>)

VG1 DigitMap:
(18(00|88|77|66|55|44|33)xxxxxxx)

Voice Services -> Gateways and TGs -> Trunk Group 1
Trunk List: vg1,sp1,sp2
DigitMap: (Mph)

Voice Services -> SP1 Service: X_NoRegNoCall: Checked

Service Providers ITSP A -> SIP -> TimerB: 10000

The Phone DigitMap validates numbers for all trunks.

I set TG1 DigitMap to the phone DigitMap.
Any number matching (Mpli) which points to (Mph) will be routed to TG1
TG1 will process the trunks in the trunk list left to right.
If the call fails in a trunk, processing will move to the next trunk.
The call can fail in 2 ways, the trunk is down or the dialed number doesn't match the corresponding trunk DigitMap.

If you dial 12041234567:
It doesn't match (Mvg1) so VG1 is skipped
It does match (Msp1), so the call is routed to SP1
If the call fails then SP2 is tried
It matches (Msp2), so the call is routed to SP2

There will be a 32 second wait before the call failovers (see below). When X_NoRegNoCall is enabled the call will immediately failover when the trunk is not registered to the provider.

It is my understanding that the OBi might think the trunk is still registered when the trunk is down. There is a registration period and the OBi might not know the trunk is down until the registration period expires and the OBi tries to re-register. In this case the OBi will wait 32 seconds (defined in TimerB) before it failovers. I changed TimerB to 10 seconds. You can probably make it less, but if you make it too low you will get a false failover.

ProfTech

#17
There are several ways to meet the requirements. I haven't seen the S timer component used with international numbers to avoid the dial delay. This is what I came up with:
Assumptions:
1. You are using an Obihai 100
2. You want canadian numbers to go out freephoneline.ca unless it is down then to use Google
3. You want toll free numbers to go out a free provider (wasn't sure if freephoneline.ca was an option)
4. You want international numbers to use google

THEN:
sp1 [freephoneline.ca] map = (1xxxxxxxxxx) [I'm Not sure of canadian requirement]
sp2 [google] map = (1xxxxxxxxxx|011xx.)  [Allow for international]
vg1 [free provider] map = (18(00|33|44|55|66|77|88)xxxxxxx)

User defined maps:
tfree = (18(00|33|44|55|66|77|88)xxxxxxx)
feat=(<211:14163974636>|<311:14163922489>|<511:14162354686>|<611:14164772010>|<811:18667970000>|933)

phone port digit map (911|!1900xxxxxxx|[1-9]S9|[1-9][0-9]S9|(Mfeat)|(Msp1)|011xx.S3)

Voice Services -> Gateways and TGs -> Trunk Group 1
Trunk List: sp1,sp2
DigitMap: (Msp2)

Primary Line: tg1 [trunk group 1]
Outbound call route: {(911|933):sp1},{(Mtfree):vg1},{(Mpli):pli}

The Phone DigitMap validates numbers and performs transforms.
A canadian mask is not needed because either freephoneline.ca or google can handle them.
The same is true for the "x11" numbers because they are transformed to standard numbers.
Toll free numbers are "picked off" by the outbound route first and sent to vg1.
Any other 11 digit number starting with 1 is sent to tg1. tg1 tries sp1 and if not available sends it to sp2
International numbers beginning with 011 are sent to tg1. This is a special case where the sp maps DO count. Since sp1 can't handle international numbers the call is sent only to google.

illicit

Quote from: azrobert on September 04, 2017, 09:40:35 PM
Phone outbound route:
{***:aa2},{(Mpli):pli}

For the above, this is set to forward *** to the Auto Attendant correct? If so, it's safe to leave this out yeah? Since, I have blocked calls (MBlocked) forward to the Auto Attendant which is entirely muted and plays a fake line is disconnected message.

Thank you azrobert & ProfTech, I'll get to configuring the Obihai (OB200) sometime today.

ProfTech, I assume the Canadian mask is required since both Canadian & US numbers start with 1 and are 11 digits so without it SP1 (FPL) becomes a catch all.

I have a buzzer phone for the apartment and it rings a hard line that has no service, can I use the OBiLINE adapter to link it with the Obiai? I've read the website and I don't understand what FXO is but I presume my line is a PSTN or POTS?

azrobert

*** routes you to the Auto Attendant 2, not AA1. AA2 is used for admin commands, like installing firmware or saying the IP address of the device.

If you use ProfTech's example, he does transformation in the phone digit map, so you need to include the transformed numbers with the Canadian digit map.

A FXO port is used to connect to a POTS/PSTN line. The buzzer looks like a POTS/PSTN line, so that is how to connect to an OBi device. I think the OBiLine has been discontinued and replace by the OBi212.

https://www.amazon.com/OBi212-Universal-Adapter-Gateway-Support/dp/B075839DD6/ref=sr_1_1?ie=UTF8&qid=1504639591&sr=8-1&keywords=obi212