! ! FlexFAX 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. ! ! Adapted for local use at FAU Erlangen-Nürnberg ! Internal = "x" ! internal call Company = 85 ! our phone prefix Area = 9131 ! local area code Country = 49 ! local country code ! External = 09 LongDistance = 0 International = 00 Canonic = "+" ! INTERNAL = "INTERNAL" LOCAL = "LOCAL" LONGDISTANCE = "LONGDISTANCE" INTERNATIONAL = "INTERNATIONAL" ! WS=" " ! our notion of white space ! ! Convert a phone number to a canonical format: ! ! + ! ! by (possibly) stripping off leading dialing prefixes for ! long distance and/or international dialing. ! CanonicalNumber := [ #.* = ! strip calling card stuff [^+0-9x]+ = ! strip white space etc. ^${Internal} = ${INTERNAL} ^${Company} = ${INTERNAL} ^${LongDistance}${Area}${Company} = ${INTERNAL} ^${International}${Country}${Area}${Company} = ${INTERNAL} ^[+]${Country}${Area}${Company} = ${INTERNAL} ! ! local calls ! ^[^0+IL] = ${LOCAL}& ^${LongDistance}${Area} = ${LOCAL} ^${International}${Country}${Area} = ${LOCAL} ^[+]${Country}${Area} = ${LOCAL} ! ! long distance & international calls ! ^${International}${Country} = ${LONGDISTANCE} ^${International} = ${INTERNATIONAL} ^${LongDistance} = ${LONGDISTANCE} ^[+]${Country} = ${LONGDISTANCE} ^[+] = ${INTERNATIONAL} ! ! now construct appropriate canonical strings ! ^${INTERNAL} = ${Canonic}${Country}${Area}${Company} ^${LOCAL} = ${Canonic}${Country}${Area} ^${LONGDISTANCE} = ${Canonic}${Country} ^${INTERNATIONAL} = ${Canonic} ] ! ! 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 ! ! internal calls ! ^${Internal} = ${INTERNAL} ^${Company} = ${INTERNAL} ^${LongDistance}${Area}${Company} = ${INTERNAL} ^${International}${Country}${Area}${Company} = ${INTERNAL} ^[+]${Country}${Area}${Company} = ${INTERNAL} ! ! local calls ! ^[^0+IL] = ${LOCAL}& ^${LongDistance}${Area} = ${LOCAL} ^${International}${Country}${Area} = ${LOCAL} ^[+]${Country}${Area} = ${LOCAL} ! ! long distance & international calls ! ^${International}${Country} = ${LONGDISTANCE} ^${International} = ${INTERNATIONAL} ^${LongDistance} = ${LONGDISTANCE} ^[+]${Country} = ${LONGDISTANCE} ^[+] = ${INTERNATIONAL} ! ! now construct appropriate dialing strings ! ^${INTERNAL} = ^${LOCAL} = ${External} ^${LONGDISTANCE} = ${External}${LongDistance} ^${INTERNATIONAL} = ${External}${International} ] ! ! Process a dialing string according to local requirements. ! These rules do only one transformation: they convert in-country ! international calls to long-distance calls. ! ! Produce a display number ! DisplayNumber := [ [-${WS}.]+ = ! strip syntactic sugar ! ! internal calls ! ^${Internal} = ${INTERNAL} ^${Company} = ${INTERNAL} ^${LongDistance}${Area}${Company} = ${INTERNAL} ^${International}${Country}${Area}${Company} = ${INTERNAL} ^[+]${Country}${Area}${Company} = ${INTERNAL} ! ! local calls ! ^[^0+IL] = ${LOCAL}& ^${LongDistance}${Area} = ${LOCAL} ^${International}${Country}${Area} = ${LOCAL} ^[+]${Country}${Area} = ${LOCAL} ! ! long distance & international calls ! ^${International}${Country} = ${LONGDISTANCE} ^${International} = ${INTERNATIONAL} ^${LongDistance} = ${LONGDISTANCE} ^[+]${Country} = ${LONGDISTANCE} ^[+] = ${INTERNATIONAL} ! ! now construct appropriate dialing strings ! ^${INTERNAL} = ${Internal} ^${LOCAL} = ^${LONGDISTANCE} = ${LongDistance} ^${INTERNATIONAL} = ${International} ]