Forum Discussion
SIP "TO" header string map replacement
- Mar 06, 2018
Figured 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" } }
Figured 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
* 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