Forum Discussion
irule for SIP forward
The SIP::header remove method takes one of these two forms:
SIP::header remove
SIP::header remove
Thus, if you are attempting to remove a specific Route header, and there may be more than one, then the form you provide will unfortunately not work. You must iterate through the Route headers until you find the position of the header to remove. In 11.6, something like this might do it:
set required_value ""
for { set i 0 } { $i < [SIP::header count Route] } { incr i } {
if { [SIP::header value Route $i] eq $required_value } {
SIP::header remove Route $i
break
}
}
Before 11.6, this may do it:
set required_value ""
set i 0
while { 1 } {
switch [SIP::header value Route $i] {
"" {
break
}
$required_value {
SIP::header remove Route $i
break
}
}
}
I'm not sure whether the SIP::header sub-commands start at 0 or start at 1. If they start at 1, you'd have to adjust the code. And, I'll have to admit that I've not tested this, so ... good luck :).
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com