Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
If header exists, modify it
Author Message
mbylica
Brekeke Addict


Joined: 16 May 2011
Posts: 41
Location: Poland

PostPosted: Tue May 22, 2012 4:37 pm    Post subject: If header exists, modify it Reply with quote

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/networkpatterns.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?
Back to top
View user's profile
Laurie
Brekeke Master Guru


Joined: 07 Jan 2008
Posts: 245

PostPosted: Tue May 22, 2012 6:41 pm    Post subject: Reply with quote

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
Back to top
View user's profile
mbylica
Brekeke Addict


Joined: 16 May 2011
Posts: 41
Location: Poland

PostPosted: Wed May 23, 2012 9:25 am    Post subject: Reply with quote

Thanks for prompt answer.
I guess that your config should be ok - I missed continue in my previous tests Smile

I am about to put this in my dialplan and give you feedback later here.
Back to top
View user's profile
Laurie
Brekeke Master Guru


Joined: 07 Jan 2008
Posts: 245

PostPosted: Wed May 23, 2012 1:40 pm    Post subject: Reply with quote

Have a fan Smile
Back to top
View user's profile
mbylica
Brekeke Addict


Joined: 16 May 2011
Posts: 41
Location: Poland

PostPosted: Sun May 27, 2012 2:47 pm    Post subject: Reply with quote

Laurie wrote:
Have a fan Smile


It works fine, thx again.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1