Number replacement

Number replacement - is the process of replacement of callee or caller ID using certain configured rules.
Replacement patters are configured on peers (see Peer types) and should be in format of Regex patterns.

Number replacement during routing

Number replacement is performed automatically during Routing (more detailed see chapter Routing).
In this mode there is no need to configure in Call handler anything else additionally.

Number replacement without routing

In all other cases to perform number replacement according to configured rules from Call handler you should use application Replace.
In this case you could manually configure the order of number replacement while handling call.
Application Replace could be used together with instruction Changing А-number from call handler.

Billing.

In order for numbers to pass to billing in correct format, during manual configuration you should specify, which exact numbers are stored in billing.
Real callee/caller IDs are always stored in CDR (fields real caller ID and real callee ID in Call detail report).
Callee/caller IDs, which are used for Billing (fields caller ID and callee ID in Call detail report) by default are set to the same values as real ones.
In order to change them use function CDR and application Set.
Add Set with next values:

name value
CDR(__CALLER_ID)
А number
CDR(__CALLEE_ID)
B number

Here, A and B numbers - numbers, which would be used for billing and will be stored in fields caller ID and callee ID in Call detail report.
Insert this code before call of Dial in any point of call handling.
Double underscore is needed for variable to be transferred to outbound call and to be stored in outbound CDR.

Русский перевод