Dial Patterns

Amphibian

Joined
Sep 8, 2009
Messages
1,128
Likes
2
Points
38
#1
Trying to set up "Out Bound Routes" with the following "Preferred" US Format (+1NPANXXXXXX) as given to me by my VoIp Provider. When doing so from Elastix's PBX Config I get error when trying to save under dial rules, even if I try to do this pattern under trunk rules I receive the same error.

Does this need to be done under sip.conf instaed of GUI, or, am I trying to enter something that Elastix/Asterisk does not understand?



Thanks
William
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#2
What format do you need for your provider? Do you need the + in front of the international number?

Or do you just need a 1 in front of the 10 digits numbers.

Outbound route dial pattern are match filter. You just check which numbers needs to go to which route.
You can't do a + operation in a dial pattern of an outbound route. You can however do a remove (|) to remove prefix.

In your trunk dial rule however you can do + and |

I would suggest to read the great tutorial here:

http://www.freepbx.org/support/docu...s-on-route-dial-patterns-and-trunk-dial-rules

In my outbound routes, I have a route I called US that has the following dial pattern:
001NXXNXXXXXX
0111NXXNXXXXXX
1NXXNXXXXXX
NXXNXXXXXX


It will point to different trunk.

For some trunk I need to present the US number with just a 1 in front, for some others I need to present it with a 001 in front.

first type trunk dial rule:
00|1X.
011|1X.
1+NXXNXXXXXX

second type trunk dial rule:
001+NXXNXXXXXX
00+1NXXNXXXXXX

Hope you'll have a better understanding of the difference between dial pattern and dial rule.
 

Amphibian

Joined
Sep 8, 2009
Messages
1,128
Likes
2
Points
38
#3
Thank you very much Patrick,

I guess I'm being a dummy this morning, as I not fully understanding the article at your link given. Too early or not enough coffee yet. I generally pick this stuff up pretty quick, but for some reason I'm not grasping this whole dial rules and dial patterns stuff. I pretty much have the system working except for the trunks and outbound dialing. This is the only thing keeping me from actually connecting my fxo and network to the machine. I don't want to place it "online" so to speak and then find I have a bunch of long distance or other charges on my fxo line or VoIp Trunks(especially calls to 900 numbers).

I'm trying a new VoIp service. In their "test information sheet" they sent me, under "Preferred US Format" they have "+1NPANXXXXXX" as the preferred method of dialing. I am assuming that this means that each number dialed in the US (where I am) needs to have a 1, plus the area code, then the full 7 digit number. And, then for international format, they have preferred format as "011-Country Code-Number".

My area code here is 936. Most all calls out will be to this area code. I don't want to restrict calls to other area codes within the USA except for 900 numbers (or other like pay codes). I want to make sure I some how restrict calls to 900 and the like numbers. I then will need a trunk set up for calling mostly Mexico numbers for a non-profit deal I'm looking at doing for several churches.

I've been four days now trying to get this working and would like to get it online and try it. I know once I do get it setup, I will get the hang of it.

I am willing to translate Spanish to English documents for training, or for this forum, in exchange for help with this. Time and labor I have plenty of.

Thanks
William
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#4
You need to separate two concepts:

the way your users are dialing and the way the number should be transmitted to your provider.

I'm basing your needs as follow:
You're in the US.
you want to restrict access to high cost route
you want to restrict international call except for Mexico numbers.
you want to dial US number with 7, 10 or 11 digits

Let's create a few outbound routes in this order:

Emergencies: to route your 911 call with a specific provider that is alowing e911.
dial pattern: 911

Expensive numbers: to route the calls towards the carribean and other expensive numbers
put a password to protect this route.
dial pattern:
001242NXXXXXX
001246NXXXXXX
001264NXXXXXX
001268NXXXXXX
001284NXXXXXX
001340NXXXXXX
001345NXXXXXX
001441NXXXXXX
001473NXXXXXX
001649NXXXXXX
001664NXXXXXX
001758NXXXXXX
001767NXXXXXX
001784NXXXXXX
001787NXXXXXX
001809NXXXXXX
001829NXXXXXX
001849NXXXXXX
001868NXXXXXX
001869NXXXXXX
001876NXXXXXX
001900XXXXXXX
001939NXXXXXX
0111242NXXXXXX
0111246NXXXXXX
0111264NXXXXXX
0111268NXXXXXX
0111284NXXXXXX
0111340NXXXXXX
0111345NXXXXXX
0111441NXXXXXX
0111473NXXXXXX
0111649NXXXXXX
0111664NXXXXXX
0111758NXXXXXX
0111767NXXXXXX
0111784NXXXXXX
0111787NXXXXXX
0111809NXXXXXX
0111829NXXXXXX
0111849NXXXXXX
0111868NXXXXXX
0111869NXXXXXX
0111876NXXXXXX
0111900XXXXXXX
0111939NXXXXXX
1242NXXXXXX
1246NXXXXXX
1264NXXXXXX
1268NXXXXXX
1284NXXXXXX
1340NXXXXXX
1345NXXXXXX
1441NXXXXXX
1473NXXXXXX
1649NXXXXXX
1664NXXXXXX
1758NXXXXXX
1767NXXXXXX
1784NXXXXXX
1787NXXXXXX
1809NXXXXXX
1829NXXXXXX
1849NXXXXXX
1868NXXXXXX
1869NXXXXXX
1876NXXXXXX
1900XXXXXXX
1939NXXXXXX
242NXXXXXX
246NXXXXXX
264NXXXXXX
268NXXXXXX
284NXXXXXX
340NXXXXXX
345NXXXXXX
441NXXXXXX
473NXXXXXX
649NXXXXXX
664NXXXXXX
758NXXXXXX
767NXXXXXX
784NXXXXXX
787NXXXXXX
809NXXXXXX
829NXXXXXX
849NXXXXXX
868NXXXXXX
869NXXXXXX
876NXXXXXX
900XXXXXXX
939NXXXXXX

US NANPA: regular US and CAN number
dial pattern:
001NXXNXXXXXX
0111NXXNXXXXXX
1NXXNXXXXXX
NXXNXXXXXX
NXXXXXX

Mexico: calls to Mexico
dial pattern: (you can be more restrictive to limit to certain area or numbers
0052X.
01152X.

international calls: calls everywhere else
password protected
dial pattern:
00X.
011X.


If you want to completely remove access to some route, instead of putting a password restriction, you can just not put any trunk in the trunk sequence.



Now for your trunks.

If your trunk need to have US number presented with a 1 and international numbers with 00 or 011:
dial rules:
00|1NXXNXXXXXX
011|1NXXNXXXXXX
1+NXXNXXXXXX
1936+NXXXXXX

If your trunk need to have US number presented with a 1 and international numbers with 011 only (no 00):
dial rules:
00|1NXXNXXXXXX
011|1NXXNXXXXXX
1+NXXNXXXXXX
1936+NXXXXXX
00|011+N.
 

Amphibian

Joined
Sep 8, 2009
Messages
1,128
Likes
2
Points
38
#5
Thank you Patric,

I will try this and see how well it works. Are you in USA or where?

Let me know where I can help you or others if needed.


Thanks
William
 

Amphibian

Joined
Sep 8, 2009
Messages
1,128
Likes
2
Points
38
#6
Just for my education, +1NPANXXXXXX how does this break down

+ add what, the area code and number?

The "P" I think is what is sending my brain up the river.

Thanks
William
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#7
Amphibian said:
Just for my education, +1NPANXXXXXX how does this break down

+ add what, the area code and number?

The "P" I think is what is sending my brain up the river.

Thanks
William
in Asterisk, the + means add what is before the +, if you don't have anything before that does not mean anything.

Also A and P are not valid Asterisk dial plan syntaxes.

What they probably wanted to say is add 1 and the NPA in front of your 7 digits dialing.
that's what you do on your trunk with the rules: 1936+NXXXXXX
and with 1+NXXNXXXXXX for 10 digits dialing.
 

Patrick_elx

Joined
Dec 14, 2008
Messages
1,120
Likes
0
Points
0
#8
Also, I forgot to mention, but it's also easy to try manually the different dial patterns that will work with your provider.

Just create a blank outbound route that use your trunk, and put a blank dial rules in the trunk.
dial 7,9 and 11 digits numbers and international ones too to test them. And check what is working.

You can then adapt your dial plan for this provider.

You can also do that with a soft phone (Zoiper, X-lite) directly connected to your provider and try manually the same pattern to check.
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,886
Members
17,563
Latest member
dineshr
Top