Forums Read-only archive

To modify sip headers

10 posts · Brekeke SIP Server Forum

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

2. Java version:
1.6.0_25, 1.6.0_45

3. OS type and the version:
linux centos 5.5

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

5. Your problem:
Could BSS modify SIP headers that are a part of non-INVITE messages?
In other words, i would like to modify some headers in OK message that is within the sip dialog.

I tried with $request and $response but without any success.

Thanks in advance for any hint.
Beenie
Put _ in the front of the header name in DeployPatterns.
It means for a response packet.

If the header name is "Test", you need to put "_Test" in DeployPatterns.
Let you try.
mbylica
Thanks Beenie for the hint.
I have narrowed the messages down and applied the rule.

Thanks.
mbylica
Hello,

One more question has just crossed my mind.
How can i modify some headers but only inside BYE message?
The rest of sip messages should be left unchanged.

I know that BYE is mid-session request and dialplan matched only requests which have unique Call-ID, thereby i cannot use:
request=^BYE in this case.

Is there any wayout here? (i need to strip Contact header in BYE request).

Thx in advance
ambrosio
Session Plugin API can manipulate any SIP packets and any SIP headers.
mbylica
right, but following settings should work:

Matching Patterns
Call-ID=(.+)@10.10.10.5
CSeq=(.+)BYE

Deploy Patterns
_X-Test=test
$continue=true

but new header is not incorporated into BYE that is passing through BSS.
ambrosio
DialPlan doesn't allow to catch PRACK, ACK, CANCEL and BYE.

Do you have any reason to modify BYE?
mbylica
Yes i need to strip Contact header there.
Some of softswitches are using this header without any reason, which is a problem in my case.
ambrosio
How do you want to strip the Contact header?
mbylica
If i could catch BYE request then i may just simply remove Contact header...

Contact=

in deploy pattern