News:

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

Main Menu

DialPlan confusion

Started by LesSz, January 04, 2016, 03:42:57 PM

Previous topic - Next topic

LesSz

Hi everyone!

I am by no means an expert with voip but have some experience.  OBI I'm new to though.   And helping someone get started with voip using a obi200.

So I've configured 2 service providers.  Provider 1 has DID and used for incoming calls + voicemail.

Provider 2: calling everything except voicemail.

So I configured the following for my dialplan:

Profile A:
(*123|*xx|<**1>(1845111222)|<**2>(1xxxxxxxxxx|011xx.|<1>[2-9]xxxxxxxxx|xx.|(Mipd)|[^*#]@@.))

Profile B:
(1xxxxxxxxxx|011xx.|<1>[2-9]xxxxxxxxx|xx.|(Mipd)|[^*#]@@.)


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))

Outbound Call Route:
{([1-9]x?*(Mpli)):pp},{(<##:>):li},{(<**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}

So if I understand everything, when dialing with 011... , 1... are dialed on SP2, 10 digit dialing adds the 1 then goes out on SP2.   Also, if I dial 1845111222 it should append the **1 and go out the primary line.

However, everything I dial goes out SP2 including 1845111222. (My DID number, and the number i dial to get to the voicemail.)

So my question is why is that going to SP2 instead of 1?   Is there anyway to force it, or to make some shortcut like *99 calls voicemail number on SP1?

azrobert

I don't see the error causing your result, but I don't use this method of routing. I do see an error that should get a different result.
When the outbound route gets control it will see the number as **11845111222
Rule {(<**1:>(Msp1)):sp1} will strip **1, but then rule <**1>(1845111222) in the Profile A DigitMap will add the **1 prefix again before routing the call to SP1, but that's not happening.

This is how I would do it:

Phone Port Primary Line: SP2

Profile A:
(*123|*xx|1845111222)

Profile B:
(1xxxxxxxxxx|011xx.|<1>[2-9]xxxxxxxxx|xx.)

Digit Map:
((Msp1)|[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))

Outbound Call Route:
{(Msp1):sp1},{([1-9]x?*(Mpli)):pp},{(<##:>):li},{(<**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}

LesSz

Hi, and thanks so much for the tips! :)

It turns out that I marked line 2 not line 1 for the main line.   After changing that it seemed to work.  I however, changed it to your suggested plan as it seems much more straight forward.

I do have a question.  Let's say there is an issue with SP2, and I wanted to place a call via SP1 to a north american number (just as a backup).  So the number would be 1+10 digits.  How could I incorporate that into this plan, because I tried adding to Profile A:
Profile A:
(*123|*xx|1845111222|1xxxxxxxxxx)

But since then everything dialed 1+area code wants to go through SP1.  My thought was maybe I could dial **1+1+10 digits to get it to go out SP1.  Should I specify the **1 at the beginning?

azrobert

You got it half right. After you added 1xxxxxxxxxx to Profile A, rule {(<**1:>(Msp1)):sp1} will route **1 numbers call to SP1, but now the rule I added will send all 11 digit numbers to SP1.

It can be fixed by doing this:

Phone Port Primary Line: SP2

Profile A:
(*123|*xx|1845111222|1xxxxxxxxxx)
or
(*123|*xx|1xxxxxxxxxx)

Profile B:
(1xxxxxxxxxx|011xx.|<1>[2-9]xxxxxxxxx|xx.)

Digit Map:
((Msp1)|[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))

Outbound Call Route:
{(*123|*xx|1845111222):sp1},{([1-9]x?*(Mpli)):pp},{(<##:>):li},{(<**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}


You can setup a trunk group for automatic failover like this:

Phone Port Primary Line: Trunk Group 1

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

Voice Services -> SP2 Service: X_NoRegNoCall: Checked

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

Everything else the same as above.

NoRegNoCall will cause an immediate failover when SP2 is not registered.
When SP2 is still registered and there is another problem, it will failover to SP1 after TimerB expires (10 seconds). TimerB default is 32 seconds.

Test to make sure calls are routed correctly to SP2. Now change the password or userid, so SP2 fails to register. Place another call and see if it failovers to SP1.

LesSz

Ok, so specifying  (*123|*xx|1845111222):sp1 in the outbound call route forces these combinations to all go out on SP1.  :)

Just trying to get my head around these rules.....So why is there profile A? or is that so matching, substitutions can be done?

Thanks so much for all your help!!!

azrobert

#5
To simplify the explanation, I removed all the rules not necessary for the main processing.

Profile A:
(*123|*xx|1xxxxxxxxxx)
Profile B:
(1xxxxxxxxxx|011xx.|<1>[2-9]xxxxxxxxx|xx.)
Phone Digit Map:
((Msp1)|**1(Msp1)|(Mpli))
Phone Outbound Call Route:
{(*123|*xx|1845111222):sp1},{(<**1:>(Msp1)):sp1},{(Mpli):pli}

Processing when Primary Line = SP2

The dialed number must match a rule in the phone digitmap.
(Msp1) includes all rules in profile A
**1(Msp1) includes all rules in profile A with a prefix of **1
(Mpli) includes all the rules in the primary line (profile B) digitmap.
All combinations of numbers you need are included.
If you dial a number not in these digitmaps the call will FAIL with a fast busy.
This is why you need profile A digitmap.
If the dialed number matches a rule, the phone outbound route gets control.

Outbound route processing:
You don't need to use a SP digitmap like I did with the 1st rule.
You can compare the dialed number to anything you want and then route the call to any trunk.
(Mpli) points to the primary line digitmap.
pli points to the primary line.

Processing when Primary Line = TG1

Trunk List: sp2,sp1
DigitMap: ((Msp1)|(Msp2))

(Mpli) in the phone digitmap now points to TG1 digitmap
TG1 digitmap includes both profile A and B digitmaps.
Since profile A digitmap is included here, you don't need (Msp1).
It doesn't hurt to leave it and now both options (primary line SP2 or TG1) have the same digitmaps.
All needed rules are included in the phone digitmap.

{(Mpli):pli} in the outbound route is processed differently.
(Mpli) points to TG1 digitmap which includes profile A & B digitmaps.
Upon a match the TG gets control and processes the trunk list left to right.
Processing SP2 the dialed number is compared to profile B digitmap.
If there is a match the call is routed to SP2.
If there isn't a match with profile B or the call fails, processing proceeds to SP1.
The dialed number is compared to profile A digitmap.
If SP2 is down, an 11 digit number will match profile A digitmap and be routed to SP1.