Trunk ANI

When the system sends a call to a trunk, it needs to determine what caller-ID to use for that call. The outbound caller-ID is called ANI (Automatic Number Identification).

The system will use a list of rules to find a ANI. Those rules are part of the trunk settings. There are two rule sets for each trunk: A rule set for regular calls and a rule set for emergency calls. If the call is considered to be an emergency call, the system will first attempt to use the rules for emergency calls. If those rules do not come up with a number, the system will continue with the rules for regular calls.

The result of the matching process is stored in the header variables ani-raw (the number, without modifications) and ani-cnam (the name). There are other forms ani-e164, ani-nanpa, ani-plus, ani-row and ani. available that have the number formatted in the respective interpretation. The variables will be ultimately stored in the from variable. In most cases using the {from} header variable in a SIP trunk header will work just fine.

The list of ANI rules is separated by a space character. Each entry consists of a ANI number or a placeholder for the ANI number; each entry may be filtered by one or more conditions, for example disa:from-cell:from or just 6173998147. If there is no ANI available in a placeholder then the system will skip that entry.

Placeholders

ANI numbers can be entered as the literal telephone number that should be used or using the following placeholders:

  • from: This placeholder will use the caller-ID in the From header of the call. This can be useful when used with the from-trunk condition.
  • ext-ani: This placeholder will use the extension ANI when available.
  • ext-eani: This placeholder will use the extension ANI when available.
  • ext-epid: In case the trunk is set to generate EPID for each extension, this placeholder will contain the EPID.
  • ext-number: This placeholder will search a DID in the account and use it as ANI.
  • dom-ani: This placeholder will use the domain ANI when available.
  • dom-eani: This placeholder contains the emergency ANI for the trunk.
  • acd-ani: This placeholder will use the ACD ANI if the user was logged into this ACD.
  • trunk-ani: If there was a trunk ANI set for the trunk, this placeholder will contain that ANI.
  • trunk-prefix: If there was a trunk prefix set for the trunk and the call is associated with an extension, this placeholder will contain that prefix with the extension number.

Conditions

Conditions can block the usage of a ANI. Conditions for presenting a specific ANI can be prepended to a ANI by separating the condition from the ANI with a colon. If there are multiple conditions that must be met in order to present a caller-ID, multiple colons can be used. Conditions can be negated by putting an ! in front of it.

  • from-trunk: If the call comes from a trunk, this condition will be true.
  • from-cell: When the call comes from a users cell phone, this condition is true.
  • clip: If the call should block the caller id (CLIP) then this condition will be true.
  • disa: This condition will be true if this call is a DISA call (direct inbound station access) call.

If there is no match with the predefined conditions, the system will try to match the condition with an account in the domain (using wildcards). If it matches a service flag, the state of the service flag will determine if the condition matches. For all other account types, when there is a match the condition is true. Account matches can also be negated, for example !40* will match all accounts that do not start with "40".

Examples

The first example always presents the caller-ID 6173998147:

6173998147

The second example presents the caller-ID of the extension if there is one, otherwise 6173998147:

ext-ani 6173998147

The third example presents the caller-ID of the domain if the call is not a DISA call and the user name that initiates the call starts with "40", otherwise the extension ANI if there is one, otherwise 6173998147:

!disa:40*:dom-ani ext-ani 6173998147

Default behavior

If there is no trunk ANI set up, the system will use the following pattern:

acd-ani ext-ani trunk-prefix dom-ani trunk-ani

For emergency calls the default behavior is this:

ext-epid ext-eani dom-eani

Versions

This documentation describes the behavior in versions 60.1 and after.