insert HTTP header according to a value received in Radius accounting
I'd like to know if the following is somehow achievable:
I want that from Every Radius Accounting message (UDP 1813) the BIGIP will look for 3 attributes: Calling-Station-Id, Framed-IP-Address & Acct-Status-Type
In case the Radius attribute Acct-Status-Type=1 (Start) the BIGIP will insert an entry to a table in which the key will be the Framed-IP-Address and the value will be the Calling-Station-Id.
In case the Radius attribute Acct-Status-Type=2 (Stop) the BIGIP will remove the value of an entry in the same table (remove the value which is the calling-station-id assigned to the framed-ip-address)
Then when HTTP transaction arrive from a client IP which appears as a key in the table, the BIGIP will insert the value assigned to that key in the table (i.e. the corresponding Calling-Station-Id) to an HTTP header called "MSISDN".
Example:
Radius accounting arrives with following attributes:
Acct-Status-Type=1
Calling-Station-Id=123456789
Framed-IP-Address=1.1.1.1
An entry is inserted to a table
1.1.1.1 (key) -> 123456789 (value)
HTTP request arrives from source IP 1.1.1.1
The F5 will insert a header "MSISDN: 123456789" to the HTTP request before forwarding.
Radius accounting arrives with following attributes:
Acct-Status-Type=2
Calling-Station-Id=123456789
Framed-IP-Address=1.1.1.1
The value is removed
1.1.1.1 (key) -> (empty)
HTTP request arrives from source IP 1.1.1.1
The F5 will not insert a header (not "MSISDN: 123456789" and not "MSISDN: ")
Hope it's clear.
Thanks in advance,
Yaniv