#### Telephone directions

This page contain the list of registered telephone directions with the interface for creating, removing, or editing them.

Telephone direction is a set of telephone numbers. The attribution of a particular number to a direction is checked by means of regular expressions. Telephone directions are used to classify phone calls for subsequent tariffication.

Telephone direction is characterized by the following parameters:

- ID is a number > 1000000 (assigned automatically).
- Zone is the name of a telephone zone into which the direction is included (set automatically).

| Every telephone direction may be included in one and only one telephone zone.

- Type is the call type (local, intercity, etc.; inherited from the parent zone, if it is set).
- Name is a mandatory parameter.

Classification criteria (at least one must be non-empty):

- Called prefix is a prefix or a regexp (POSIX 1003.2 compatible) for checking the called number.
- Calling prefix is a prefix or a regexp for checking the calling number.

- Incoming trunk;
- Outgoing trunk;
- PBX ID;

- Skip flag cancels identification (if checked, no calls will be identified into this direction).

The list of directions is kept ordered lexicographically by called prefix, then by calling prefix, then by incoming trunik, and then by outgoing trunk. The search is performed from the beginning of the list till the first match. To be identified with the direction, a call must match all parameters (called prefix, calling prefix, incoming trunk, outgoing trunk, PBX ID) which are set for this direction.

It is recommended to create the default direction with called prefix `^.*$`, so as to leave no number unassigned.