Hylafax Mailing List Archives

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

A sample complex dialrules file




! HylaFAX (tm) Dialing String Processing Rules for the Toronto Area.
!
! Written by Evan Leibovitch <evan@telly.org>
! This file may be freely distributed; suggestions or improvements
! are welcomed.
!
! Here is an example of how to revise the 'dialrules' file to cope
! with situations in which multiple area codes (or certain parts of
! them) are 'local' calls. As an increasing number of metropolitan
! communities are being split into multiple area codes, there needs to
! be a way to instruct HylaFax which other area codes (and exchanges)
! are local.
!
! Toronto's situation appears typical. What was once all 416 is now
! split between 416 (Toronto itself) and 905 (everything surrounding).
! Many exhchanges can call locally to areas of the other. Also,
! some outlying 905 exchanges can make local calls to some 519 numbers.
!
! Somehow, Hylafax needs to be told which exchanges are local; This is
! done, in the 'Dialstring' portion of the dialrules file, by first
! adding ${LDPrefix} to everything and then removing it if the exchange
! is local.
!
! While this file has most value to Toronto-area users, it offers a
! resaonable template of how to accomplish the same task in other areas.
!
!
! Revision History
! 1.0 1995/11 First release
! 1.1 1998/05 Cleanup, added new exchanges
!
! Information below is covers much of Peel, Halton and York Regions,
! as well as Toronto. The default setup below is for systems located in
! Brampton.
!
!
Area=905                        ! (used for 905 exchanges below)
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
[^+0-9]+                =                       ! strip white space etc.
^${IDPrefix}            = +                     ! replace int. dialing code
^${LDPrefix}            =                       ! strip l.d. dialing code
^[^+]......$            = +${Country}${Area}&   ! default AC
^[^+]*                  = +${Country}&          ! otherwise, insert canon form
]
!
! Process a dialing string according to local requirements.
! This may involve stripping local country and area codes,
! inserting dialing prefixes, etc.
!
DialString := [
[-${WS}.]+              =                       ! strip syntactic sugar
^[+]${Country}          =                       ! Its in North America
^${LDPrefix}            =
^[2-9]......$           = ${LDPrefix}905&       ! default AC for 7-digit Nos.
!                                    ^^^ <----- (change to 416 if the HylaFAX
!                                               system is within Toronto)
^[2-9].........$        = ${LDPrefix}&          ! if the number is 10-digits
!
!
! This part strips the leading ${LDPrefix} from local exchanges
! Uncomment the lines for exchanges that are local to you; comment out
! everything that is long distance from your area.
!
! Acton
!^${LDPrefix}(519853)		= \1
!
! Aurora
!^${LDPrefix}(${Area}71[37])	= \1
!^${LDPrefix}(${Area}727)	= \1
!^${LDPrefix}(${Area}841)	= \1
!
! Bethesda
!^${LDPrefix}(${Area}888)	= \1
!
! Bolton
^${LDPrefix}(${Area}857)	= \1
^${LDPrefix}(${Area}951)	= \1
!
! Bradford
!^${LDPrefix}(${Area}77[58])	= \1
!
! Brampton
^${LDPrefix}(${Area}45)		= \1
^${LDPrefix}(${Area}79[0-39])	= \1
^${LDPrefix}(${Area}84[06])	= \1
^${LDPrefix}(${Area}863)	= \1
^${LDPrefix}(${Area}874)	= \1
!
! Burlington
!^${LDPrefix}(${Area}319)	= \1
!^${LDPrefix}(${Area}33[12356])	= \1
!^${LDPrefix}(${Area}63[12479])	= \1
!^${LDPrefix}(${Area}681)	= \1
!
! Caledon
^${LDPrefix}(519927)		= \1
!
! Caledon East
^${LDPrefix}(${Area}58[46])	= \1
!
! Campbellville
!^${LDPrefix}(${Area}854)	= \1
!
! Castlemore
^${LDPrefix}(${Area}794)	= \1
!
! Erin
!^${LDPrefix}(519833)		= \1
!
! Georgetown
^${LDPrefix}(${Area}70[23])	= \1
^${LDPrefix}(${Area}87[37])	= \1
!
! Gormley
!^${LDPrefix}(${Area}887)	= \1
!
! Grand Valley
!^${LDPrefix}(519928)		= \1
!
! Hillsburgh
!^${LDPrefix}(519855)		= \1
!
! Keswick
!^${LDPrefix}(${Area}476)	= \1
!^${LDPrefix}(${Area}989)	= \1
!
! King City
!^${LDPrefix}(${Area}833)	= \1
!
! Kleinburg
!^${LDPrefix}(${Area}893)	= \1
!
! Maple
!^${LDPrefix}(${Area}303)	= \1
!^${LDPrefix}(${Area}832)	= \1
!
! Markham
!^${LDPrefix}(${Area}201)	= \1
!^${LDPrefix}(${Area}294)	= \1
!^${LDPrefix}(${Area}47[12])	= \1
!
! Milton
!^${LDPrefix}(${Area}229)	= \1
!^${LDPrefix}(${Area}462)	= \1
!^${LDPrefix}(${Area}69[13])	= \1
!^${LDPrefix}(${Area}87[568])	= \1
!
! Mississauga
! (includes Clarkson, Cooksville, Malton,
! Port Credit, Streetsville)
^${LDPrefix}(${Area}206)	= \1
^${LDPrefix}(${Area}212)	= \1
^${LDPrefix}(${Area}238)	= \1
^${LDPrefix}(${Area}27)		= \1
^${LDPrefix}(${Area}28[12])	= \1
^${LDPrefix}(${Area}30[126])	= \1
^${LDPrefix}(${Area}40[35])	= \1
^${LDPrefix}(${Area}50[127])	= \1
^${LDPrefix}(${Area}542)	= \1
^${LDPrefix}(${Area}56[4-9])	= \1
^${LDPrefix}(${Area}60[12789])	= \1
^${LDPrefix}(${Area}61[25])	= \1
^${LDPrefix}(${Area}62[459])	= \1
^${LDPrefix}(${Area}67[0-36-8])	= \1
^${LDPrefix}(${Area}694)	= \1
^${LDPrefix}(${Area}712)	= \1
^${LDPrefix}(${Area}785)	= \1
^${LDPrefix}(${Area}795)	= \1
^${LDPrefix}(${Area}80[34])	= \1
^${LDPrefix}(${Area}81[2349])	= \1
^${LDPrefix}(${Area}82[0-468])	= \1
^${LDPrefix}(${Area}848)	= \1
^${LDPrefix}(${Area}855)	= \1
^${LDPrefix}(${Area}89[0167])	= \1
^${LDPrefix}(${Area}949)	= \1
!
! Newmarket
!^${LDPrefix}(${Area}212)	= \1
!^${LDPrefix}(${Area}715)	= \1
!^${LDPrefix}(${Area}83[06])	= \1
!^${LDPrefix}(${Area}853)	= \1
!^${LDPrefix}(${Area}89[58])	= \1
!^${LDPrefix}(${Area}953)	= \1
!
! Nobleton
!^${LDPrefix}(${Area}859)	= \1
!
! Oak Ridges
!^${LDPrefix}(${Area}313)	= \1
!^${LDPrefix}(${Area}773)	= \1
!
! Oakville
!^${LDPrefix}(${Area}257)	= \1
!^${LDPrefix}(${Area}33[047-9])	= \1
!^${LDPrefix}(${Area}46[79])	= \1
!^${LDPrefix}(${Area}616)	= \1
!^${LDPrefix}(${Area}815)	= \1
!^${LDPrefix}(${Area}82[579])	= \1
!^${LDPrefix}(${Area}84[24579])	= \1
!
! Orangeville
!^${LDPrefix}(51993[89])	= \1
!^${LDPrefix}(51994[0-2])	= \1
!
! Palgrave
^${LDPrefix}(${Area}880)	= \1
!
! Pefferlaw
!^${LDPrefix}(705437)		= \1
!
! Queensville
!^${LDPrefix}(${Area}478)	= \1
!
! Richmond Hill
!^${LDPrefix}(${Area}508)	= \1
!^${LDPrefix}(${Area}737)	= \1
!^${LDPrefix}(${Area}770)	= \1
!^${LDPrefix}(${Area}780)	= \1
!^${LDPrefix}(${Area}88[34])	= \1
!
! Schomberg
!^${LDPrefix}(${Area}939)	= \1
!
! Shelburne
!^${LDPrefix}(519925)		= \1
!
! Snelgrove
^${LDPrefix}(${Area}843)	= \1
!
! Stouffville
!^${LDPrefix}(${Area}64[02])	= \1
!
! Sutton
!^${LDPrefix}(${Area}64[02])	= \1
!
! Thornhill
!^${LDPrefix}(${Area}66[09])	= \1
!^${LDPrefix}(${Area}70[79])	= \1
!^${LDPrefix}(${Area}73[18])	= \1
!^${LDPrefix}(${Area}76[14])	= \1
!^${LDPrefix}(${Area}771)	= \1
!^${LDPrefix}(${Area}879)	= \1
!^${LDPrefix}(${Area}88[1269])	= \1
!
! Toronto (Metro)
^${LDPrefix}416			= 416
^${LDPrefix}(905509)		= \1
!
! Tottenham
!^${LDPrefix}(${Area}936)	= \1
!
! Unionville
!^${LDPrefix}(${Area}305)	= \1
!^${LDPrefix}(${Area}316)	= \1
!^${LDPrefix}(${Area}415)	= \1
!^${LDPrefix}(${Area}47[04579])	= \1
!^${LDPrefix}(${Area}513)	= \1
!^${LDPrefix}(${Area}94[0468])	= \1
!
! Victoria
^${LDPrefix}(${Area}838)	= \1
!
! Woodbridge
!^${LDPrefix}(${Area}264)	= \1
!^${LDPrefix}(${Area}85[016])	= \1
!
! Final tweaking
^[+]${Country}${Area}   = ${Area}	! same-country call
^[+]                    = ${IDPrefix}	! international call
]



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