![]() |
Does someone have an example dialrules config I can see to get the idea on setting up all the local / long distance numbers.
Here in Ontario we have local and long distance numbers in the 519 area code, and as I recall I need to list which ones are local, and which ones are long distance.
This is what I use. It's function isn't such much as to figure out local and long distance, but rather to know when to add *remove* an area code. - Mike Porter PGP Fingerprint: F4 AE E1 9F 67 F7 DA EA 2F D2 37 F3 99 ED D1 C2
! Enter the list of local exchanges we don't want to dial long ! distance for. This is needed because when Verizon customers ! switch to Cavalier, and the call remains with the Newark switch, ! something often screws up and numbers dialed as: ! 9-1-302-737-0684 often times don't work for screwy reasons when ! number is a Cavalier customer. If the number is dialed as ! 9-737-0684, it works fine. So, we will *not* dial Newark ! numbers with a leading 1-302.
IDPrefix=${InternationalPrefix} ! prefix for placing an international call LDPrefix=${LongDistancePrefix} ! prefix for placing a long distance call Out="9" ! 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 [-${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]+ = ! strip white space etc.
! 4 -> 11 digits (1234 -> 13028311234) ^([0-9]{4})$ = ${LDPrefix}${Area}${Exchange}\1
! 7 -> 11 digits (7370684 -> 13027370684) ^([0-9]{7})$ = ${LDPrefix}${Area}\1
! 8 -> 11 digits (97370684 -> 13027370684) ^${Out}([0-9]{7})$ = ${LDPrefix}${Area}\1
! 8 -> 11 digits (17370684 -> 13027370684) ^${LDPrefix}([0-9]{7})$ = ${LDPrefix}${Area}\1
! 10 -> 11 digits (3027370684 -> 13027370684) ^([0-9]{10})$ = ${LDPrefix}\1
^${IDPrefix} = + ! replace int. dialing code ^${LDPrefix} = +${Country} ! replace l.d. dialing code ^[^+] = +${Country}${Area}& ! otherwise, insert canon form ^911 = "" ] ! ! 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
! Hide all international from any mangling at all. ! International are numbers starting with 011 with at ! least 5 more digits, or 9-011...
^${IDPrefix}([0-9]{5,}$) = +\1 ^${Out}${IDPrefix}([0-9]{1,}) = +\1
! 7 -> 8 digits (234-4567 -> 9-234-4567) ^([0-9]{7})$ = ${Out}\1
! 8->9 digits (1 234-5678 -> 9 1 234-5678) ^${LDPrefix}([0-9]{7})$ = ${Out}${LDPrefix}\1
! 10 -> 12 digits (302 234 5678 -> 9 1 302...) ^([0-9]{10})$ = ${Out}${LDPrefix}\1
! 11 -> 12 digits (1 302 234 5678 -> 9 1 302...) ^${LDPrefix}([0-9]{10})$ = ${Out}${LDPrefix}\1
! Remove our country code ^[+]${Country}([0-9]{5,})$ = ${Out}${LDPrefix}\1
! But, clean up all campus calls. ! 9831 ! 91302831
^${Out}${Exchange}([0-9]{4})$ = \1 ^${Out}${LDPrefix}${Area}${Exchange}([0-9]{4})$ = \1
! And remove 1302 for local calls. ^${Out}${LDPrefix}${Area}(${LocalExchange}) = ${Out}\1
^911 = "" ]
! ! This should always be a copy of DialString, in my opinion. ! That way, we know what's being dialed. !
DisplayNumber := [ [-${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
! Hide all international from any mangling at all. ! International are numbers starting with 011 with at ! least 5 more digits, or 9-011...
^${IDPrefix}([0-9]{5,}$) = +\1 ^${Out}${IDPrefix}([0-9]{1,}) = +\1
! 7 -> 8 digits (234-4567 -> 9-234-4567) ^([0-9]{7})$ = ${Out}\1
! 8->9 digits (1 234-5678 -> 9 1 234-5678) ^${LDPrefix}([0-9]{7})$ = ${Out}${LDPrefix}\1
! 10 -> 12 digits (302 234 5678 -> 9 1 302...) ^([0-9]{10})$ = ${Out}${LDPrefix}\1
! 11 -> 12 digits (1 302 234 5678 -> 9 1 302...) ^${LDPrefix}([0-9]{10})$ = ${Out}${LDPrefix}\1
! Remove our country code ^[+]${Country}([0-9]{5,})$ = ${Out}${LDPrefix}\1
! But, clean up all campus calls. ! 9831 ! 91302831
^${Out}${Exchange}([0-9]{4})$ = \1 ^${Out}${LDPrefix}${Area}${Exchange}([0-9]{4})$ = \1
! And remove 1302 for local calls. ^${Out}${LDPrefix}${Area}(${LocalExchange}) = ${Out}\1
! Lines to make the phone number nice! ! 9-234-5678 ! 9-1-234-5678 ! 9-1-302-234-5678
^${Out}([0-9]{3})([0-9]{4})$ = ${Out}-\1-\2 ^${Out}${LDPrefix}([0-9]{3})([0-9]{4})$ = ${Out}-${LDPrefix}-\1-\2 ^${Out}${LDPrefix}([0-9]{3})([0-9]{3})([0-9]{4})$ = ${Out}-${LDPrefix}-\1-\2-\3
^911 = "" ]
Thanks.
-=/>Thom
____________________ 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@xxxxxxxxx*
____________________ 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@xxxxxxxxx*