Forum Discussion

marlon_Gino-gi1's avatar
marlon_Gino-gi1
Icon for Nimbostratus rankNimbostratus
Aug 19, 2008

persistence based on MSISDN number

hello,

 

 

Im new to Irules,

 

 

would like to know if there is an Irule that that can persist client connection based on client mobile number or msisdn? the client mobile number is included within the header whenever the client request for a service or connection to the backend server.

 

 

 

thanks in advance

 

 

  • James_Quinby_46's avatar
    James_Quinby_46
    Historic F5 Account
    One way to accomplish this is with the universal persistence profile, which lets you persist on strings located within, among other things, HTTP headers. For example (and I'm getting this right out of the book I received in training):

     
     when HTTP_REQUEST { 
       persist uie [findstr [HTTP::URI] "user=" 5 "&"] 
     } 
     

    ...will persist on a name/value pair as presented in the URL string. There are probably other ways of doing this, but this came to mind immediately.
  • Patrick_Chang_7's avatar
    Patrick_Chang_7
    Historic F5 Account
    http://devcentral.f5.com/weblogs/dctv/archive/2008/06/25/3390.aspx

     

     

    A more generalized solution that I think can be applied to your case.
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Click here for a post I found in the v4.x forum that seems to contain a v9 version of an MSISDN persistence iRule they wanted to convert to v4.x...

     

     

    hth

     

    /deb

     

     

     

     

  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    oh, also please post back if it works & we can add it to the codeshare.
  • hello guys,

     

     

    thanks for the reply. anyways can you help me understand what the Irule below does.

     

     

    thanks in advance.

     

     

     

    when CLIENT_ACCEPTED {

     

    TCP::collect

     

    }

     

    when CLIENT_DATA {

     

    set str "[TCP::payload ]"

     

    if { $str contains "AAA" } {

     

    set num [ findstr "$str" "AAA:" 7 \n ]

     

    }

     

    persist uie $num 300

     

    TCP::release

     

    }

     

     

    I think than it could work on this way:

     

     

    accumulate

     

    if { tcp_content contains "MSISDN"}

     

    set num [findstr[tcp_content] "MSISDN:" 7\n]

     

    persist simple $num 300

     

    discard