Forum Discussion

Jordan-N_198992's avatar
Jordan-N_198992
Icon for Nimbostratus rankNimbostratus
Apr 27, 2015

iRules For Redirection and Selecting Pool

Hello All,

 

I'm very new to iRules and would like some guidance on if the following is possible.

 

We're trying to force all external participants who's joining our Lync meeting to go via Lync Web App (silverlight instead on fat client).

 

When they click on the meeting link, it will detect if they have the client installed and if so will use the client, else will open a browser and join using the Web App.

 

We can force the meeting to open via Lync Web App, just need to append the following to the end of the URL: ?sl=1

 

The participants will receive a meeting link like below;

 

Orginal link: https://meet.domain.com/username/abcd1234

 

We need the link redirected to when clicked: https://meet.domain.com/username/abcd1234?sl=1

 

Once redirected, it should select the Lync pool, but I've read that redirecting and selecting pool are mutually exclusive, it's one or the other?

 

So do you have any recommendation on how I could archive this using iRules?

 

Thanks,

 

-Jordan

 

5 Replies

  • Try this...

    when HTTP_REQUEST { 
    if { [HTTP::uri] starts_with "/username/abcd1234" } {
        HTTP::redirect https://meet.domain.com/username/abcd1234?sl=1 
          } 
    }
    

    Let me know, if username and password is dynamically changing?

  • Sorry I should have mentioned that the username and abcd1234 portion will change dynamically.

     

    I have the following code but not sure if it will work or not.

     

    when HTTP_REQUEST {
    if { [string tolower [HTTP::host]] eq "meet.domain.com" } {
          HTTP::redirect "https://[HTTP::host][HTTP::uri]?sl=1"
          }
        "default" {
         pool lyncpool.domain.com
        }
       }
    • Samir_Jha_52506's avatar
      Samir_Jha_52506
      Icon for Noctilucent rankNoctilucent
      Small modification. Hope it will work.. when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "meet.domain.com" } { HTTP::redirect "https://[HTTP::host][HTTP::uri]?sl=1" } default { pool lyncpool.domain.com } }
  • Ended up using the code below which works for us.

     

    Thanks for all your help Samir.

     

    when HTTP_REQUEST {
      if {[HTTP::method] eq "GET"}{    
         switch -glob [string tolower [HTTP::host]] {
             lyncweb.domain.com*  { pool lyncpool.domain.com }
             officeweb.domain.com*  { pool officewebapp.domain.com }
             dialin.domain.com* { pool lyncpool.domain.com }
             lyncdiscover.domain.com* { pool lyncpool.domain.com }
             }
        if {([HTTP::host] eq "meet.domain.com" ) && ([HTTP::uri] ends_with "?sl=1")}{
     pool lyncpool.domain.com
        } else {
        HTTP::redirect "https://[HTTP::host][HTTP::uri]?sl=1"
    log local0. "https://[HTTP::host][HTTP::uri]?sl=1"
            } 
      }
    }