News:

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

Main Menu

Help understanding Outbound Call Routing

Started by xpr722946ghd, May 06, 2017, 09:20:27 PM

Previous topic - Next topic

xpr722946ghd

OK, I've looked over several threads, and been looking at the Admin guide and Tutorial on Digit Maps & Call Routing.  I'm still a little confused.

When I pick up the phone and dial a number, what order are things processed?

I have programmed SP1 to transform digits. e.g.
01xxx xxxxxx becomes 044441xxx xxxxxx. That works fine.

However I want SP2 set up as my default outbound route.

Therefore my Outbound Call Routing for Phone 1 needs to direct any 01 or 02 number to SP1 for digit transformation and dialing.

But I can't make it work  :(
When SP1 is default, the {(xxxxxxxxxx(Msp2)):sp2} section allows North American calls to route to SP2.  911 & 933 calls are also routing to SP2 fine (even when SP1 is set to default).

What am I doing wrong with the 01/02 piece of code?

{911:sp2},{933:sp2},{(0[1-2]xx.(Msp1)):sp1},{(xxxxxxxxxx(Msp2)):sp2},{([1-9]x?*(Mpli)):pp},{(<##:>):li},{(<#:>):ph2},{(<**70:>(Mli)):li},{(<**82:>(Mbt2)):bt2},{(<**81:>(Mbt)):bt},{(<**8:>(Mbt)):bt},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},{(<**2:>(Msp2)):sp2},{(<**3:>(Msp3)):sp3},{(<**4:>(Msp4)):sp4},{(<**9:>(Mpp)):pp},{(Mpli):pli}

My ultimate goal

UK calls (07, 01, 02) numbers get routed to SP1
10 digit North American calls routed to SP2
11 digit North American calls routed to SP4 (Google Voice)
UK toll free calls (0800, 0808, 0500) routed via SP3
CAN & US toll free calls routed to SP1
International calls (outside of UK & North America) routed via SP1

911 & 933 calls need to route via SP2.

All help appreciated!
Thanks in advance  :)

azrobert

#1
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}

QuoteHowever I want SP2 set up as my default outbound route.
Do you want to change the PrimaryLine to SP2 or place SP2 1st in the OutboundCallRoute?
I would leave SP1 as the PrimaryLine.

"{(0[1-2]xx.(Msp1)):sp1}" is not coded correctly. If ITSP A DigitMap contains "123" then you are checking for "0[1-2]xx.123".

My Suggestion:

ITSP A DigitMap:
(<07:011447>xxxxxxxxx|<0:04444>[1-2]xxxxxxxxx|<44:04444>[1-2]xxxxxxxxx|04444x.|011447x.)

ITSP B DigitMap:
(911|933|[2-9]xxxxxxxxx)

OutboudCallRoute:
{(Msp2):sp2},{([1-9]x?*(Mpli)):pp},{(<##:>):li},{(<#:>):ph2},{(<**70:>(Mli)):li},{(<**82:>(Mbt2)):bt2},{(<**81:>(Mbt)):bt},{(<**8:>(Mbt)):bt},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},{(<**2:>(Msp2)):sp2},{(<**3:>(Msp3)):sp3},{(<**4:>(Msp4)):sp4},{(<**9:>(Mpp)):pp},{(Mpli):pli}

Add following to the Phone DigitMap:
|(Msp2)

Edit:
If you want to check for 01-02 numbers and what is in SP1 DigitMap, add a vertical bar like this:
"{(0[1-2]xx.|(Msp1)):sp1}"

drgeoff

OutboundcallRouteing in a nutshell:

A list of rules which are evaluated in sequence from left to right.

Each rule has two parts separated by a colon.

If a dialled number passes through the Phone Port Digit Map, it (with any mangling done by that map) is checked against the part of the rule before the colon.  If it matches the call is passed to the service provider specified in the part after the colon.  If it does not match, try the next rule.

xpr722946ghd

Thanks Gents.
Functionality is up to about 50%  :D

Currently, outbound Canadian calls are routed to SP2.  Perfect.
Outbound calls dialed with UK format numbers (01, 02, or 07) are routing via SP1.
933 (and I shall assume 911) correctly routing via SP2.

Next thing would be to get US bound calls to head over to SP4.  Let's say I prefix all US numbers with a 1, but I leave the 1 off for all Canadian calls.

So if the number begins with a 1 and 10 other digits, it goes to SP4.

I still need some help understanding the syntax of some of these maps.
Here are my current ones :

Physical Phone 1 Digit Map
([1-9]x?*(Mpli)|[1-9]S9|[1-9][0-9]S9|911|**0|***|#|##|**70(Mli)|**8(Mbt)|**81(Mbt)|**82(Mbt2)|**1(Msp1)|**2(Msp2)|**3(Msp3)|**4(Msp4)|**9(Mpp)|(Mpli)|(Msp2))

Question : what does the (Msp2) at the end do?

Physical Phone 1 Outbound Call Route
{(0[1-2]xx.|(Msp1)):sp1},{(Msp2):sp2},{([1-9]x?*(Mpli)):pp},{(<##:>):li},{(<#:>):ph2},{(<**70:>(Mli)):li},{(<**82:>(Mbt2)):bt2},{(<**81:>(Mbt)):bt},{(<**8:>(Mbt)):bt},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},{(<**2:>(Msp2)):sp2},{(<**3:>(Msp3)):sp3},{(<**4:>(Msp4)):sp4},{(<**9:>(Mpp)):pp},{(Mpli):pli}

I believe this instructs and number beginning with 01 or 02 route via SP1.  Assuming I also want 07 calls to go there, I would need to add that in too. Would it be {(01[127]xx.|(Msp1)):sp1}?

Also, what does the {(Msp2):sp2} instruction mean?

I also need to plan for general 011 international calls.  Can I route those to SP1 by adding {011xx.|(Msp1)):sp1} into the outbound call route?  How can ensure that calls to a UK 01 number are not confused with a 011 international call?  Or does that even matter sine both will be passed to SP1?

So many questions.  Thanks for being willing to instruct a Obi noob!

azrobert

QuoteNext thing would be to get US bound calls to head over to SP4.  Let's say I prefix all US numbers with a 1, but I leave the 1 off for all Canadian calls.
So if the number begins with a 1 and 10 other digits, it goes to SP4.

That will work.

QuoteI believe this instructs and number beginning with 01 or 02 route via SP1.  Assuming I also want 07 calls to go there, I would need to add that in too. Would it be {(01[127]xx.|(Msp1)):sp1}?

Correct

QuoteQuestion : what does the (Msp2) at the end do?
ONLY the Phone DigitMap is used to validate the dialed number. The trunk DigitMaps are NOT used to validate numbers. The exception is the primary line's DigitMap. It is included by rule "(Mpli)".  "(Msp2)" needs to be added to the Phone DigitMap so those rules will be used to validate numbers.

Are you using DigitMap rules to insert "4444" into 01 and 02 numbers?

If you include "0[1-2]xx." into the ITSP A DigitMap, you wouldn't need a separate rule for SP1, It would be handled by rule "{(Mpli):pli}'.

azrobert

I just read your last post in your other thread where you said:
QuoteThe digit map side of things is running well now.  If I was only using line 1, it would be fine.  It handles the number transformation nicely allowing me to dial UK 01, 02 & 07 numbers, as well as 10 & 11 digit North American numbers.

I assume this means you are still inserting "4444" into 01 and 02 numbers

This was my DigitMap suggestion for SP1:
(<07:011447>xxxxxxxxx|<0:04444>[1-2]xxxxxxxxx|<44:04444>[1-2]xxxxxxxxx|04444x.|011447x.)

The 1st 3 rules are used to validate and transform international numbers.
After dialing 01123456789 it will be transformed to 044441123456789
In the OutboundCallRoute the 1st 3 rules are useless because the original number was changed.
The last 2 rules were added for routing in the OutboundCallRoute.
Rule {(Mpli):pli} will use rule 04444x. to match transformed number 044441123456789 and route it to SP1.

You asked about rule {(01[127]xx.|(Msp1)):sp1}
I don't know what you are trying to do with 01[127]xx.
It won't match the transformed numbers.

xpr722946ghd

Quote from: azrobert on May 07, 2017, 06:53:13 PM

I assume this means you are still inserting "4444" into 01 and 02 numbers

This was my DigitMap suggestion for SP1:
(<07:011447>xxxxxxxxx|<0:04444>[1-2]xxxxxxxxx|<44:04444>[1-2]xxxxxxxxx|04444x.|011447x.)

The 1st 3 rules are used to validate and transform international numbers.
After dialing 01123456789 it will be transformed to 044441123456789
In the OutboundCallRoute the 1st 3 rules are useless because the original number was changed.
The last 2 rules were added for routing in the OutboundCallRoute.
Rule {(Mpli):pli} will use rule 04444x. to match transformed number 044441123456789 and route it to SP1.

You asked about rule {(01[127]xx.|(Msp1)):sp1}
I don't know what you are trying to do with 01[127]xx.
It won't match the transformed numbers.


Yes, I used your suggested Digit Maps for ITSP A & B.  The number transformation happens at that point.  i.e. 01xxx becomes 044441xxx.

If my understanding is correct,


  • Physical Phone Port Digit Map rules comes first (no transformation).
  • Outbound Call Route Digit Map comes next, sending 01,02,07 to SP1, [2-9]xxxxxxxxx to SP2
  • SP1 Digit Map performs transformation of Uk area code 01xxx to 044441xxx and dials.
Therefore, in my mind, Outbound Call Routing needs to match the pre-transformed number.  When that number is passed to SP1, SP2 or SP4 the digit map there transforms it for dialling.

If that is the case, I need to narrow down where the leading 1 is coming from when I dial a 10 digit number.  Maybe the Phone Port Digit Map which reads :
([1-9]x?*(Mpli)|[1-9]S9|[1-9][0-9]S9|911|**0|***|#|##|**70(Mli)|**8(Mbt)|**81(Mbt)|**82(Mbt2)|**1(Msp1)|**2(Msp2)|**3(Msp3)|**4(Msp4)|**9(Mpp)|(Mpli)|(Msp2))

I don't see a 1 being prepended to 10 digit numbers there.
The SP2 Digit Map of (911|933|[2-9]xxxxxxxxx) doesn't seem to prepend a 1 either.  So where is that 1 coming from?

If I can figure that out, then surely all I need to do is create a route to SP4 in the Outbound Call Route for 11 digit North American numbers.  Then those outbound calls will go to Google Voice.

I get a little confused when the Outbound Call Routes are referring back to the Msp1 & Msp2 rules.

drgeoff

#7
Quote from: xpr722946ghd on May 07, 2017, 02:38:08 PM

Currently, outbound Canadian calls are routed to SP2.  Perfect.
Outbound calls dialed with UK format numbers (01, 02, or 07) are routing via SP1.
933 (and I shall assume 911) correctly routing via SP2.

Next thing would be to get US bound calls to head over to SP4.  Let's say I prefix all US numbers with a 1, but I leave the 1 off for all Canadian calls.
Looks like you haven't been following everything I've already told you.  :)

There is no need to dial US and Canadian numbers differently.  The rules in the OutboundCallRoute are evaluated sequentially in the order they are written and as soon as a rule is matched the OutboundCallRoute stops evaluating.  So if you have a rule which picks off all the Canadian area codes (and sends them to SP2) then you simply need a later rule which matches all US and Canada numbers and sends them to SP4.  ie optional leading 1 followed by [2-9] followed by xxxxxxxxx.  That rule never gets to see the Canadian numbers.  Everything that it does see and match must be US ones.

azrobert

#8
Transformation happens when a dialed number matches a rule, so it can occur in either the Phone Port DigitMap or the OutboundCallRoute. In your case transformation takes place in the Phone DigitMap.

QuoteTherefore, in my mind, Outbound Call Routing needs to match the pre-transformed number.

No! The Outbound Call Routing needs to match the transformed number.

QuoteSo where is that 1 coming from?

All the default trunk DigitMaps contain rule "<1>[2-9]xxxxxxxxx". Make sure this rule was removed.

QuoteI get a little confused when the Outbound Call Routes are referring back to the Msp1 & Msp2 rules.

{(Msp2):sp2}

The number is compared to the rules in the SP2 DigitMap and upon a match the call is routed to SP2.

drgeoff

Quote from: xpr722946ghd on May 07, 2017, 08:33:37 PM
If my understanding is correct,


  • Physical Phone Port Digit Map rules comes first (no transformation).
  • Outbound Call Route Digit Map comes next, sending 01,02,07 to SP1, [2-9]xxxxxxxxx to SP2
  • SP1 Digit Map performs transformation of Uk area code 01xxx to 044441xxx and dials.
Therefore, in my mind, Outbound Call Routing needs to match the pre-transformed number.  When that number is passed to SP1, SP2 or SP4 the digit map there transforms it for dialling.
No, your understanding is not correct.

The Phone port digit map (with any maps it references) and its transformations (=mangling) is done and finished with before the OutboundCall Route looks at it.

I already told you on 5 May "Yes, the OutBoundCallRoute sees the mangled version of whatever a phone port digit map does to the number dialled on the phone." and earlier in this thread "OutboundcallRouteing in a nutshell: .....If a dialled number passes through the Phone Port Digit Map, it (with any mangling done by that map) is checked ......"

As azrobert has said, transformation can occur in either (or both) of the digit map and OutboundCallRoute.

xpr722946ghd

Quote from: azrobert on May 08, 2017, 06:47:11 AM
Transformation happens when a dialed number matches a rule, so it can occur in either the Phone Port DigitMap or the OutboundCallRoute. In your case transformation takes place in the Phone DigitMap.

Perhaps this is the source of my confusion.

The Phone Port Digit Map reads as follows.
([1-9]x?*(Mpli)|[1-9]S9|[1-9][0-9]S9|911|**0|***|#|##|**70(Mli)|**8(Mbt)|**81(Mbt)|**82(Mbt2)|**1(Msp1)|**2(Msp2)|**3(Msp3)|**4(Msp4)|**9(Mpp)|(Mpli)|(Msp2))

It is not performing any transformation is it?  At least not on the UK numbers beginning with 01, 02, or 07.  That transformation happens in the ITSP A digit map which gets read later in the sequence.  Or is it performing a transformation at this stage because it is calling Mpli rules in the first statement?  And now that Msp2 is added at the end it is performing any transformation listed there?

drgeoff

#11
Quote from: xpr722946ghd on May 08, 2017, 03:48:42 PM
Quote from: azrobert on May 08, 2017, 06:47:11 AM
Transformation happens when a dialed number matches a rule, so it can occur in either the Phone Port DigitMap or the OutboundCallRoute. In your case transformation takes place in the Phone DigitMap.

Perhaps this is the source of my confusion.

The Phone Port Digit Map reads as follows.
([1-9]x?*(Mpli)|[1-9]S9|[1-9][0-9]S9|911|**0|***|#|##|**70(Mli)|**8(Mbt)|**81(Mbt)|**82(Mbt2)|**1(Msp1)|**2(Msp2)|**3(Msp3)|**4(Msp4)|**9(Mpp)|(Mpli)|(Msp2))

It is not performing any transformation is it?  At least not on the UK numbers beginning with 01, 02, or 07.  That transformation happens in the ITSP A digit map which gets read later in the sequence.  Or is it performing a transformation at this stage because it is calling Mpli rules in the first statement?  And now that Msp2 is added at the end it is performing any transformation listed there?

When another map is referenced it acts like a sort of macro.  So, yes the (Mpli) in the phone port digit map is doing exactly the same transformations and matching as if the contents of Msp1 (=Mpli) had been typed into the phone port digit map.

And in the same way, (Msp2) is doing the same as if its contents had been typed into the phone port digit map.

xpr722946ghd

Perhaps the penny is finally dropping!

azrobert

#13
Here is a solution to all your requirements. Hopefully, I didn't make any mistakes. Dial 10 or 11 digits for N. America. Routing for Canada is based on area code. I got the list of area codes from a Web site and did a cut and paste with some editing to create the digit map, so there shouldn't be any typos. I don't know if the list of area codes is accurate.
http://www.areacodehelp.com/canada/canada_area_codes.shtml

ITSP A DigitMap:
(011xxxxxxxxx.S3|<07:011447>xxxxxxxxx|<0:04444>[1-2]xxxxxxxxx|<44:04444>[1-2]xxxxxxxxx|04444x.|011447x.)

ITSP B DigitMap:
(911|933|1(403|587|780|825|236|250|604|778|204|431|506|709|879|867|782|902|867|226|249|289|343|365|416|437|519|548|613|647|705|807|905|782|902|367|418|438|450|514|579|581|819|873|306|639|867|600|622)xxxxxxx)

ITSP C DigitMap:
((0800|0808|0500)xxxxx.S3)

ITSP D DigitMap:
(1xxxxxxxxxx|<1>[2-9]xxxxxxxxx)

Phone DigitMap:
([1-9]x?*(Mpli)|[1-9]S9|[1-9][0-9]S9|911|**0|***|#|##|**70(Mli)|**8(Mbt)|**81(Mbt)|**82(Mbt2)|**1(Msp1)|**2(Msp2)|**3(Msp3)|**4(Msp4)|**9(Mpp)|(Mpli)|(Msp2)|(Msp3)|(Msp4))

OutboudCallRoute:
{(18(00|88|77|66|55|44|33)xxxxxxx):sp1},{(Msp2):sp2},{(Msp3):sp3},{(Msp4):sp4},{([1-9]x?*(Mpli)):pp},{(<##:>):li},{(<#:>):ph2},{(<**70:>(Mli)):li},{(<**82:>(Mbt2)):bt2},{(<**81:>(Mbt)):bt},{(<**8:>(Mbt)):bt},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},{(<**2:>(Msp2)):sp2},{(<**3:>(Msp3)):sp3},{(<**4:>(Msp4)):sp4},{(<**9:>(Mpp)):pp},{(Mpli):pli}

drgeoff

There was different source of Canadian area codes in my post at http://www.obitalk.com/forum/index.php?topic=12671.msg81438#msg81438.

But:

1.  If they are different, is one correct or are they both incorrect?

2.  Even if they are the same, that still does not guarantee they are correct.

:)

drgeoff

Quote from: azrobert on May 09, 2017, 08:05:00 AM
ITSP B DigitMap:
(911|933|1(403|587 ...

That appears to require 11 digit dialling for Canadian numbers.  Did you mean to have <1>
as in

(911|933|<1>(403|587 ...   ?

azrobert

Quote from: drgeoff on May 09, 2017, 08:48:15 AM
That appears to require 11 digit dialling for Canadian numbers.  Did you mean to have <1>
as in

(911|933|<1>(403|587 ...   ?

11 digit Canadian will be validated by (Msp2). All other N. American numbers will be validated by (Msp4) where 10 digit numbers will be transformed to 11 digits. When routing occurs all N. American numbers will be 11 digits. I originally wasn't going to include (Msp2) in the Phone digit map, but I needed to validate 933. My choice was to include (Msp2) or add 933 to the Phone digit map.

drgeoff

Quote from: azrobert on May 09, 2017, 09:03:49 AM
Quote from: drgeoff on May 09, 2017, 08:48:15 AM
That appears to require 11 digit dialling for Canadian numbers.  Did you mean to have <1>
as in

(911|933|<1>(403|587 ...   ?
When routing occurs all N. American numbers will be 11 digits.
Aha. Quite so.

xpr722946ghd

Quote from: azrobert on May 09, 2017, 08:05:00 AM
Hopefully, I didn't make any mistakes...


Wow, thanks for working on that on my behalf.  That is amazingly helpful  ;D

I've copied each section and have been testing this evening.

UK calls (01, 02, 07) were being sent to SP2 instead of SP1.  I modified the Outbound Call Route by adding {(Msp1):sp1} in front of the {(Msp2):sp2} section.  I had thought of going back to the {(0[127]xx.|(Msp1)):sp1} instead.  If that would be better, please let me know.  This configuration is now sending UK calls to SP1.

US bound calls were being routed to SP2 instead of SP4.  Interestingly, when I added the {(Msp1} stuff to the Outbound Call Route, US calls started going to SP4 where intended.  But then Canadian calls started going to SP4 as well.

So it looks like wherever the Canadian calls are going, the US calls are being routed to as well  ???

xpr722946ghd

I realized I had left out a comma between these 2 rules.
{(Msp1):sp1} {(Msp2):sp2}

So I added it back in.

Now I'm back to all Canadian & US calls going out over SP2.