Hi Evelin,
It is little tricky here as F5 has to act as a ALG. F5 has to update/insert the Record-Record header based on where the request/response is coming from.
If the request/response is coming from Client without Record-Route header then F5 has to insert the header with SNAT IP. But if the header is already present with VIP as value then F5 has to update the value with SNAT IP.
If the request/response is coming from SIP server without Record-Route header then F5 has to insert the header with VIP. But if the header is already present with value as SNAT IP then F5 has to update the value with VIP.
To know whether SIP message is coming from Client or SIP server you can use clientside command.
if { [clientside] } { Message from Client
SIP::header insert "Record-Route" SNATIP
} else { Message from Server
SIP::header insert "Record-Route" VIP
}