Configuration Examples
This section shows you several configuration examples for HMR. This section shows the configuration for the various rules that the Oracle® Enterprise Session Border Controllerapplied, and sample results of the manipulation. These examples present configurations as an entire list of fields and settings for each ruleset, nested header rules and nested element rules. If a field does not have any operation within the set, the field is shown with the setting at the default or blank.
Example 1 Removing Headers
For this manipulation rule, the Oracle® Enterprise Session Border Controller removes the Custom header if it matches the pattern rule. It stores the defined pattern rule for the goodBye header. Finally, it removes the goodBye header if the pattern rule from above is a match.
This is a sample of the configuration:
sip-manipulation
name removeHeader
header-rule
name removeCustom
header-name Custom
action delete
comparison-type boolean
match-value ^This is my.*
msg-type request
new-value
methods INVITE
header-rule
name goodByeHeader
header-name Goodbye
action store
comparison-type boolean
match-value ^Remove (.+)
msg-type request
new-value
methods INVITE
header-rule
name goodBye
action delete
comparison-type pattern-rule
match-value $goodByeHeader
msg-type request
new-value
methods INVITE
This is a sample of the result:
Request-Line: INVITE sip:service@192.168.200.60:5060;tgid=123 SIP/2.0
Message Header
Via: SIP/2.0/UDP 192.168.200.61:5060;branch=z9hG4bK0g639r10fgc0aakk26s1.1
From: sipp <sip:sipp@192.168.1.60:5060>;tag=SDc1rm601-1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: SDc1rm601-d01673bcacfcc112c053d95971330335-06a3gu0
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.200.61:5060;transport=udp>
Display: sipp <sip:user@192.168.1.60:5060;up=abc>;hp=123
Params: sipp <sip:sipp1@192.168.1.60:5060>
Params: sipp <sip:sipp2@192.168.1.60:5060>
Edit: disp <sip:user@192.168.1.60:5060>
Max-Forwards: 69
Subject: Performance Test
Content-Type: application/sdp
Content-Length: 140
Example 2 Manipulating the Request URI
For this manipulation rules, the Oracle® Enterprise Session Border Controller stores the URI parameter tgid in the Request URI. Then if the pattern rule matches, it adds a new header (x-customer-profile) with the a new header value tgid to the URI parameter in the request URI.
This is a sample of the configuration:
sip-manipulation
name CustomerTgid
header-rule
name ruriRegex
header-name request-uri
action store
comparison-type pattern-rule
match-value
msg-type request
new-value
methods INVITE
element-rule
name tgidParam
parameter-name tgid
type uri-param
action store
match-val-type any
comparison-type pattern-rule
match-value
new-value
header-rule
name addCustomer
header-name X-Customer-Profile
action add
comparison-type pattern-rule
match-value $ruriRegex.$tgidParam
msg-type request
new-value $ruriRegex.$tgidParam.$0
methods INVITE
header-rule
name delTgid
header-name request-uri
action manipulate
comparison-type pattern-rule
match-value $ruriRegex.$tgidParam
msg-type request
new-value
methods INVITE
element-rule
name tgidParam
parameter-name tgid
type uri-param
action delete-element
match-val-type any
comparison-type case-sensitive
match-value $ruriRegex.$tgidParam.$0
new-value
This is a sample of the result:
Request-Line: INVITE sip:service@192.168.200.60:5060 SIP/2.0
Message Header
Via: SIP/2.0/UDP 192.168.200.61:5060;branch=z9hG4bK0g6plv3088h03acgh6c1.1
From: sipp <sip:sipp@192.168.1.60:5060>;tag=SDc1rg601-1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: SDc1rg601-f125d8b0ec7985c378b04cab9f91cc09-06a3gu0
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.200.61:5060;transport=udp>
Goodbye: Remove Me
Custom: This is my custom header
Display: sipp <sip:user@192.168.1.60:5060;up=abc>;hp=123
Params: sipp <sip:sipp1@192.168.1.60:5060>
Params: sipp <sip:sipp2@192.168.1.60:5060>
Edit: disp <sip:user@192.168.1.60:5060>
Max-Forwards: 69
Subject: Performance Test
Content-Type: application/sdp
Content-Length: 140
X-Customer-Profile: 123
Example 3 Manipulating a Header
For this manipulation rule, the Oracle® Enterprise Session Border Controllerstores the pattern matches for the Custom header, and replaces the value of the Custom header with a combination of the stored matches and new content.
This is a sample of the configuration:
sip-manipulation
name modCustomHdr
header-rule
name customSearch
header-name Custom
action store
comparison-type pattern-rule
match-value (This is my )(.+)( header)
msg-type request
new-value
methods INVITE
header-rule
name customMod
header-name Custom
action manipulate
comparison-type pattern-rule
match-value $customSearch
msg-type request
new-value
methods INVITE
element-rule
name hdrVal
parameter-name hdrVal
type header-value
action replace
match-val-type any
comparison-type case-sensitive
match-value
new-value $customSearch.$1+edited+$customSearch.$3
This is a sample of the result:
Request-Line: INVITE sip:service@192.168.200.60:5060;tgid=123 SIP/2.0
Message Header
Via: SIP/2.0/UDP 192.168.200.61:5060;branch=z9hG4bK20q2s820boghbacgs6o0.1
From: sipp <sip:sipp@192.168.1.60:5060>;tag=SDe1ra601-1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: SDe1ra601-4bb668e7ec9eeb92c783c78fd5b26586-06a3gu0
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.200.61:5060;transport=udp>
Goodbye: Remove Me
Custom: This is my edited header
Display: sipp <sip:user@192.168.1.60:5060;up=abc>;hp=123
Params: sipp <sip:sipp1@192.168.1.60:5060>
Params: sipp <sip:sipp2@192.168.1.60:5060>
Edit: disp <sip:user@192.168.1.60:5060>
Max-Forwards: 69
Subject: Performance Test
Content-Type: application/sdp
Content-Length: 140
Example 4 Storing and Using URI Parameters
For this manipulation rule, the Oracle® Enterprise Session Border Controller stores the value of the URI parameter tag from the From header. It also creates a new header FromTag with the header value from the stored information resulting from the first rule.
This is a sample of the configuration:
sip-manipulation
name storeElemParam
header-rule
name Frohmr
header-name From
action store
comparison-type case-sensitive
match-value
msg-type request
new-value
methods INVITE
element-rule
name elementRule
parameter-name tag
type uri-param
action store
match-val-type any
comparison-type case-sensitive
match-value
new-value
header-rule
name newHeader
header-name FromTag
action add
comparison-type pattern-rule
match-value $FromHR.$elementRule
msg-type any
new-value $FromHR.$elementRule.$0
methods
This is a sample of the result:
Request-Line: INVITE sip:service@192.168.200.60:5060;tgid=123 SIP/2.0
Message Header
Via: SIP/2.0/UDP 192.168.200.61:5060;branch=z9hG4bK4oda2e2050ih7acgh6c1.1
From: sipp <sip:sipp@192.168.1.60:5060>;tag=SDf1re601-1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: SDf1re601-f85059e74e1b443499587dd2dee504c2-06a3gu0
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.200.61:5060;transport=udp>
Goodbye: Remove Me
Custom: This is my custom header
Display: sipp <sip:user@192.168.1.60:5060;up=abc>;hp=123
Params: sipp <sip:sipp1@192.168.1.60:5060>
Params: sipp <sip:sipp2@192.168.1.60:5060>
Edit: disp <sip:user@192.168.1.60:5060>
Max-Forwards: 69
Subject: Performance Test
Content-Type: application/sdp
Content-Length: 140
FromTag: 1
Example 5 Manipulating Display Names
For this manipulation rule, the Oracle® Enterprise Session Border Controller sores the display name from the Display header. It replaces the two middle characters of the original display name with a new string. Then is also replaces the From header’s display name with “abc 123” if it matches sipp.
This is a sample of the configuration:
sip-manipulation
name modDisplayParam
header-rule
name storeDisplay
header-name Display
action store
comparison-type case-sensitive
match-value
msg-type request
new-value
methods INVITE
element-rule
name displayName
parameter-name display
type uri-display
action store
match-val-type any
comparison-type pattern-rule
match-value (s)(ip)(p )
new-value
header-rule
name modDisplay
header-name Display
action manipulate
comparison-type case-sensitive
match-value
msg-type request
new-value
methods INVITE
element-rule
name modRule
parameter-name display
type uri-display
action replace
match-val-type any
comparison-type pattern-rule
match-value $storeDisplay.$displayName
new-value $storeDisplay.$displayName.$1+lur+$storeDisplay.$displayName.$3
header-rule
name modFrom
header-name From
action manipulate
comparison-type pattern-rule
match-value
msg-type request
new-value
methods INVITE
element-rule
name fromDisplay
parameter-name
type uri-display
action replace
match-val-type any
comparison-type pattern-rule
match-value sipp
new-value "\"abc 123\" "
This is a sample of the result:
Request-Line: INVITE sip:service@192.168.200.60:5060;tgid=123 SIP/2.0
Message Header
Via: SIP/2.0/UDP 192.168.200.61:5060;branch=z9hG4bK681kot109gp04acgs6o0.1
From: "abc 123" <sip:sipp@192.168.1.60:5060>;tag=SD79ra601-1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: SD79ra601-a487f1259e2370d3dbb558c742d3f8c4-06a3gu0
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.200.61:5060;transport=udp>
Goodbye: Remove Me
Custom: This is my custom header
Display: slurp <sip:user@192.168.1.60:5060;up=abc>;hp=123
Params: sipp <sip:sipp1@192.168.1.60:5060>
Params: sipp <sip:sipp2@192.168.1.60:5060>
Edit: disp <sip:user@192.168.1.60:5060>
Max-Forwards: 69
Subject: Performance Test
Content-Type: application/sdp
Content-Length: 140
Example 6 Manipulating Element Parameters
For this more complex manipulation rule, the Oracle® Enterprise Session Border Controller:
- From the Display header, stores the display name, user name, URI parameter up, and header parameter hp
- Adds the header parameter display to the Params header, with the stored value of the display name from the first step
- Add the URI parameter user to the Params header, with the stored value of the display name from the first step
- If the URI parameter match succeeds in the first step, replaces the URI parameter up with the Display header with the value def
- If the header parameter match succeeds in the first step, deletes the header parameter hp from the Display header
This is a sample of the configuration:
sip-manipulation
name elemParams
header-rule
name StoreDisplay
header-name Display
action store
comparison-type case-sensitive
match-value
msg-type request
new-value
methods INVITE
element-rule
name displayName
parameter-name
type uri-display
action store
match-val-type any
comparison-type pattern-rule
match-value
new-value
element-rule
name userName
parameter-name user
type uri-user
action store
match-val-type any
comparison-type pattern-rule
match-value
new-value
element-rule
name uriParam
parameter-name up
type uri-param
action store
match-val-type any
comparison-type pattern-rule
match-value
new-value
element-rule
name headerParam
parameter-name hp
type header-param
action store
match-val-type any
comparison-type pattern-rule
match-value
new-value
header-rule
name EditParams
header-name Params
action manipulate
comparison-type case-sensitive
match-value
msg-type request
new-value
methods INVITE
element-rule
name addHeaderParam
parameter-name display
type header-param
action add
match-val-type any
comparison-type case-sensitive
match-value
new-value $StoreDisplay.$displayName.$0
element-rule
name addUriParam
parameter-name user
type uri-param
action add
match-val-type any
comparison-type case-sensitive
match-value
new-value
$StoreDisplay.$userName.$0
header-rule
name EditDisplay
header-name Display
action manipulate
comparison-type case-sensitive
match-value
msg-type request
new-value
methods INVITE
element-rule
name replaceUriParam
parameter-name up
type uri-param
action replace
match-val-type any
comparison-type pattern-rule
match-value $StoreDisplay.$uriParam
new-value def
element-rule
name delHeaderParam
parameter-name hp
type header-param
action delete-element
match-val-type any
comparison-type pattern-rule
match-value $StoreDisplay.$headerParam
new-value
This is a sample of the result:
Request-Line: INVITE sip:service@192.168.200.60:5060;tgid=123 SIP/2.0
Message Header
Via: SIP/2.0/UDP 192.168.200.61:5060;branch=z9hG4bK7okvei0028jgdacgh6c1.1
From: sipp <sip:sipp@192.168.1.60:5060>;tag=SD89rm601-1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: SD89rm601-b5b746cef19d0154cb1f342cb04ec3cb-06a3gu0
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.200.61:5060;transport=udp>
Goodbye: Remove Me
Custom: This is my custom header
Display: sipp <sip:user@192.168.1.60:5060;up=def>
Params: sipp <sip:sipp1@192.168.1.60:5060;user=user>;display=sipp
Params: sipp <sip:sipp2@192.168.1.60:5060;user=user>;display=sipp
Edit: disp <sip:user@192.168.1.60:5060>
Max-Forwards: 69
Subject: Performance Test
Content-Type: application/sdp
Content-Length: 140
Example 7 Accessing Data from Multiple Headers of the Same Type
For this manipulation rule, the Oracle® Enterprise Session Border Controller stores the user name from the Params header. It then adds the URI parameter c1 with the value stored from the first Params header. Finally, it adds the URI parameter c2 with the value stored from the second Params header.
This is a sample of the configuration:
sip-manipulation
name Params
header-rule
name storeParams
header-name Params
action store
comparison-type case-sensitive
match-value
msg-type request
new-value
methods INVITE
element-rule
name storeUserName
parameter-name user
type uri-user
action store
match-val-type any
comparison-type case-sensitive
match-value
new-value
header-rule
name modEdit
header-name Edit
action manipulate
comparison-type pattern-rule
match-value
msg-type request
new-value
methods INVITE
element-rule
name addParam1
parameter-name c1
type uri-param
action add
match-val-type any
comparison-type case-sensitive
match-value
new-value $storeParams[0].$storeUserName.$0
element-rule
name addParam2
parameter-name c2
type uri-param
action add
match-val-type any
comparison-type case-sensitive
match-value
new-value $storeParams[1].$storeUserName.$0
This is a sample of the result:
Request-Line: INVITE sip:service@192.168.200.60:5060;tgid=123 SIP/2.0
Message Header
Via: SIP/2.0/UDP 192.168.200.61:5060;branch=z9hG4bK9g855p30cos08acgs6o0.1
From: sipp <sip:sipp@192.168.1.60:5060>;tag=SD99ri601-1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: SD99ri601-6f5691f6461356f607b0737e4039caec-06a3gu0
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.200.61:5060;transport=udp>
Goodbye: Remove Me
Custom: This is my custom header
Display: sipp <sip:user@192.168.1.60:5060;up=abc>;hp=123
Params: sipp <sip:sipp1@192.168.1.60:5060>
Params: sipp <sip:sipp2@192.168.1.60:5060>
Edit: disp <sip:user@192.168.1.60:5060;c1=sipp1;c2=sipp2>
Max-Forwards: 69
Subject: Performance Test
Content-Type: application/sdp
Content-Length: 140
Example 8 Using Header Rule Special Characters
For this manipulation rule, the Oracle® Enterprise Session Border Controller:
- Stores the header value of the Params header with the given pattern rule, and stores both the user name of the Params header and the URI parameter abc
- Adds the URI parameter lpu with the value stored from the previous Params header
- If any of the Params headers match the pattern rule defined in the first step, adds the URI parameter apu with the value aup
- If all of the Params headers match the pattern rule defined in the first step, adds the URI parameter apu with the value apu
- If the first Params headers does not match the pattern rule for storing the URI parameter defined in the first step, adds the URI parameter not with the value 123
- If the first Params headers matches the pattern rule for storing the URI parameter defined in the first step, adds the URI parameter yes with the value 456
This is a sample of the configuration:
sip-manipulation
name specialChar
header-rule
name searchParams
header-name Params
action store
comparison-type pattern-rule
match-value .*sip:(.+)@.*
msg-type request
new-value
methods INVITE
element-rule
name userName
parameter-name
type uri-user
action store
match-val-type any
comparison-type case-sensitive
match-value
new-value
element-rule
name emptyUriParam
parameter-name abc
type uri-param
action store
match-val-type any
comparison-type pattern-rule
match-value
new-value
header-rule
name addUserLast
header-name Edit
action manipulate
comparison-type case-sensitive
match-value
msg-type request
new-value
methods INVITE
element-rule
name lastParamUser
parameter-name lpu
type uri-param
action add
match-val-type any
comparison-type case-sensitive
match-value
new-value $searchParams[^].$userName.$0
element-rule
name anyParamUser
parameter-name apu
type uri-param
action add
match-val-type any
comparison-type pattern-rule
match-value $searchParams[~]
new-value aup
element-rule
name allParamUser
parameter-name apu
type header-param
action add
match-val-type any
comparison-type pattern-rule
match-value $searchParams[*]
new-value apu
element-rule
name notParamYes
parameter-name not
type uri-param
action add
match-val-type any
comparison-type pattern-rule
match-value !$searchParams.$emptyUriParam
new-value 123
element-rule
name notParamNo
parameter-name yes
type uri-param
action add
match-val-type any
comparison-type pattern-rule
match-value $searchParams.$emptyUriParam
new-value 456
This is a sample of the result:
Request-Line: INVITE sip:service@192.168.200.60:5060;tgid=123 SIP/2.0
Message Header
Via: SIP/2.0/UDP 192.168.200.61:5060;branch=z9hG4bK681m9t30e0qh6akgj2s1.1
From: sipp <sip:sipp@192.168.1.60:5060>;tag=SDchrc601-1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: SDchrc601-fcf5660a56e2131fd27f12fcbd169fe8-06a3gu0
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.200.61:5060;transport=udp>
Goodbye: Remove Me
Custom: This is my custom header
Display: sipp <sip:user@192.168.1.60:5060;up=abc>;hp=123
Params: sipp <sip:sipp1@192.168.1.60:5060>
Params: sipp <sip:sipp2@192.168.1.60:5060>
Edit: disp <sip:user@192.168.1.60:5060;lpu=sipp2;apu=aup;not=123>;apu=apu
Max-Forwards: 69
Subject: Performance Test
Content-Type: application/sdp
Content-Length: 140
Example 9 Status-Line Manipulation
This section shows an HMR configuration set up for status-line manipulation.
Given that the object of this example is to drop the 183 Session Progress response when it does not have SDP, your SIP manipulation configuration needs to:
- Search for the 183 Session Progress response
- Determine if the identified 183 Session Progress responses contain SDP; the Oracle® Enterprise Session Border Controller searches the 183 Session Progress responses where the content length is zero
- If the 183 Session Progress response does not contain SDP, change its status code to 699
- Drop all 699 responses
sip-manipulation
name manip
description
header-rule
name IsContentLength0
header-name Content-Length
action store
comparison-type pattern-rule
match-value 0
msg-type reply
new-value
methods
header-rule
name is183
header-name @status-line
action store
comparison-type pattern-rule
match-value
msg-type reply
new-value
methods
element-rule
name is183Code
parameter-name
type status-code
action store
match-val-type any
comparison-type pattern-rule
match-value 183
new-value
header-rule
name change183
header-name @status-line
action manipulate
comparison-type case-sensitive
match-value
msg-type reply
new-value
methods
element-rule
name make199
parameter-name
type status-code
action replace
match-val-type any
comparison-type pattern-rule
match-value $IsContentLength0 & $is183.$is183Code
new-value 199
sip-interface options dropResponse=699
Example 10 Use of SIP HMR Sets
The following example shows the configuration for SIP HMR with one SIP manipulation configuration loading another SIP manipulation configuration. The goals of this configuration are to:
- Add a new header to an INVITE
- Store the user portion of the Request URI
- Remove all Route headers from the message only if the Request URI is from a specific user
sip-manipulation name deleteRoute description delete all Route Headers header-rule name deleteRoute header-name Route action delete comparison-type case-sensitive match-value msg-type request new-value methods INVITE sip-manipulation name addAndDelete description Add a New header and delete Route headers header-rule name addHeader header-name New action add comparison-type case-sensitive match-value msg-type request new-value "Some Value" methods INVITE header-rule name storeRURI header-name request-uri action store comparison-type pattern-rule match-value msg-type request new-value methods INVITE element-rule name storeUser parameter-name type uri-user action store match-val-type any comparison-type pattern-rule match-value 305.* new-value header-rule name deleteHeader header-name request-uri action sip-manip comparison-type Boolean match-value $storeRURI.$storeUser msg-type request new-value deleteRoute methods INVITE
Example 11 Use of Remote and Local Port Information
The following example shows the configuration for remote and local port information. The goals of this configuration are to:
- Add LOCAL_PORT as a header parameter to the From header
- Add REMOTE_PORT as a header parameter to the From header
sip-manipulation name addOrigIp description header-rule name addIpParam header-name From action manipulate comparison-type case-sensitive match-value msg-type request new-value methods INVITE element-rule name addIpParam parameter-name newParam type header-param action add match-val-type any comparison-type case-sensitive match-value new-value $LOCAL_IP element-rule name addLocalPort parameter-name lport type header-param action add match-val-type any comparison-type case-sensitive match-value new-value $LOCAL_PORT element-rule name addRemotePort parameter-name rport type header-param action add match-val-type any comparison-type case-sensitive match-value new-value $REMOTE_PORT
Example 12 Response Status Processing
Given that the object of this example is to drop the 183 Session Progress response when it does not have SDP, your SIP manipulation configuration needs to:
- Search for the 183 Session Progress response
- Determine if the identified 183 Session Progress responses contain SDP; the Oracle® Enterprise Session Border Controller searches the 183 Session Progress responses where the content length is zero
- If the 183 Session Progress response does not contain SDP, change its status code to 699
- Drop all 699 responses
sip-manipulation
name manip
description
header-rule
name IsContentLength0
header-name Content-Length
action store
comparison-type pattern-rule
match-value 0
msg-type reply
new-value
methods
header-rule
name is183
header-name @status-line
action store
comparison-type pattern-rule
match-value
msg-type reply
new-value
methods
element-rule
name is183Code
parameter-name
type status-code
action store
match-val-type any
comparison-type pattern-rule
match-value 183
new-value
header-rule
name change183
header-name @status-line
action manipulate
comparison-type case-sensitive
match-value
msg-type reply
new-value
methods
element-rule
name make699
parameter-name
type status-code
action replace
match-val-type any
comparison-type pattern-rule
match-value $IsContentLength0 & $is183.$is183Code
new-value 699
sip-interface
options dropResponse=699
The following four configuration examples are based on the this sample SIP INVITE:
INVITE sip:service@192.168.1.61:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.60:5060;branch=z9hG4bK-1-0
From: sipp <sip:sipp@192.168.1.60:5060>;tag=1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: 1-15554@192.168.1.60
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.1.60:5060;user=phone>
Max-Forwards: 70
Content-Type: multipart/mixed;boundary=boundary
Content-Length: 466
--boundary
Content-Type: application/sdp
v=0
o=user1 53655765 2353687637 IN IP4 192.168.1.60
s=-
c=IN IP4 192.168.1.60
t=0 0
m=audio 12345 RTP/AVP 18
a=rtpmap:8 G729/8000/1
a=fmtp:18 annexb=no
a=sendrecv
a=ptime:20
a=maxptime:200
--boundary
Content-Type: application/sdp
v=0
o=user1 53655765 2353687637 IN IP4 192.168.1.60
s=-
c=IN IP4 192.168.1.60
t=0 0
m=video 12345 RTP/AVP 34
a=rtpmap:34 H263a/90000
a=ptime:30
--boundary--
Example 13 Remove a Line from SDP
In this example, the SIP manipulation is configured to remove all p-time attributes from the SDP.
sip-manipulation
name removePtimeFromBody
description removes ptime attribute from all bodies
header-rule
name CTypeManp
header-name Content-Type
action manipulate
comparison-type case-sensitive
match-value
msg-type request
new-value
methods INVITE
element-rule
name remPtime
parameter-name application/sdp
type mime
action find-replace-all
match-val-type any
comparison-type case-sensitive
match-value a=ptime:[0-9]{1,2}(\n|\r\n)
new-value
The result of manipulating the original SIP INVITE (shown above) with the configured SIP manipulation is:
INVITE sip:service@192.168.1.61:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.60:5060;branch=z9hG4bK-1-0
From: sipp <sip:sipp@192.168.1.60:5060>;tag=1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: 1-15554@192.168.1.60
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.1.60:5060;user=phone>
Max-Forwards: 70
Content-Type: multipart/mixed;boundary=boundary
Content-Length: 466
--boundary
Content-Type: application/sdp
v=0
o=user1 53655765 2353687637 IN IP4 192.168.1.60
s=-
c=IN IP4 192.168.1.60
t=0 0
m=audio 12345 RTP/AVP 18
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no
a=sendrecv
a=maxptime:200
--boundary
Content-Type: application/sdp
v=0
o=user1 53655765 2353687637 IN IP4 192.168.1.60
s=-
c=IN IP4 192.168.1.60
t=0 0
m=video 12345 RTP/AVP 34
a=rtpmap:34 H263a/90000
--boundary-
Example 14 Back Reference Syntax
In this sample of back-reference syntax use, the goal is to change the To user. The SIP manipulation would be configured like the following:
sip-manipulation
name changeToUser
description change user in the To header
header-rule
name ChangeHeader
header-name To
action manipulate
comparison-type case-sensitive
match-value
msg-type request
new-value
methods INVITE
element-rule
name replaceValue
parameter-name
type header-value
action replace
match-val-type any
comparison-type pattern-rule
match-value (.+)(service)(.+)
new-value $1+Bob+$3
The result of manipulating the original SIP INVITE (shown above) with the configured SIP manipulation is:
INVITE sip:service@192.168.1.61:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.60:5060;branch=z9hG4bK-1-0
From: sipp <sip:sipp@192.168.1.60:5060>;tag=1
To: sut <sip:Bob@192.168.1.61:5060>
Call-ID: 1-15554@192.168.1.60
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.1.60:5060;user=phone>
Max-Forwards: 70
Content-Type: multipart/mixed;boundary=boundary
Content-Length: 466
…
…
…
Example 15 Change and Remove Lines from SDP
In this sample of changing and removing lines from the SDP, the goal is to convert the G.729 codec to G.729a. The SIP manipulation would be configured like the following:
sip-manipulation
name std2prop-codec-name
description rule to translate standard to proprietary codec name
header-rule
name CTypeManp
header-name Content-Type
action manipulate
comparison-type case-sensitive
match-value
msg-type any
new-value
methods
element-rule
name g729-annexb-no-std2prop
parameter-name application/sdp
type mime
action find-replace-all
match-val-type any
comparison-type case-sensitive
match-value a=rtpmap:[0-9]{1,3}(G729/8000/1\r\na=fmtp:[0-9]{1,3} annexb=no)[[:1:]]
new-value G729a/8000/1
The result of manipulating the original SIP INVITE (shown above) with the configured SIP manipulation is:
INVITE sip:service@192.168.1.61:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.60:5060;branch=z9hG4bK-1-0
From: sipp <sip:sipp@192.168.1.60:5060>;tag=1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: 1-15554@192.168.1.60
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.1.60:5060;user=phone>
Max-Forwards: 70
Content-Type: multipart/mixed;boundary=boundary
Content-Length: 466
--boundary
Content-Type: application/sdp
v=0
o=user1 53655765 2353687637 IN IP4 192.168.1.60
s=-
c=IN IP4 192.168.1.60
t=0 0
m=audio 12345 RTP/AVP 8
a=rtpmap:18 G729a/8000/1
a=sendrecv
a=maxptime:200
--boundary
Content-Type: application/sdp
v=0
o=user1 53655765 2353687637 IN IP4 192.168.1.60
s=-
c=IN IP4 192.168.1.60
t=0 0
m=video 12345 RTP/AVP 34
a=rtpmap:34 H263a/90000
--boundary-
Example 16 Change and Add New Lines to the SDP
In this sample of changing and adding lines from the SDP, the goal is to convert non-standard codec H.263a to H.263. The SIP manipulation would be configured like the following:
sip-manipulation
name prop2std-codec-name
description rule to translate proprietary to standard codec name
header-rule
name CodecManp
header-name Content-Type
action manipulate
comparison-type case-sensitive
match-value
msg-type any
new-value
methods
element-rule
name H263a-prop2std
parameter-name application/sdp
type mime
action find-replace-all
match-val-type any
comparison-type case-sensitive
match-value a=rtpmap:([0-9]{1,3}) H263a/.*\r\n
new-value a=rtpmap:+$1+" H263/90000"+$CRLF+a=fmtp:+$1+" QCIF=4"+$CRLF
The result of manipulating the original SIP INVITE (shown above) with the configured SIP manipulation is:
INVITE sip:service@192.168.1.61:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.60:5060;branch=z9hG4bK-1-0
From: sipp <sip:sipp@192.168.1.60:5060>;tag=1
To: sut <sip:service@192.168.1.61:5060>
Call-ID: 1-15554@192.168.1.60
CSeq: 1 INVITE
Contact: <sip:sipp@192.168.1.60:5060;user=phone>
Max-Forwards: 70
Content-Type: multipart/mixed;boundary=boundary
Content-Length: 466
--boundary
Content-Type: application/sdp
v=0
o=user1 53655765 2353687637 IN IP4 192.168.1.60
s=-
c=IN IP4 192.168.1.60
t=0 0
m=audio 12345 RTP/AVP 8
a=rtpmap:18 G729/8000/1
a=fmtp:18 annexb=no
a=sendrecv
a=maxptime:200
--boundary
Content-Type: application/sdp
v=0
o=user1 53655765 2353687637 IN IP4 192.168.1.60
s=-
c=IN IP4 192.168.1.60
t=0 0
m=video 12345 RTP/AVP 34
a=rtpmap:34 H263/90000
a=fmtp:34 QCIF=4
--boundary-