Difference between revisions of "M4 Header Transformation Rules Groups"

From Kolmisoft Wiki
Jump to navigationJump to search
Line 17: Line 17:
[[File:M4_header_transformation_rules.png]]
[[File:M4_header_transformation_rules.png]]


Depending on the header, it is possible to:
==Actions==


* '''Forward without changes''' - no changes to headers.
Depending on the header, it is possible to perform various actions on the header.
* '''Transform and forward''' - modify the current header.
 
* '''Transform existing, generate if missing''' - modify the current header if it exists. If it does not exist, a header will be generated.
===Forward without changes===
* '''Overwrite''' - drop the original header if it exists and create a new one.
 
* '''Drop''' - removes the header.
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.
<br>
<br>
 
===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.
<br>
<br>
 
===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.
<br>
<br>
 
===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.
 
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).
<br>
<br>
 
===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.
<br>
<br>
 
==Custom headers==


It is also possible to add a custom header to the empty header field.
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.


<br><br>
<br><br>
=Enable=
=Enable=



Revision as of 10:51, 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 was 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.

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



Format

Kamailio Transformations are used to modify headers. More information here



User-Agent header

User-Agent header can be changed in the system configuration file. Please contact support to change this header.



See also