Introduction

The variances among SIP networks, such as incompatible interconnection, can disrupt SIP operations. In order to resolve these problems, Edge Server provides SIP Header Manipulation, giving Edge operators the ability to control SIP traffic by manipulating SIP messages. In short, Manipulation is to modify SIP Header.


Functions

  • Add custom SIP Header, Parameters

  • Capture information from a message and insert it into another message

  • Remove all custom SIP headers

  • Execute the change if the condition is satisfied

  • Drop call or Log message if the condition is not satisfied

.

Contract

  • Manipulation rule is only applicable to Outbound Trunk.

  • Manipulation rule has a restrict to protect Edge Function, which does not allow to modify native SIP Header or native Session Variable.

  • X-EDGE  and V-EDGE are reserved for Edge and not available to modify.

  • X- indicates custom SIP Header

  • V- indicates custom Session Variable

.

Parameters


Parameter

Role

Description
Conditions

optional

Conditions are the set of conditions (max 5 rules) that will be used to decide which action to be performed in Statements or Else Statement

If no conditions is set, it means always matches > always trigger actions in Statements.
Statements
required

Sequence of actions (max 5 rules) to perform if conditions match.

Else Statement

optional

Sequence of actions (max 3 rules) to perform if conditions do not match.


  1. Conditions

    Parameter

    Role

    Description

    variable

    required

    Session Variable or SIP Header, SIP Params

    pattern
    required

    The regex is used to define a search pattern


    .
  2. Statements

    Parameter

    Role

    Description

    reference

    optional

    Session Variable or SIP Header, SIP Params

    pattern

    optional

    The regex is used to define a search pattern

    target

    required
    New Variable (V-) or new Header (X-)
    values

    required

    The list of values which can be fix chars, or back-reference from reference with pattern

    .
  3. Else Statement

    Parameter

    Role
    Description

    action

    required

    2 available actions:

    • Log: add log message (can be used to monitor/alert)

    • Drop: hang up the call

    param

    required

    String base, depending on the value of action:

    • Message content for log

    • Hangup reason for drop


.

The pattern must follow Perl Compatible Regular Expressions (PCRE)  syntax.

.

Syntax Description


Below table shows most formalisms provide the following operations to construct regular expressions.


Char
Description
Example
Match
Mismatch
^
The start of a line.
^firm
firming
confirm
$
The end of the line.

firm$

confirm

firming

\
Escape the special character.
\\
\

.
Match any chars except new line
b.networks
b3networks
bnetworks
?
Zero or one quantifier
b?net
bnet, b3net
b52net
+
One or more quantifier
b+net
b3net, b33net
bnet
*

Zero or more quantifier

b*net

bnet, b3net, b33net
bet
|
Alternation
hoiio|b3networks
hoiio, b3networks
edge
[]

Match a single chars in a class

12[345]a
123a, 124a

12a, 126a, 126a

[^]
Not match a single chars in a class
12[^345]a
126a, 121a
123a, 124a
[-]
Range of match chars in a class
edge[1-6]

edde2, edge1, edge6

edge0, edge7
{n}
n times exactly
hoi{2}o
hoiio
hoio, hoiiio
{n,m}
from n to m times
hoi{2-3}o
hoiio, hoiiio

hoio, hoiiiio

()
Sub-pattern or reference group



%{n}
Back reference to group in pattern




.

How to create a new manipulation rule


  1. Go to Settings > Manipulation > New profile
    .
    .
  2. Fill in Conditions (optional)Statements (required) > Else Statement (optional) > Create
    .
    .
  3. Finish
    .