Forums Read-only archive

If header exists, modify it

5 posts · Brekeke SIP Server Forum

mbylica Original post
1. Brekeke Product Name and version:
BSS, 2.4.8.6

2. Java version:
1.6.0_25

3. OS type and the version:
linux centos 5.5

4. UA (phone), gateway or other hardware/software involved:
doesn't matter

5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/ ... terns.html :
Pattern 9

6. Your problem:
I would like to make some modifications on Remote-Party-ID header.
The problem i have just encountered is that if incoming SIP request does not have RPID header, then the rule is omited.
Is there any way to check if Remote-Party-ID header exists among sip invite headers. If it exists then i should be able to modify it (add prefix or so). Otherwise no RPID should be added.

I was playing around with $math.gt as well as $str.equals but without success.

Could sb advice how to create such pattern?
Laurie
Does the following meet the requirement??

Put this in the top of dialplan rule list.
-------------------------
[Matching Patterns]
$request = ^INVITE
Remote-Party-ID = (.+)

[Deploy Patterns]
Remote-Party-ID = Prefix%1
$continue = true
-------------------------
mbylica
Thanks for prompt answer.
I guess that your config should be ok - I missed continue in my previous tests :)

I am about to put this in my dialplan and give you feedback later here.
Laurie
Have a fan :-)
mbylica
Laurie wrote:Have a fan :-)
It works fine, thx again.