Forum Discussion
Jeff_47438
Altocumulus
Mar 04, 2018SIP "TO" header string map replacement
I am trying to manipulate a portion of a SIP INVITE with an irule. This is a version 12 F5.
The irule is this:
when SIP_REQUEST {
log local0. "The TO header before changes is [SIP::header "To...
Jeff_47438
Altocumulus
Mar 05, 2018Figured it out. Here is the solution I used.
when SIP_REQUEST { set TO_HEADER1 [SIP::header "To"] log local0. "Rewrite before is $TO_HEADER1" if { ($TO_HEADER1 contains "TENANT_SG1_105_85TEST") } then { set TO_HEADER2 [string map -nocase {"TENANT_SG1_105_85TEST" "3035555555"} $TO_HEADER1] log local0. "Rewrite after is $TO_HEADER2" SIP::header remove "To" SIP::header insert "To" "$TO_HEADER2" } }
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects