home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / fax / leffler / contrib / dialrules / dialrules-ger-fub.Z / dialrules-ger-fub
Encoding:
Text File  |  1994-10-06  |  4.7 KB  |  126 lines

  1. ! $Id: dialrules-ger-fub,v 1.1 1993/10/06 15:31:07 ferincz Exp ferincz $
  2. !
  3. ! FlexFAX Dialing String Processing Rules.
  4. !
  5. ! This file describes how to process user-specified dialing strings
  6. ! to create two items:
  7. !
  8. ! CanonicalNumber: a unique string that is derived from all dialing
  9. ! strings to the same destination phone number.  This string is used
  10. ! by the fax server for ``naming'' the destination. 
  11. !
  12. ! DialString: the string passed to the modem for use in dialing the
  13. ! telephone.  This string should be void of any characters that might
  14. ! confuse the modem.
  15. !
  16. ! For local use at FUB, Berlin, Germany.
  17. ! Adapted by ferincz@chemie.fu-berlin.de (Jozsef Ferincz), 1993.
  18. !
  19. Area=${AreaCode}        ! local area code
  20. Country=${CountryCode}        ! local country code
  21. IDPrefix=${InternationalPrefix}    ! prefix for placing an international call
  22. LDPrefix=${LongDistancePrefix}    ! prefix for placing a long distance call
  23. BPrefix=0            ! prefix for Berlin from inside of the FUB
  24. OPrefix=8            ! prefix for outside of Berlin from the FUB
  25. SPrefix=9            ! prefix for the net of senate from the FUB
  26. FUB=838                ! Free University of Berlin (FUB): 838-0
  27. Digit6=[0-9][0-9][0-9][0-9][0-9][0-9]    ! external: up to 6 digits
  28. Senate=SenatsNetz        ! net of senate
  29. Internal=Internal        ! FUB call
  30. External=External        ! not FUB call
  31. Delay=","            ! 2 sec. delay for modem
  32. !
  33. WS="     "            ! our notion of white space
  34. !
  35. ! Convert a phone number to a canonical format:
  36. !
  37. !    +<country><areacode><rest>
  38. !
  39. ! by (possibly) stripping off leading dialing prefixes for
  40. ! long distance and/or international dialing.
  41. !
  42. ! Only the callnumbers for the phone net of the senate should be
  43. ! given with the ``9,'' prefix in this format:
  44. !    <sprefix>,<rest>
  45. ! The canonical format  for this numbers will be:
  46. !    +<country><areacode>SenatsNetz<rest> 
  47. ! The other callnumbers may be given with or without
  48. ! the prefix ``0,'' or ``8,''. If some of the ``0'', ``8'', ``9''
  49. ! prefixes is given, it should be followed by a ``,''!
  50. !
  51. CanonicalNumber := [
  52. #.*            =            ! strip calling card stuff
  53. [^+${Delay}0-9]+    =            ! strip white space etc.
  54. ^${BPrefix}${Delay}    =            ! strip BPref. and modem delay
  55. ^${OPrefix}${Delay}    =            ! strip OPref. and modem delay
  56. ^${SPrefix}${Delay}    = ${Senate}        ! strip SPref. and modem delay
  57. ^${Digit6}        = ${External}&        ! mark the external numbers
  58. ^[0-9]            = ${FUB}&        ! insert the main digits of FUB
  59. ^${External}        =            ! strip the mark
  60. ^${IDPrefix}        = +            ! replace int. dialing code
  61. ^${LDPrefix}        = +${Country}        ! replace l.d. dialing code
  62. ^[^+]            = +${Country}${Area}&    ! otherwise, insert canon form
  63. ]
  64. !
  65. ! Process a dialing string according to local requirements.
  66. !
  67. DialString := [
  68. [-${WS}.]+        =            ! strip syntactic sugar
  69. ^${BPrefix}${Delay}    =            ! strip BPref. and modem delay
  70. ^${OPrefix}${Delay}    =            ! strip OPref. and modem delay
  71. ^${SPrefix}${Delay}    = ${Senate}        ! strip SPref. and modem delay
  72. ^${Digit6}        = ${External}&        ! mark the external numbers
  73. ^[0-9]            = ${FUB}&        ! insert the main digits of FUB
  74. ^${External}        =            ! strip the mark
  75. ^${IDPrefix}        = +            ! replace int. dialing code
  76. ^${LDPrefix}        = +${Country}        ! replace l.d. dialing code
  77. ^[^+]            = +${Country}${Area}&    ! otherwise, insert canon form
  78. !
  79. ! Process the canonical number
  80. !
  81. ^[+]${Country}         = ${LDPrefix}         ! in-country
  82. ^${LDPrefix}${Area}    =                ! in-area
  83. ^${FUB}            =            ! in-FUB
  84. ^${Senate}        = ${SPrefix}${Delay}    ! net of senate
  85. ^[+]            = ${IDPrefix}        ! international call
  86. ^${IDPrefix}    = ${OPrefix}${Delay}${IDPrefix} ! OPref.+modem delay for i.d.
  87. ^${LDPrefix}    = ${OPrefix}${Delay}${LDPrefix} ! OPref.+modem delay for l.d.
  88. ^${Digit6}        = ${BPrefix}${Delay}&    ! BPref.+modem delay for local
  89. ]
  90. !
  91. ! Construct the display number
  92. !
  93. DisplayNumber := [
  94. [-${WS}.]+        =            ! strip syntactic sugar
  95. ^${BPrefix}${Delay}    =            ! strip BPref. and modem delay
  96. ^${OPrefix}${Delay}    =            ! strip OPref. and modem delay
  97. ^${SPrefix}${Delay}    = ${Senate}        ! strip SPref. and modem delay
  98. ^${Digit6}        = ${External}&        ! mark the external numbers
  99. ^[0-9]            = ${FUB}&        ! insert the main digits of FUB
  100. ^${External}        =            ! strip the mark
  101. ^${IDPrefix}        = +            ! replace int. dialing code
  102. ^${LDPrefix}        = +${Country}        ! replace l.d. dialing code
  103. ^[^+]            = +${Country}${Area}&    ! otherwise, insert canon form
  104. !
  105. ! Process the canonical number
  106. !
  107. ^[+]${Country}         = ${LDPrefix}         ! in-country
  108. ^${LDPrefix}${Area}    =                ! in-area
  109. ^${FUB}            =            ! in-FUB
  110. ^${Senate}        = ${SPrefix}${Delay}    ! net of senate
  111. ^[+]            = ${IDPrefix}        ! international call
  112. ^${IDPrefix}    = ${OPrefix}${Delay}${IDPrefix} ! OPref.+modem delay for i.d.
  113. ^${LDPrefix}    = ${OPrefix}${Delay}${LDPrefix} ! OPref.+modem delay for l.d.
  114. ^${Digit6}        = ${BPrefix}${Delay}&    ! BPref.+modem delay for local
  115. ]
  116. !
  117. ! Results: (e.g.)
  118. !
  119. ! 1234                        ! in-FUB
  120. ! 12345                        ! in-FUB
  121. ! 0,1234567                    ! in-Berlin
  122. ! 8,01234567890                    ! in-Germany
  123. ! 8,00123456789012                ! international
  124. ! 9,123456                    ! net of senate
  125. !
  126.