Dear all
I try to remove a Via from a header. Unfortunately, the via from INVITE sip:user@domain SIP/2.0 Via: SIP/2.0/UDP 10.0.0.1:20592;branch=z9hG4bK-d8754z-1955bd20f1745139-1---d8754z-;rport Max-Forwards: 70
is changed after remove_hf("Via") to INVITE sip:user@domain SIP/2.0 Via: SIP/2.0/UDP 10.0.0.2;branch=z9hG4bK-d8754z-1955bd20f1745139-1---d8754z- ;rport=20592Max-Forwards: 69
10.0.0.2 is a proxy i sent the message through and 10.0.0.1 is the originating endpoint. So rport is not removed and no CRLF is added after the rport parameter is added. Is this behaviour as it should be? I wanted to remove the whole line. Or can I restrict adding the rport parameter?
Furthermore, the option _not_ to set an via for a message sent through my proxy 10.0.0.2 would be also very helpful for me. It is not possible though, right? At least I didn't find any further information....
Any ideas?
Best regards Sebastian
Hi Sebastian,
What you are trying to do (playing with VIA headers) is a bit dangerous :) - how this works is automatically done by openser and it is not intended to interfere with from the script.
The bogus result is because of how openser internally process the changes on the message. The changes are not immediately applied, but separately store (as lumps) and applied at the end. What happens in your case, is like this:
1) probably you use force_rport() function that adds the rport param to the top most VIA hdr (as add lump) 2) you call remove_hf() that creates another lump to delete the top most VIA 3) when lumps are applied, the original VIA text is removed, but the rport text is printed because of the add lump (step 1).
Probably avoiding the force_rport() function will solve this issue, but note that this function is also internally called.
Regarding the addition of the local VIA (when forwarding the request) - this is mandatory by RFC3261 - a SIP proxy must add its VIA. But if you really know what you want to do, try to use the send() function - this will simply send the request to another destination without adding the local VIA.
Regards, Bogdan
Schumann Sebastian wrote:
Dear all
I try to remove a Via from a header. Unfortunately, the via from INVITE sip:user@domain SIP/2.0 Via: SIP/2.0/UDP 10.0.0.1:20592;branch=z9hG4bK-d8754z-1955bd20f1745139-1---d8754z-;rport Max-Forwards: 70
is changed after remove_hf("Via") to INVITE sip:user@domain SIP/2.0 Via: SIP/2.0/UDP 10.0.0.2;branch=z9hG4bK-d8754z-1955bd20f1745139-1---d8754z- ;rport=20592Max-Forwards: 69
10.0.0.2 is a proxy i sent the message through and 10.0.0.1 is the originating endpoint. So rport is not removed and no CRLF is added after the rport parameter is added. Is this behaviour as it should be? I wanted to remove the whole line. Or can I restrict adding the rport parameter?
Furthermore, the option _not_ to set an via for a message sent through my proxy 10.0.0.2 would be also very helpful for me. It is not possible though, right? At least I didn't find any further information....
Any ideas?
Best regards Sebastian
Hi Bogdan
I do not call force_rport specificly from the script. But I checked my eyeBeam and he uses rport, so it is invoking it internally I guess. I switched it off now.
But the send() function was indeed what I was looking for. I use it for testing a SBC, I need to know whether it will reject it or not.
Thank you for your help, that was all I needed to know.
Best regards Sebastian
-----Original Message----- From: Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro] Sent: Monday, 30. June 2008 10:35 To: Schumann Sebastian Cc: users@lists.openser.org Subject: Re: [OpenSER-Users] remove_hf from textops does not remove whole header field
Hi Sebastian,
What you are trying to do (playing with VIA headers) is a bit dangerous :) - how this works is automatically done by openser and it is not intended to interfere with from the script.
The bogus result is because of how openser internally process the changes on the message. The changes are not immediately applied, but separately store (as lumps) and applied at the end. What happens in your
case, is like this:
1) probably you use force_rport() function that adds the rport param to the top most VIA hdr (as add lump) 2) you call remove_hf() that creates another lump to delete the top most VIA 3) when lumps are applied, the original VIA text is removed, but the rport text is printed because of the add lump (step 1).
Probably avoiding the force_rport() function will solve this issue, but note that this function is also internally called.
Regarding the addition of the local VIA (when forwarding the request) - this is mandatory by RFC3261 - a SIP proxy must add its VIA. But if you really know what you want to do, try to use the send() function - this will simply send the request to another destination without adding the local VIA.
Regards, Bogdan
Schumann Sebastian wrote:
Dear all
I try to remove a Via from a header. Unfortunately, the via from INVITE sip:user@domain SIP/2.0 Via: SIP/2.0/UDP
10.0.0.1:20592;branch=z9hG4bK-d8754z-1955bd20f1745139-1---d8754z-;rport
Max-Forwards: 70
is changed after remove_hf("Via") to INVITE sip:user@domain SIP/2.0 Via: SIP/2.0/UDP 10.0.0.2;branch=z9hG4bK-d8754z-1955bd20f1745139-1---d8754z- ;rport=20592Max-Forwards: 69
10.0.0.2 is a proxy i sent the message through and 10.0.0.1 is the originating endpoint. So rport is not removed and no CRLF is added after the rport parameter is added. Is this behaviour as it should be?
I wanted to remove the whole line. Or can I restrict adding the rport parameter?
Furthermore, the option _not_ to set an via for a message sent through
my proxy 10.0.0.2 would be also very helpful for me. It is not possible though, right? At least I didn't find any further
information....
Any ideas?
Best regards Sebastian