Forum Discussion

maxime_58258's avatar
maxime_58258
Icon for Nimbostratus rankNimbostratus
Mar 19, 2014

How to replace a missing Http header bu using F5 ?

Hi everyone,

 

I'm a newbie in irule programming and i need some help to write an irule based on the http header inpection.

 

how can i do to check the value of this field in the http header and depend to the value to ask to the F5 to query ldap to retrieve the missing field.

 

her an example of the http header with X-MSISDN having a value NULL (EMPTY)

 

GET /mms/wapenc?location=15066506840_0md6kv&rid=030 HTTP/1.1 X-Wap-Profile: http://iphonemms.apple.com/iphone/uaprof-2MB.rdf x-up-subno: X-WAP-MSISDN: -> it is empty

 

Accept: application/vnd.wap.mms-message

 

so, the https header is null, I would like to retrieve the missing info by quering ldap Then based on the ldap response to replace the blank field by the response coming from ldap

 

Is it possible ?

 

Many thanks for your help

 

4 Replies

  • Maxime -

     

    It is possible. You will need to use a sideband connection to query the LDAP. Then replace the header as needed.

     

    This will get you started with the side band connection LINK

     

    This is a fairly intensive iRule, and if you are new at it, it may be frustrating. The check for the null header, and the header insertion is the easy part, the sideband stuff is not for the faint of heart.

     

    If you don't have the kind of time or bandwidth needed to accomplish this, I know F5 Pro Services does it somewhat regularly.

     

    Hope This Helps, Jeff

     

  • If this is still relevant, actually, for querying LDAP it could be easier to use an Access-Policy and call the policy directly from an iRule using ACCESS::policy evaluate, and afterwards read the according session-variable, see here

     

  • The HTTP header enrichtment for MMS traffic is typically done on the WAP2 gateway, which is an network enforced HTTP proxy with a RADIUS accounting proxy, allowing to get all RADIUS packets from the GGSN as the PDP/IP conect for the client is established. Then the gateway enriches the HTTP headers with any RADIUS provided values, i.e. Calling-Station-Id woudl be your MSISDN for the MMSC. See Kannel WAP gateway for an open source WAP gateway that can do this.