1DIALRULES(5F) DIALRULES(5F)
2
3
4
6 dialrules - HylaFAX dial string processing rules
7
9 A dial string specifies how to dial the telephone in order to reach a
10 destination facsimile machine, or similar device. This string is sup‐
11 plied by a user with each outgoing facsimile job. User-supplied dial
12 strings need to be processed in two ways by the HylaFAX server pro‐
13 cesses: to craft a canonical phone number for use in locating the
14 receiver's capabilities, and to process into a form suitable for send‐
15 ing to a modem. In addition client applications may need to process a
16 dial string to formulate an external form that does not include private
17 information such as a credit card access code. Phone number canonical‐
18 ization and dial string preparation are done according to dial string
19 processing rules that are located in a file specified in the server
20 configuration file; see the DialStringRules parameter in hylafax-con‐
21 fig(5F). The generation of an externalized form for a dial string is
22 done by rules that optionally appear in /etc/hylafax/dialrules on
23 client machines.
24
25 A dial string rules file is an ASCII file containing one or more rule
26 sets. A rule set defines a set of transformation rules that are
27 sequentially applied to a dial string. Each rule set is associated
28 with an identifier, with certain well-known identifiers being used by
29 the facsimile server or client application. Each transformation rule
30 is a regular expression and a replacement string; the regular expres‐
31 sion is repeatedly applied to a dial string and any matching substring
32 is replaced by the replacement string.
33
34 The syntax of a dial string rules file is as follows. Comments are
35 introduced with the ``!'' character and continue to the end of the cur‐
36 rent line. Identifiers are formed from a leading alphabetic and any
37 number of subsequent alpha-numeric characters. A rule set is of the
38 form:
39 Identifier := [
40 rule1
41 rule2
42 ...
43 ]
44 where rule1, rule2, and so on are transformation rules. Line breaks
45 are significant. The initial rule set definition line and the trailing
46 ``]'' must be on separate lines; and each transformation rule must also
47 be on a single line. Transformation rules are of the two forms:
48 regular-expression = replacement
49 regular-expression = \RuleName(replacement)
50 where regular-expression is a POSIX 1003.2 extended regular expression
51 and replacement is a string that is substituted in place of any portion
52 of the dial string that is matched by the regular-expression. White
53 space is significant in parsing transformation rules. If a regular
54 expression or replacement string has embedded white space in it, then
55 the white space needs to be escaped with a ``\'' character or the
56 entire string should be enclosed in quote (``"'') marks. Replacement
57 strings may reference the entire string matched by the regular expres‐
58 sion with the ``&'' character. Substrings matched with the ``(...)''
59 constructs may be