Persistance based on SIP Session ID

edited July 2022 in aFleX
Posted by kmcewen@a10networks.com

I have a potential customer that requires to achive IP Source (port based) pesrsistance based on the SIP Session ID.

I.e that the client will persist if the connection is from the same session.

Comments

  • edited February 2014
    Posted by ddesmidt

    Hi,

    We have aFleX SIP commands:
    SIP::call_id, SIP::from, SIP::header, SIP::method, SIP::respond, SIP::response, SIP::to, SIP::uri, SIP::via

    I understand you're not interested in the call_id but the session_id.
    I don't know what is the SIP Session ID header name.
    Once you know it, you can use the SIP::header to retrieve its value and do persistence based on that.

    Your aFleX should be close to the one below:
    Note: I haven't tested it because I don't have SIP in my lab, but come back to us with your results.

    Code:

    when SIP_REQUEST { # Note: I don't know the Session-ID header name,  I use "Session-ID" as an example set session_id [SIP::header Session-ID] # check if the Session ID is in the persist table set p [ persist lookup uie $session_id all ] if { $p ne "" } { # Session ID found in the persist table log "Session ID = $session_id found in persistency-table  ([lindex $p 0] [lindex $p 1])" } else { # unknown Session ID log "Session ID = $session_id not found in persistency-table" } } when SERVER_CONNECTED { # Create/update persist uie entry with the Session ID for 1 hour persist add uie $session_id 3600 log "Add/Update persist entry for client $session_id with server  [LB::server addr]" }

    Dimitri
Sign In or Register to comment.