General

The mask parameter consists of a string of digits and X characters. The digits must match the tested telephone number exactly, and the X denotes any digit. In countries where telephone numbers of many different lengths are valid, you can use an asterisk at the end of the mask to match all lengths of number. For example:

630XXXXXXX - matches any number in USA 630 area code

XXXXXXX - matches any local USA number

00* - match an international number dialed from the UK

The output string is typically used to add dialing prefixes or  access codes. The output mask should have the same number of X characters as the mask used for matching, and digits matching the X characters are transferred across to the output mask. For example the following pair of masks adds a tone-dial prefix and a 1 access code to numbers in the 312 area code:

312XXXXXXX TW1312XXXXXXX

You may use an asterisk in the output string only if you have an asterisk at the end of the mask. For example the following pair of masks dials only the local number for a UK number of any length with the STD code of 01672:

01672* *

If an asterisk appears in the output string other than at the end, or if the mask has no asterisk at the end, the asterisk is treated as a DTMF key and dialed in the normal way. This may be required to access special services.

Phone Masks in the Configuration File

You should place four main categories of phone mask in your configuration file.

First, you should list masks which match numbers which are never to be dialed at all, on any line. These masks are used both when a caller enters a number and when a call is about to be placed. For example:

$phone_mask * reject 900*       ; no 900 numbers

$phone_mask * reject XXX555XXXX ; no 555 exchange

$phone_mask * - 999 ; reject UK emergency line

Specific numbers to be excluded for all nodes can also be placed in the global do-not-send file DNS.NDX. However this does not currently have the ability to reject number ranges such as 'all numbers starting 011'.

Second, you should include any conversion masks for all lines which may make your accept/reject coding simpler. For example:

$phone_mask * c 1XXXXXXXXXX XXXXXXXXXX ; strip 1

$phone_mask * convert 630XXXXXXX XXXXXXX ; local

The first command above strips off the 1 which may have been included in the number to be dialed. All long-distance numbers will then be ten digits long, so that the second command can extract local numbers (in the 630 area) without needing to test separately for those with a 1 prefix.

Third, you should optionally include accept and decline actions to condition the lines on which calls will be dialed. Many variations are possible, as illustrated in the following examples:

$phone_mask * decline XXXXXXX ; no local calls from any 

                              ; line on this node

$phone_mask 4 decline XXXXXXX ; no local calls on

$phone_mask 3 + XXXXXXX TWXXXXXXX ; line 4, but OK on 3

$phone_mask 2 c 630XXXXXXX XXXXXXX ; convert local

$phone_mask 2 + XXXXXXX TWXXXXXXX ; accept local on 2

$phone_mask 1 + XXXXXXXXXX XXXXXXXXXX ; line 1 direct

$phone_mask 2 + XXXXXXXXXX 9,XXXXXXXXXX ; line 2 on PBX

The above commands will be principally of interest to Service Bureau and large users who have different categories of outbound lines.

Finally, you should include accept actions which enable all the numbers you wish to dial on any line. These masks are used both when a caller enters a number and when a call is about to be placed. Accept actions in the configuration file should include an output mask, but this is not used at call request time. For example:

$phone_mask * + * TW* ; accept all lengths, add dialing prefix

$phone_mask * + XXXXXXX TW9,XXXXXXX ; use PBX prefix

$phone_mask * + XXXXXXXXXX TW9,XXXXXXXXXX

In summary, phone mask commands in the configuration file are processed for all outbound calls, whether originating from requests, fax broadcasts or the network outbound fax server. In addition, any accept (+), reject (-) or convert (c) actions covering all lines (line code of *) are also processed at request time, after any commands in the user profile file. Output masks on accept actions are ignored at request time.

Note that if a particular fax telephone number can drop through the set of phone masks in your configuration file, the outbound call FS file will never be selected for processing and will remain the TOSEND directory indefinitely.

Exclusion Trees in the Configuration File

Some users need to exclude large numbers of specific prefix characters, and there is processing overhead which may become noticeable if you search several hundreds of such phone masks on heavily loaded systems. From CopiaFacts engine release 7.348, blocks of $phone_mask commands are automatically loaded into search trees which can be searched faster than a long list. The criteria for this are as follows:

the phone mask must apply to all lines, with an asterisk as the first parameter.

the second parameter must be '-' or 'reject'.

the third parameter (mask) must contain no X characters but it may contain an asterisk at the end

a separate search tree is created for each block of $phone_mask commands which conform to the above three criteria: so it is important to group such commands together, as far as logic permits, to minimize the number of searches.

You should review your exclusion lists to make sure that they minimize the number of searches.  For example, do not use mask sequences such as:

...

$phone_mask * - 900*        ; no 900 numbers

$phone_mask * - XXXXXXX     ; no local numbers

$phone_mask * - 87630*      ; fail Jamaica - Cellular*

$phone_mask * - 87633*      ; fail Jamaica - Cellular*

$phone_mask * - 87634*      ; fail Jamaica - Cellular*

...

The above sequence will result in two search trees needing to be built because of the presence of the XXXXXXX in the middle of a set of masks which qualify for an exclusion tree.

You should also change 'reject' mask sets which have trailing X characters if the logic permits an asterisk at the end of the mask string instead.

To monitor the search trees which are being pre-built, start the COPIAFACTS engine with 'Debug Configuration and Startup' enabled before and after making any phone-mask changes in FAXFACTS.CFG. This will report the trees built and how many entries each tree contains.

Identifying Toll-Free numbers

Toll-free numbers are identified by using a $ instead of a + in the phone mask accept line.  This causes the outbound ANI to be set to the alternate value for toll-free numbers specified by $outbound_tf_ani or OB_TF_ANI.  In the following extracted example, it is assumed that faxes to toll-free numbers are to be sent on a FoIP line (line group FOIP) and not on a Brooktrout board (line group BT):

$phone_mask BT         ~ 800*

$phone_mask FOIP $ 800XXXXXXX 800XXXXXXX 

$phone_mask BT         ~ 855*

$phone_mask FOIP $ 855XXXXXXX 855XXXXXXX 

$phone_mask BT         ~ 866*

$phone_mask FOIP $ 866XXXXXXX 866XXXXXXX 

$phone_mask BT         ~ 877*

$phone_mask FOIP $ 877XXXXXXX 877XXXXXXX 

$phone_mask BT         ~ 888*

$phone_mask FOIP $ 888XXXXXXX 888XXXXXXX 

$phone_mask BT   + XXXXXXXXXX XXXXXXXXXX 

$phone_mask FOIP + XXXXXXXXXX XXXXXXXXXX 

These masks would need to be accompanied by lines in the user profile(s) controlling the operation which define the ANI to be used, for example:

$outbound_tf_ani 4255279390   ; Tollfree ANI can NOT be 8xx number

$outbound_ani    8664754819

Selecting Specific TOSEND Queues

To select specific TOSEND queues to be sent on a specific line group, use a number following the + value to accept only the FS files in the numbered queue.  For example to select all FS files in TOSEN9 and TOSEND12 to be sent on the FOIP line group, use:

$phone_mask FOIP +9 * *    ; all TOSEND9 OK for group FOIP 

$phone_mask FOIP +12 * *   ; all TOSEND12 OK for group FOIP

$phone_mask BT + * *       ; all other calls on Brooktrout group

To select specific area codes also, you can replace the * * with suitable masks.

Phone Masks in the User Profile

Once you have the majority of phone masks defined in your configuration file, you can add extra specifications in the user profile file to fine-tune the selection of numbers for a particular application. Only accept, reject and convert actions can be placed in a user profile file, and any output masks on accept actions will be ignored. Most applications do not need any $phone_mask commands in the user profile.

As an example, suppose that a fax-on-demand application is set up (in the configuration file) to allow callbacks to all areas, but one of your telephone lines is used for a different application which only allows callbacks to local numbers. You could then use the following commands in the user profile for that application:

$phone_mask c 1XXXXXXXXXX XXXXXXXXXX ; strip 1

$phone_mask c 630XXXXXXX XXXXXXX ; convert local

$phone_mask + XXXXXXX ; allow local

$phone_mask - XXXXXXXXXX ; no callback out of area

Note that after processing your phone masks in the user profile without finding a match to accept or reject, CopiaFacts also scans the ‘all lines’ phone masks from the configuration file to attempt to make an accept or reject decision. If a phone number is entered by the caller which drops through all these masks, it will be treated as a reject. Rejected numbers cause standard voice prompt 23 to be played to the caller.