Hylafax Mailing List Archives

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

[hylafax-users] 10 digit dialing, dialrules, Toronto, area code 416




Alan Olsen wrote on 23/03/04 02:24 PM:


Also, does anyone have a good set of dialrules for dealing with 10-digit dialing? (Like, for example Portland, Oregon?)

Hi Alan,


I can't help you with Portland, Oregon in particular, but here's what I did for my area (Toronto, Ontario, Canada, area code 416 and 647) which also has 10 digit dialing (within Toronto, and to the surrounding 905 and 289).

Check out http://members.dandy.net/~czg/search.html

I found it to be a very useful web site which covered everything I needed to know about which exchanges are local and which are long distance from Toronto, and a quick search for Portland seems to show the equivalent information. It can even tell you which cellular carrier your friends use, based on which exchanges their numbers are in (though that may get mixed up if portable numbers come in).

For the newbies: (and speaking in terms of North America) by "exchange" I mean the first 3 digits in the old fashioned 7 digit numbers, or nowadays, the middle 3 of the 10 digit number. I.e. in the canonical number +1-416-555-6677, the 1 is the "country" code, 416 is the area code, 555 is the exchange. ("Country code" being a bit of misnomer since it includes USA and Canada and I think even Puerto Rico or something like that.)

Using this and some search-and-replace editing, I created the attached dialrules file which adds the 1 prefix for all my calls that need it (i.e. that are long distance) and doesn't add it (in fact takes it out if present) for all my calls that don't need it. This assumes all numbers come in to the script either as 10 digit 416-555-6677 or canonical +1-416-555-6677. Of course they can use different separators or other "syntactic sugar" as is already handled in the default dialrules file.

It does not handle 7 digit numbers by guessing that you want to add 416, or anything. In fact I've never tried it with a 7 digit number, so lets just say the behaviour is undefined in that case.

Enjoy.

Martin

p.s. By the way there are others in the archives (Google for hylafax dialrules toronto) but they seem to either be incomplete or to pre-date the switch to 10 digit dialing.
! $Id: dialrules,v 1.2 2002/05/23 20:05:14 darren Exp $
!
! HylaFAX (tm) Dialing String Processing Rules.
!
! This file describes how to process user-specified dialing strings
! to create three items:
!
! CanonicalNumber: a unique string that is derived from all dialing
! strings to the same destination phone number.  This string is used
! by the fax server for ``naming'' the destination. 
!
! DialString: the string passed to the modem for use in dialing the
! telephone.  This string should be void of any characters that might
! confuse the modem.
!
! DisplayNumber: the external, displayable, form of a number that
! does not include private information which should not be displayed
! to clients.
!
Area=${AreaCode}		! local area code
Country=${CountryCode}		! local country code
IDPrefix=${InternationalPrefix}	! prefix for placing an international call
LDPrefix=${LongDistancePrefix}	! prefix for placing a long distance call
!
WS=" 	"			! our notion of white space
!
! Convert a phone number to a canonical format:
!
!    +<country><areacode><rest>
!
! by (possibly) stripping off leading dialing prefixes for
! long distance and/or international dialing.
!
CanonicalNumber := [
#.*			=			! strip calling card stuff
[abcABC]		= 2			! these convert alpha to numbers
[defDEF]		= 3
[ghiGHI]		= 4
[jklJKL]		= 5
[mnoMNO]		= 6
[prsPRS]		= 7
[tuvTUV]		= 8
[wxyWXY]		= 9
[^+0-9]+		=			! strip white space etc.
^${IDPrefix}		= +			! replace int. dialing code
^${LDPrefix}		= +${Country}		! replace l.d. dialing code
^[^+]{10}		= +${Country}&	! otherwise, insert canon form
]
!
! Process a dialing string according to local requirements.
! These rules do only one transformation: they convert in-country
! international calls to long-distance calls.
!
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
^[+]${Country}		= ${LDPrefix}		! long distance call
^[+]			= ${IDPrefix}		! international call
^800[0-9]{7}		= 1&		! 8001234567 to 18001234567
^888[0-9]{7}		= 1&		! similarly for 1888 numbers
^877[0-9]{7}		= 1&		! 1877...
^866[0-9]{7}		= 1&		! 1866...
!
!
! For dialing from Toronto, Ontario, Canada
! - original Area Code 416
! - recently (around 2001) 647 overlay was added in the same area
! - surrounding region is 905, to which 289 was recently overlaid
! - from 416, some 905 exchanges are local (don't need a 1 prefix to dial)
!   while others are long distance (need a 1 prefix)
! - this web site http://members.dandy.net/~czg/search.html was very
!   handy for getting the list of which exchanges are local
!
!
^1(905[0-9]{7})  =  \1		! chop the 1 from all 905s and then add it
^905213[0-9]{4}  =  1&		! back for exchanges known to be long
^905220[0-9]{4}  =  1&		! distance from Toronto (416/647)
^905227[0-9]{4}  =  1&
^905228[0-9]{4}  =  1&
^905229[0-9]{4}  =  1&
^905242[0-9]{4}  =  1&
^905243[0-9]{4}  =  1&
^905244[0-9]{4}  =  1&
^905246[0-9]{4}  =  1&
^905251[0-9]{4}  =  1&
^905252[0-9]{4}  =  1&
^905259[0-9]{4}  =  1&
^905260[0-9]{4}  =  1&
^905261[0-9]{4}  =  1&
^905262[0-9]{4}  =  1&
^905263[0-9]{4}  =  1&
^905269[0-9]{4}  =  1&
^905295[0-9]{4}  =  1&
^905296[0-9]{4}  =  1&
^905297[0-9]{4}  =  1&
^905304[0-9]{4}  =  1&
^905308[0-9]{4}  =  1&
^905309[0-9]{4}  =  1&
^905312[0-9]{4}  =  1&
^905314[0-9]{4}  =  1&
^905315[0-9]{4}  =  1&
^905317[0-9]{4}  =  1&
^905318[0-9]{4}  =  1&
^905319[0-9]{4}  =  1&
^905320[0-9]{4}  =  1&
^905321[0-9]{4}  =  1&
^905322[0-9]{4}  =  1&
^905323[0-9]{4}  =  1&
^905324[0-9]{4}  =  1&
^905325[0-9]{4}  =  1&
^905327[0-9]{4}  =  1&
^905328[0-9]{4}  =  1&
^905329[0-9]{4}  =  1&
^905331[0-9]{4}  =  1&
^905332[0-9]{4}  =  1&
^905333[0-9]{4}  =  1&
^905335[0-9]{4}  =  1&
^905336[0-9]{4}  =  1&
^905340[0-9]{4}  =  1&
^905341[0-9]{4}  =  1&
^905342[0-9]{4}  =  1&
^905344[0-9]{4}  =  1&
^905345[0-9]{4}  =  1&
^905346[0-9]{4}  =  1&
^905347[0-9]{4}  =  1&
^905348[0-9]{4}  =  1&
^905349[0-9]{4}  =  1&
^905351[0-9]{4}  =  1&
^905352[0-9]{4}  =  1&
^905353[0-9]{4}  =  1&
^905354[0-9]{4}  =  1&
^905355[0-9]{4}  =  1&
^905356[0-9]{4}  =  1&
^905357[0-9]{4}  =  1&
^905358[0-9]{4}  =  1&
^905359[0-9]{4}  =  1&
^905360[0-9]{4}  =  1&
^905371[0-9]{4}  =  1&
^905372[0-9]{4}  =  1&
^905373[0-9]{4}  =  1&
^905374[0-9]{4}  =  1&
^905375[0-9]{4}  =  1&
^905376[0-9]{4}  =  1&
^905377[0-9]{4}  =  1&
^905378[0-9]{4}  =  1&
^905379[0-9]{4}  =  1&
^905380[0-9]{4}  =  1&
^905381[0-9]{4}  =  1&
^905382[0-9]{4}  =  1&
^905383[0-9]{4}  =  1&
^905384[0-9]{4}  =  1&
^905385[0-9]{4}  =  1&
^905386[0-9]{4}  =  1&
^905387[0-9]{4}  =  1&
^905388[0-9]{4}  =  1&
^905389[0-9]{4}  =  1&
^905390[0-9]{4}  =  1&
^905392[0-9]{4}  =  1&
^905393[0-9]{4}  =  1&
^905396[0-9]{4}  =  1&
^905397[0-9]{4}  =  1&
^905404[0-9]{4}  =  1&
^905429[0-9]{4}  =  1&
^905430[0-9]{4}  =  1&
^905431[0-9]{4}  =  1&
^905432[0-9]{4}  =  1&
^905433[0-9]{4}  =  1&
^905434[0-9]{4}  =  1&
^905435[0-9]{4}  =  1&
^905436[0-9]{4}  =  1&
^905438[0-9]{4}  =  1&
^905439[0-9]{4}  =  1&
^905440[0-9]{4}  =  1&
^905441[0-9]{4}  =  1&
^905442[0-9]{4}  =  1&
^905443[0-9]{4}  =  1&
^905444[0-9]{4}  =  1&
^905447[0-9]{4}  =  1&
^905448[0-9]{4}  =  1&
^905449[0-9]{4}  =  1&
^905468[0-9]{4}  =  1&
^905473[0-9]{4}  =  1&
^905476[0-9]{4}  =  1&
^905478[0-9]{4}  =  1&
^905481[0-9]{4}  =  1&
^905512[0-9]{4}  =  1&
^905514[0-9]{4}  =  1&
^905515[0-9]{4}  =  1&
^905516[0-9]{4}  =  1&
^905517[0-9]{4}  =  1&
^905518[0-9]{4}  =  1&
^905520[0-9]{4}  =  1&
^905521[0-9]{4}  =  1&
^905522[0-9]{4}  =  1&
^905523[0-9]{4}  =  1&
^905524[0-9]{4}  =  1&
^905525[0-9]{4}  =  1&
^905526[0-9]{4}  =  1&
^905527[0-9]{4}  =  1&
^905528[0-9]{4}  =  1&
^905529[0-9]{4}  =  1&
^905531[0-9]{4}  =  1&
^905536[0-9]{4}  =  1&
^905537[0-9]{4}  =  1&
^905540[0-9]{4}  =  1&
^905541[0-9]{4}  =  1&
^905543[0-9]{4}  =  1&
^905544[0-9]{4}  =  1&
^905545[0-9]{4}  =  1&
^905546[0-9]{4}  =  1&
^905547[0-9]{4}  =  1&
^905548[0-9]{4}  =  1&
^905549[0-9]{4}  =  1&
^905560[0-9]{4}  =  1&
^905561[0-9]{4}  =  1&
^905562[0-9]{4}  =  1&
^905563[0-9]{4}  =  1&
^905570[0-9]{4}  =  1&
^905571[0-9]{4}  =  1&
^905572[0-9]{4}  =  1&
^905573[0-9]{4}  =  1&
^905574[0-9]{4}  =  1&
^905575[0-9]{4}  =  1&
^905576[0-9]{4}  =  1&
^905577[0-9]{4}  =  1&
^905578[0-9]{4}  =  1&
^905579[0-9]{4}  =  1&
^905592[0-9]{4}  =  1&
^905594[0-9]{4}  =  1&
^905623[0-9]{4}  =  1&
^905627[0-9]{4}  =  1&
^905628[0-9]{4}  =  1&
^905630[0-9]{4}  =  1&
^905631[0-9]{4}  =  1&
^905632[0-9]{4}  =  1&
^905633[0-9]{4}  =  1&
^905634[0-9]{4}  =  1&
^905636[0-9]{4}  =  1&
^905637[0-9]{4}  =  1&
^905638[0-9]{4}  =  1&
^905639[0-9]{4}  =  1&
^905641[0-9]{4}  =  1&
^905643[0-9]{4}  =  1&
^905644[0-9]{4}  =  1&
^905645[0-9]{4}  =  1&
^905646[0-9]{4}  =  1&
^905648[0-9]{4}  =  1&
^905650[0-9]{4}  =  1&
^905651[0-9]{4}  =  1&
^905655[0-9]{4}  =  1&
^905656[0-9]{4}  =  1&
^905657[0-9]{4}  =  1&
^905658[0-9]{4}  =  1&
^905659[0-9]{4}  =  1&
^905661[0-9]{4}  =  1&
^905662[0-9]{4}  =  1&
^905663[0-9]{4}  =  1&
^905664[0-9]{4}  =  1&
^905665[0-9]{4}  =  1&
^905666[0-9]{4}  =  1&
^905667[0-9]{4}  =  1&
^905668[0-9]{4}  =  1&
^905674[0-9]{4}  =  1&
^905675[0-9]{4}  =  1&
^905679[0-9]{4}  =  1&
^905680[0-9]{4}  =  1&
^905681[0-9]{4}  =  1&
^905682[0-9]{4}  =  1&
^905684[0-9]{4}  =  1&
^905685[0-9]{4}  =  1&
^905687[0-9]{4}  =  1&
^905688[0-9]{4}  =  1&
^905689[0-9]{4}  =  1&
^905690[0-9]{4}  =  1&
^905692[0-9]{4}  =  1&
^905697[0-9]{4}  =  1&
^905701[0-9]{4}  =  1&
^905704[0-9]{4}  =  1&
^905708[0-9]{4}  =  1&
^905714[0-9]{4}  =  1&
^905715[0-9]{4}  =  1&
^905716[0-9]{4}  =  1&
^905718[0-9]{4}  =  1&
^905719[0-9]{4}  =  1&
^905720[0-9]{4}  =  1&
^905721[0-9]{4}  =  1&
^905722[0-9]{4}  =  1&
^905723[0-9]{4}  =  1&
^905725[0-9]{4}  =  1&
^905728[0-9]{4}  =  1&
^905730[0-9]{4}  =  1&
^905732[0-9]{4}  =  1&
^905733[0-9]{4}  =  1&
^905734[0-9]{4}  =  1&
^905735[0-9]{4}  =  1&
^905736[0-9]{4}  =  1&
^905741[0-9]{4}  =  1&
^905743[0-9]{4}  =  1&
^905745[0-9]{4}  =  1&
^905753[0-9]{4}  =  1&
^905765[0-9]{4}  =  1&
^905768[0-9]{4}  =  1&
^905772[0-9]{4}  =  1&
^905774[0-9]{4}  =  1&
^905775[0-9]{4}  =  1&
^905776[0-9]{4}  =  1&
^905777[0-9]{4}  =  1&
^905778[0-9]{4}  =  1&
^905779[0-9]{4}  =  1&
^905786[0-9]{4}  =  1&
^905788[0-9]{4}  =  1&
^905797[0-9]{4}  =  1&
^905802[0-9]{4}  =  1&
^905806[0-9]{4}  =  1&
^905809[0-9]{4}  =  1&
^905818[0-9]{4}  =  1&
^905830[0-9]{4}  =  1&
^905834[0-9]{4}  =  1&
^905835[0-9]{4}  =  1&
^905836[0-9]{4}  =  1&
^905853[0-9]{4}  =  1&
^905868[0-9]{4}  =  1&
^905869[0-9]{4}  =  1&
^905871[0-9]{4}  =  1&
^905885[0-9]{4}  =  1&
^905892[0-9]{4}  =  1&
^905894[0-9]{4}  =  1&
^905895[0-9]{4}  =  1&
^905898[0-9]{4}  =  1&
^905899[0-9]{4}  =  1&
^905902[0-9]{4}  =  1&
^905920[0-9]{4}  =  1&
^905921[0-9]{4}  =  1&
^905922[0-9]{4}  =  1&
^905923[0-9]{4}  =  1&
^905924[0-9]{4}  =  1&
^905925[0-9]{4}  =  1&
^905928[0-9]{4}  =  1&
^905929[0-9]{4}  =  1&
^905931[0-9]{4}  =  1&
^905932[0-9]{4}  =  1&
^905933[0-9]{4}  =  1&
^905934[0-9]{4}  =  1&
^905935[0-9]{4}  =  1&
^905937[0-9]{4}  =  1&
^905938[0-9]{4}  =  1&
^905945[0-9]{4}  =  1&
^905952[0-9]{4}  =  1&
^905953[0-9]{4}  =  1&
^905954[0-9]{4}  =  1&
^905955[0-9]{4}  =  1&
^905957[0-9]{4}  =  1&
^905960[0-9]{4}  =  1&
^905961[0-9]{4}  =  1&
^905962[0-9]{4}  =  1&
^905963[0-9]{4}  =  1&
^905966[0-9]{4}  =  1&
^905967[0-9]{4}  =  1&
^905971[0-9]{4}  =  1&
^905972[0-9]{4}  =  1&
^905973[0-9]{4}  =  1&
^905974[0-9]{4}  =  1&
^905975[0-9]{4}  =  1&
^905977[0-9]{4}  =  1&
^905978[0-9]{4}  =  1&
^905979[0-9]{4}  =  1&
^905980[0-9]{4}  =  1&
^905982[0-9]{4}  =  1&
^905983[0-9]{4}  =  1&
^905984[0-9]{4}  =  1&
^905985[0-9]{4}  =  1&
^905986[0-9]{4}  =  1&
^905987[0-9]{4}  =  1&
^905988[0-9]{4}  =  1&
^905989[0-9]{4}  =  1&
^905991[0-9]{4}  =  1&
^905992[0-9]{4}  =  1&
^905993[0-9]{4}  =  1&
^905994[0-9]{4}  =  1&
^1(289[0-9]{7})  =  \1		! chop the 1 (if there) from 289s, then add it
^289213[0-9]{4}  =  1&		! back for exchanges known to be long dist
^289213[0-9]{4}  =  1&
^289231[0-9]{4}  =  1&
^289237[0-9]{4}  =  1&		! So far there are only 22 exchanges in 289
^289241[0-9]{4}  =  1&		! and the 14 shown are not local to 416
^289251[0-9]{4}  =  1&		! (these are: 314,221,889,360,242,259,885,888)
^289260[0-9]{4}  =  1&		! http://members.dandy.net/~czg/search.html
^289321[0-9]{4}  =  1&		! as of 20030910
^289331[0-9]{4}  =  1&
^289395[0-9]{4}  =  1&
^289439[0-9]{4}  =  1&
^289669[0-9]{4}  =  1&
^289821[0-9]{4}  =  1&
^289886[0-9]{4}  =  1&
^289887[0-9]{4}  =  1&
^519[0-9]{7}     =  1&		! all 519s are long dist, so add the 1,
^1(519927[0-9]{4}) = \1		! except 519-927-xxxx (Caledon) so chop the 1
^705[0-9]{7}     =  1&		! all 705s are long dist
]
!
! Strip private information from the dial string which should not be
! displayed to clients.  By default, DisplayNumber is not set.
!
! DisplayNumber := [
! ]


Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services