News:

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

Main Menu

Digitmap help

Started by jbebel, February 27, 2014, 06:50:34 PM

Previous topic - Next topic

jbebel

I have the following ITSP DigitMap for use with asterisk, formatted for easier reading:

(
4xx |
6[45]xx |
60x |
8[56]00 |
9{t=di2}(011x. |
         (1[2-9]xx | )[2-9]xxxxxx |
         9(11 | 33)
        ) |
9(11 | 33))


In words:
Internal numbers are of the format 4xx
Other networks are prefixed by 6. Mine is 64xx, another is 65xx.
I have a few tools at 60x, like echo tests
voicemail is 8500 and conference rooms are at 8600
To dial an outside line, start with 9
  - International calls then start with 011
  - Long-distance start with 1[2-9]xx
  - local can just be 7 digit dialing.
  - Emergency can be 911 or 933 to test
I also allow dialing 911/933 directly without dialing 9 first.

The problem I'm experiencing is when dialing long-distance numbers slowly. If I dial 9, I get the di2 tone, then if I dial 19, I get a busy signal like I've failed to match a digitmap. If I dial the same thing quickly, not waiting for the di2 tone, the dial works.

Thinking this had to do with allowing 9(11|33) direct dialing, which conflicts with the outside line di2 tone, I tried removing the entry for direct dialing 911. Now if I dial 9, wait 2-3 seconds, and then dial 1, I immediately get a busy signal.

This made me think there was a problem with the '(1[2-9]xx | )[2-9]xxxxxx' syntax for specifying optional 11-digit long-distance or 7-digit local dialing I tried making these options more explicit by splitting them into
two completely separate rules, and that seems to work.

My question is why does this syntax work when dialed quickly, but not dialed slowly? Is there a proper way to match the optional 1+area code and then a 7-digit number, or do they really have to be listed explicitly in the
digitmap?

Thanks

ianobi

#1
jbebel - welcome to the forum.

(1[2-9]xx | )[2-9]xxxxxx is not a recognised OBi syntax. You could devise a rule such as:

1?[2-9]xx. The number can start with 1 or not 1, followed by 2 to 9 followed by any number of digits. However, this would introduce delays as the OBi waits to see if you have finished dialling. Having an explicit rule for each case is the best option.

{t=di2} should only be in a digitmap, not in an InboundCallRoute. By putting it in say ITSP Profile A (which is normally Msp1), you are putting it into the Phone Port DigitMap and OutboundCallRoute. This may be confusing your OBi.

I would need the big picture to see exactly how to set up this config - which OBi do your have? Is it only used for linking to your asterisk? Which is Primary Line etc. I'm going to assume that you are using ITSP Profile A and that your Primary Line is SP1 Service. In which case:

ITSPA = Msp1 = Mpli

Service Providers > ITSP Profile A > General > DigitMap:
(4xx|6[45]xx|60x|8[56]00)

User Settings > User Defined Digit Maps > User Defined Digit Map3 >
Label: ext
DigitMap: (011x.|1[2-9]xxxxxxxxx|[2-9]xxxxxx|(11|33)|9(11|33))

Physical Interfaces > PHONE Port > DigitMap:
([1-9]x?*(Mpli)|[1-9]S9|[1-9][0-9]S9|**0|***|#|**1(Msp1)|**2(Msp2)|**8(Mli)|**9(Mpp)|(Mpli)|9{t=di2}(Mext))

Physical Interfaces > PHONE Port > OutboundCallRoute:
{([1-9]x?*(Mpli)):pp},{(<#:>):li},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},{(<**2:>(Msp2)):sp2},{(<**8:>(Mli)):li},{(<**9:>(Mpp)):pp},{(Mpli):pli},},{(Mext):sp1}

The above example is based on an OBi110.

I'm assuming that you wish the prefix "9" to carry forward to your asterix for external calls. I have removed any explicit references to 911/933 from the Phone Port DigitMap and OutboundCallRoute. Mext should be able to deal with 9911/9933 and 911/933 and forward both formats to your asterix.

As always, I recommend thorough testing of 911/933 following these sort of changes.

I've made a lot of assumptions above - let me know if I'm going off in the wrong direction - it has been known to happen   :)

jbebel

Thanks for the help! Here's a little more detail to help with the assumptions.

I have an Obi110 with one analog phone connected. No POTS line connected. I only use it with asterisk. My Phone Primary Line is set to SP1 service. To simplify the setup, and remove features I didn't make use of, I simply set my Phone DigitMap to "((Msp1))" since anything acceptable by ITSP profile A should be accepted by the Phone line, and nothing else. And I set my Phone Outbound Call Route to "sp1" since I simply want anything dialed by the phone to be sent directly to sp1.

I've set my ITSP profile A digitmap to this:
( 4xx | 6[45]xx | 60x | 8[56]00 | 9{t=di2}(011x. | 1[2-9]xx[2-9]xxxxxx | [2-9]xxxxxx | 9(11|33)) | 9(11|33))

I explicitly listed the 11 digit 1[2-9]xx[2-9]xxxxxx case separately from the 7 digit [2-9]xxxxxx case, which is working for me. I had just hoped for a more concise syntax. Perhaps that's not possible.

Also, from what you're saying though, I shouldn't have {t=di2} in the ITSP digitmap, only in the Phone digitmap. It seems to be working, but perhaps I haven't found the failure case yet. Is the ITSP digitmap actually used by anything if I set the outbound call route to sp1 and explicitly define the phone digitmap? Should I just copy my current ITSP digitmap into the Phone digitmap?

ianobi

Looks to me like you have a pretty good setup for your needs. Anything you put in ITSPA will be in Msp1, so it works ok for the Phone Port DigitMap. Normally, Msp1 also occurs in the Phone Port OutboundCallRoute, but this is not so in your case so {t=di2} causes no problem.

A rule such as 011x. can cause a delay. The OBi will wait ten seconds by default after you dial the final digit to see if you have finished dialling. 011x.S4 will cut the delay to four seconds.

One possible improvement might be to include *** in your Phone Port DigitMap and {***:aa2} in the Phone Port OutboundCallRoute. This would give you access to various info and programming options via the analogue phone. However, this may not be important to you.

I would remove all the spaces in the ITSPA DigitMap. Sometimes they cause problems.



jbebel

Thanks. I removed the spaces and reduced the international timeout to 4s as you suggested. I'm curious to try the aa2 route as you suggested, but if I add that to the outbound call route, don't I then need something like {(Msp1):sp1} in the outbound call route as well, which brings in the {t=d2} which doesn't belong there? I guess I could just do {(x.):sp1}, or is there a better way to say send *** to aa2 and everything else to sp1?

ianobi

This should be ok:

Physical Interfaces > PHONE Port > DigitMap:
(***|(Msp1))

Physical Interfaces > PHONE Port > OutboundCallRoute:
{***:aa2},{(xx.):sp1}

In this case I'm using xx. rather than x. to prevent spurious "nothings" being sent to sp1. xx. requires at least one digit to be dialled.


Gonzo

Hi,

I would greatly appreciate your help with configuring digitmap for an Obi 110.

Local port = need to be able to dial any number starting with 00 (international) or 8 digits (local numbers)
Sp1= google voice.   Any number starting with 1 or 011

Currently my Obi is configured so all calls are routed through google voice and if I want to do local port, I need to dial **8 first which is annoying.


Thanks


azrobert

Service Providers > ITSP Profile A General > DigitMap:
(1xxxxxxxxxx|011xx.S3)

Physical Interfaces > PHONE Port > DigitMap:
([1-9]x?*(Mpli)|[1-9]S9|[1-9][0-9]S9|911|**0|***|#|**1(Msp1)|**2(Msp2)|**8(Mli)|**9(Mpp)|(Mpli)|(Mli))

Physical Interfaces > PHONE Port > OutboundCallRoute:
{(Mli):li},{([1-9]x?*(Mpli)):pp},{(<#:>|911):li},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},{(<**2:>(Msp2)):sp2},{(<**8:>(Mli)):li},{(<**9:>(Mpp)):pp},{(Mpli):pli}

Physical Interfaces > Line Port > DigitMap:
(00xx.S3|xxxxxxxx)

The BOLD items in the Phone Port have been added to the default.


Gonzo

It works great.  Just one thing I forgot and it does not work.  There are some mobile numbers that are 9 digits.  Always start with 09 which I also need to go through local port.  These do not work, so for example

099555555 it does not work withe the digitmap and I cannot figure out how to make the change on your setting to make it work.  Apreciate greatly your help.

Thanks,

azrobert

#9
Instead of me telling you how to do this, why don't you tell me?
First, I'll explain what I did.
This is the DigitMap for the local port:
(00xx.S3|xxxxxxxx)

00xx.S3
00 matches 00
x matches any single digit
x. matches zero or more digits
When a rule ends in x. you will get a 10 delay
S3 overrides the delay to 3 seconds
You need a delay, I won't explain now
This rule will match a number beginning with 00 followed by 1 or more digits.

xxxxxxxx
Each x matches a single digit, so this will match any eight digit number

The vertical bar separates the rules

All the rules are enclosed between ( )

Now tell me how to code a rule that matches a number starting with 09 followed by 7 digits.
Then how to add the new rule to the other rules.

It would have been easier just to tell you. LOL
Sorry for the quiz.

Gonzo

LOL.

Teach a man to fish and he will eat forever.  Give a man a fish and he will eat only for one day.  Isn't that how it goes.  Let's see, I keep changing my requirement so your feedback is quite useful.  I'm also looking at the tutorial I found but I have to admit, I have to put a lot more time to learn all the possibilities and I am leaving today so I want to leave this sort of working.  Maybe a few hours looking at the tutorial will do it...

In terms of local port, I guess I could build the following if I understand your feedback.

(00xx.S3|xxxxxxxxxxxxx?) If I understand correctly, this will match any number starting with 00 follow by 1 or up to 13 digits, correct?.  By putting the ? at the end so it will accept any number of digits from 1 to 12

(09xx.S3|xxxxxxxx?) Same thing but will start with 09 and accept up to 8 digits.

In fact, now I have one that I need to research (notice that I am not asking your help, although I wont reject it if you send me the answer :))

The conclusion that I am reaching is that what I really need is that any 'US' dialmap including numbers that start with 011, I want to send to google voice regardless of lenght and everything else to local port, regardless of lenght

so if I dial 123, I want to local port.  If I have 123456789 to local port, if I dial 00xxxxxxxxx to local port. if I dial 14085556666 I want google voice as this would be an US number.

Thanks




azrobert

#11
I guess I'm a poor teacher.
Quote(00xx.S3|xxxxxxxxxxxxx?) If I understand correctly, this will match any number starting with 00 follow by 1 or up to 13 digits, correct?.  By putting the ? at the end so it will accept any number of digits from 1 to 12

The vertical bar separates the rules, so 00xx.S3 and xxxxxxxxxxxxx? are 2 different rules.
It's like an "OR" operand.
00xx.S3 or xxxxxxxxxxxxx?

The above will match 00 followed by 1 to a zillion digits (x. will match 0 or more digits) OR 12 a digit number OR a 13 digit number.

Anyway, this answers you 1st question:
(00xx.S3|xxxxxxxx|09xxxxxxxx)

If you want anything other than US numbers, use this DigitMap:
(xx.S3)

This digit map causes a routing problem because it will also match US numbers, so the sequence of the outbound call route must change.

Physical Interfaces > PHONE Port > OutboundCallRoute: {([1-9]x?*(Mpli)):pp},{(<#:>|911):li},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},{(<**2:>(Msp2)):sp2},{(<**8:>(Mli)):li},{(<**9:>(Mpp)):pp},{(Mpli):pli},{(Mli):li}

Now US numbers are routed 1st.
Edit:
{(Mpli):pli}
The above rule in the outbound route is for GV. pli points to the primary line (SP1/GV)
This is checking if the dialed number is for the US.
Processing moves left to right, so you are checking for US numbers 1st.
If you get a match the call is routed out SP1.
If not, the next rule is processed.
{(Mli):li}
This will match any number and route it to PSTN.