Difference between revisions of "M4 Header Transformation Rules Groups"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 48: Line 48:
===Overwrite===
===Overwrite===


A new header will be constructed by '''NEW HEADER CONSTRUCTION''' rule. If the header was already present, it will be overwritten by the new header.
A new header will be constructed by '''NEW HEADER CONSTRUCTION''' rule.<br>
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).
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).

Revision as of 11:15, 30 January 2024

About

Header Transformation Rules are used to modify or add headers.

Header Transformation Rules are available in the Routing section.

M4 routing header transformation rules.png



Create

Press ADD NEW to create Header Transformation Rules Group.

M4 header transformation rules add new.png

The image below shows which headers are possible to modify.
M4 header transformation rules.png

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 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 header 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
Termination point rules settings.png



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.



See also