within a 302 SIP message is a "Contact" field
The contact field will contain the redirected telephone in the format of a uri like this
Contact: "16601003"
I only need to replace the IP address, which will vary with every 302 from the server. I want to set it statically to an IP address I want.
at first I tried to use UDP::payload and replace the hex values using the offset, but the offset varies too... so now I'm trying it this way... let me repost the the irule there are some small details missing...
when SIP_RESPONSE {
set contact [ SIP::header Contact ]
set telephone 0
set bind 0
regexp {[0-9]{13}} $contact telephone
regexp {[0-9]{8}} $contact bind
SIP::header remove Contact
SIP::header insert [format \"$bind\"
}