Forum Discussion

tmusella_-idt_1's avatar
tmusella_-idt_1
Icon for Nimbostratus rankNimbostratus
Feb 01, 2016

SIP URI Manipulation

Hi,

I have a case where I want to use one irule to replace anything that has xyz.com in the URI. I have 10 or so DNS names that all have 2 charcters in front of xyz.com.

How can I map aaxyz.com, bbxyz.com, ccxyz.com to the local ip? Is there a wildcard I could use in the string map?

Thanks.

when SIP_REQUEST {

Check if URI contains xyz.com if {[SIP::uri] contains "xyz.com" }{

   Replace xyz.com with the VIP address
  SIP::uri [string map "xyz.com [IP::local_addr]" [SIP::uri]]

} }

1 Reply

  • Hi Tmusella-idt,

    to include

    $variables
    or
    [commands]
    into a
    [string map]
    , you may try a
    [list]
    based syntax...

    [string map [list "aaxyz.com" [IP::local_addr] "bbxyz.com" [IP::local_addr]] [SIP::uri]]

    Cheers, Kai