HylaFAX The world's
most advanced open source fax server
|
|
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
Dialrules vs DestCtrls
Hi,
I have to implement a destControls file that put on hold all long distance
calls(fax) in order to dial them between 18h an d 8h.
My dialrules already check if a fax is a local call or not, but how can I
know if that call is a long distance from the destctrls file?
The problem is that the destctrls file match his expression according to the
cannonical number, and not the dialstring. So I see 2 solutions to that
problem :
- acces to the dialstring from the destctrls file OR
- Find a way to know if the call is a long distance from the cannonical
number.
In either way, i'm stock ; I'm pretty sure that there is no way I could
access the dialstring, and I d'ont want to reimplement my dialrules script
in my destctrls because I think it's a dumb thing to do.
I'm not sure if i am clear enough, but I included my dialrules and my
destctrls just to make sure that you could understand what is my problem.
(soory for that)
So anybody got a suggestion ?
destctrls:
#
# Be sure to add this line in the config file.
# DestControls: etc/destctrls
#
Area=${AreaCode} # (used for 450 exchanges below)
Country=${CountryCode} # local country code
IDPrefix=${InternationalPrefix} # prefix for international call
LDPrefix=${LongDistancePrefix} # prefix for long distance call
#
.*911$ RejectNotice = "Calls to emergency numbers are not permitted"
.*[46]11$ RejectNotice = "Calls to service numbers are not permitted"
^[+]${Country}${LDPrefix}(9.*) RejectNotic = "Call to 1-9xx are not
permitted"
^[+][0-9]{0,6}$ RejectNotice = "Number too Short, need at least 7 digits "
^[+][0-9]{12,}$ RejectNotice = "Number too long, maximum 11 digits"
dialrules :
! $Id: dialrules,v 1.1.1.1 1998/10/12 20:47:48 root Exp $
!
! HylaFAX (tm) Dialing String Processing Rules.
!
! This file describes how to process user-specified dialing strings
! to create two 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.
!
Area=${AreaCode} ! (used for 450 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
Area2=514 ! other local area code
!
! 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} = ! 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
[abcABC] = 2 ! these convert alpha to numbers
[defDEF] = 3
[ghiGHI] = 4
[jklJKL] = 5
[mnoMNO] = 6
[prsPRS] = 7
[tuvTUV] = 8
[wxyWXY] = 9
!
!
^[+]${Country} = ! Its in North America
^${LDPrefix} = ! Cut the LDPrefix, for test use
^[2-9]......$ = ${LDPrefix}${Area}& ! Default AC for 7-digit
Nos.
^[2-9].........$ = ${LDPrefix}& ! If the number is 10-digits
!
! This part strips the leading ${LDPrefix} from local exchanges
!
!
! (514) 20[1 - 3]
^${LDPrefix}(${Area2}20[1-3]) = \1
!
! (514) 215
^${LDPrefix}(${Area2}215) = \1
!
! (514) 23[0 - 9]
^${LDPrefix}(${Area2}23[0-9]) = \1
!
!
!
! ... (it goes on like that for a while)
!
!
! (514) 98[0 - 9]
^${LDPrefix}(${Area2}98[0-9]) = \1
!
! (514) 99[0 2 - 8]
^${LDPrefix}(${Area2}99[02-8]) = \1
!
! Final tweaking
^[+]${Country}${Area} = ${Area} ! same-country call
^[+] = ${IDPrefix} ! international call
]