M4 Header Transformation Rules Groups
About
Header Transformation Rules are used to modify or add headers.
Header Transformation Rules are available in the Routing section.
Create
Press ADD NEW to create Header Transformation Rules Group.
The image below shows which headers are possible to modify.
Actions
Depending on the header, it is possible to perform various actions on the header.
Forward without changes
If the header exists, it will be forwarded with no additional changes.
Some headers will still be modified during call processing, for example Max-Forwards counter will be changed (decreased) even if it was set to forward without changes as this is required for SIP message processing.
Both EXISTING HEADER TRANSFORMATION
and NEW HEADER CONSTRUCTION
options are disabled in this action since no modification is required.
Transform and forward
If the header exists, it will be modified by EXISTING HEADER TRANSFORMATION
rule.
Option NEW HEADER CONSTRUCTION
is disabled in this action since we only operate on an existing header.
Transform existing, generate if missing
If the header exists, it will be modified by EXISTING HEADER TRANSFORMATION
rule.
If the header does not exist, it will be generated by NEW HEADER CONSTRUCTION
rule.
Overwrite
A new header will be constructed by NEW HEADER CONSTRUCTION
rule.
If the header is already present, it will be overwritten by the new header.
Option EXISTING HEADER TRANSFORMATION
is disabled in this action since we only overwrite the existing header (or if the header is missing, adding a new header).
Drop
If the header exists, it will be dropped.
Both EXISTING HEADER TRANSFORMATION
and NEW HEADER CONSTRUCTION
options are disabled in this action since no modification is required, only drop.
Existing Header Transformation
This option is only available in actions Transform and forward and Transform existing, generate if missing.
The format is:
/match_expression/replacement_expression/flags
- match_expression - POSIX regular expression
- replacement_expression - replacement expression with back references to matched tokes: \1, \2, …, \9
- flags (optional):
- i - match ignore case
- g - replace all matches
More information here.
New Header Construction
This option is only available in actions Transform existing, generate if missing
and Overwrite
.
The format is a plain text value that will be added to a header.
Custom headers
It is also possible to add a custom header to the empty header field.
Limitations
- Only the outgoing Invite request is available for modifications.
- Some actions cannot be applied to specific headers. For example, you can't modify Call-ID, Via, Contact headers as these headers are required for internal operations and should be left as is.
Enable
When rules are created, they should be enabled at Termination Point settings: Termination Point Signaling Settings
User-Agent header
Due to technical limitations, User-Agent header cannot be changed using Header Transformation Rules. Please contact support to change this header for all calls.