HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] How to force area codes and the "1" prefix with dialrules



Thanks, that gave me a good starting point.

On Oct 10, 2007, at 12:38 PM, Bruce McAlister wrote:



John Warren wrote:
I've been trying to figure out dialing rules. What I want to do is the
following.

Assume the following:
Local Area code = 310
Country code = 1
International calling prefix = 011
LD Dialing prefix = 1

Also assume that we're in a area with two area codes that are overlaid
so you must always dial the area code.

13105551212 no change

3105551212 change to 13105551212 (with the default rules the number is
left unchanged)

5551212 change to 13105551212 (with the default rules the number is
left unchanged)

14155551212 no change

4155551212 changed to 14155551212

011445551212 no change

Is there a way to do this with dialing rules? It seems to me it would
be a good thing since more and more areas are requiring full 10 digit
dialing in the US.

The attached email from some time ago may point you in the right
direction for what you want to do.


John Warren

Network Operations Administrator
Prudent Rx Inc.





____________________ HylaFAX(tm) Users Mailing List
_______________________
 To subscribe/unsubscribe, click
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx <
/dev/null
 *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxx.*




From: Lee Howard <faxguy@xxxxxxxxxxxxxxxx>
Date: March 25, 2006 8:14:00 PM PST
Subject: Re: Dialrules, local exchange dialing.


Bill Campbell wrote:

Has anybody put together a database of dialrules that deals with the issues
of local vs long distance dialing by area code and exchange?

 


Yes many times for different areas.

Our local dialrules file is about 400 lines of mappings, some of which are
mapping exchanges that were in our 206 area code to new area codes, but
most of them are used to remove the ``1'' prefix from prefixes in other
area codes that are local calls, and the rest add the ``1'' to exchanges in
the 206 area code that are long distance calls.

 


Your clients are going to, if they don't typo, enter in either a 7-digit, a 10-digit, or an 11-digit number for domestic calls.  (In areas like Seattle dialing with a 7-digit number is, in my opinion, unsafe unless you're absolutely sure what area code the line is in that will be used to place the call.  But nonetheless clients will still send 7-digit numbers.)  If, you don't want to make an assumption about an area code then you can reject calls with DestControls that don't have 10 digits:

 ^[+][0-9]{0,9}$ RejectNotice = "Number too Short, need at least 10 digits"

Otherwise, you can use dialrules to add the area code for you (see below).

First off, you want to learn to use dialtest in order to work through the fine-tuning of your dialrules.

 dialtest -a 206 /var/spool/hylafax/etc/dialrules

Then start provide it possible numbers that clients may submit and see if dialrules accomplishes what you need.  If not, then adjust dialrules and try again.  So let's say that my area code is 206 and that my telco requires 10-digit dialing and that I am okay with assuming that 7-digit numbers refer to area code 206 and that the only exchanges that are local to me are 444 and 555 (yes, I know that this is an absurdly short local exchange list).  Then the dialstring portion of my dialrules file may look like this:

DialString := [
[-${WS}.]+ = ! strip syntactic sugar
[abcABC] = 2 ! these convert alpha to numbers
[defDEF] = 3
[ghiGHI] = 4
[jklJKL] = 5
[mnoMNO] = 6
[prsPRS] = 7
[tuvTUV] = 8
[wxyWXY] = 9
^[0-9]{10}$ = ${Country}& ! add country code for 10-digit dialers
^[0-9]{7}$ = ${AreaCode}& ! add area code for 7-digit dialers
^[+]${Country}${AreaCode}444[0-9]{4}$ = ${AreaCode}444& ! local call, strip the +1
^[+]${Country}${AreaCode}555[0-9]{4}$ = ${AreaCode}555& ! local call, strip the +1
^[+]${Country} = ${LDPrefix} ! long distance call, replace country code with long distance code
^[+] = ${IDPrefix} ! international call
]

What this does is it does the usual whitespace stripping and alpha conversions.  Then, if the number is 10-digits it adds a "1" to the beginning of it - because requiring people to know when to use a 1 and when not to use a 1 is silly - so everyone will dial 10-digits.  If it happens to be a 206444 or 206555 number then it will get processed further, otherwise there will be no more processing of this number. Then if the number is 7-digits it adds the area code to the front of that.  There is no further processing of that number.  Now it takes all numbers that at this point say 1206444 or 1206555 and it strips off the 1.  At that point it's essentially done - replacing the country code wit hthe long distance code probably means nothing in your situation.  The last rule, international, probably is useless since nobody ever dials with canonical format.

Now, you probably can take that as-is but replace the two exchange examples with the hundred or so exchanges that are local to you.

This wouldn't be a problem if the telco's switches were programmed to dial
local numbers with a ``1'' prefix, stripping it for calls local to the
exchange.


In my experience telcos very rarely support dialing long distance without the 1 or dialing local with the 1.  That's there way of making sure that you're aware that you're gonna get charged for the call.

I haven't even been able to find anybody in our telco that could
give me documentation on what's long distance, and what's local from our
exchange.

 


Getting that list is an absolute MUST.  When I was up in King County I found most of this list from the front of the big thick tree-killer that they called a phone book.  However, if you want to include (you probably don't as they're not likely to be fax) wireless numbers you're probably going to have to get this by requesting it by phoning them over and over and over until you get in touch with someone that can get it to you.  Sometimes it takes me days of phone calls at various times in order to locate an employee competent enough to get that to me.  Usually the numbers in the front of the phone book are enough to get you going.

Getting the dialrules file right has always been one of the biggest issues
when installing hylafax at a new location.

 


It's not fun, no.  I'm not sure that there's a better way, though.

I've thought it would be nice to have xmlrpc server(s) which would return
the proper prefix when passed the local and destination area codes and
exchanges.

Another option might be to have the hylafax send program call an external
program, specified in the config file, that would take the called number as
an argument, and return the proper dial string.


In any case you still have to obtain a list of exchanges.  I'm not sure that coding in dialrules is any harder than coding in shell or whatever.

Hope that helps,

Lee.


____________________ HylaFAX(tm) Users Mailing List _______________________
 To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
 *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxx.*




<bruce.mcalister.vcf>




Project hosted by iFAX Solutions