Thanks Nat for your response. Your suggestion of checking for which side of context iRule help me understand what is happening a little more.
We are using version 9.4.6.
The incoming virtual server uses following two iRules:
sip_in
sip_in_2
The outgoing virtual server uses following two iRules:
sip_out
sip_out_2
Find below iRules mentioned above.
iRule sip_in:
when SIP_REQUEST {
pool sip
log local0. "clientside = [clientside]"
set id "[persist lookup sip [SIP::call_id]]"
log local0.alert "ID found in lookup is: $id"
if { [llength $id] } {
logic to use appropriate pool
pool sip
return
}
set id "[SIP::call_id] any virtual"
set sessionInfo [session lookup uie "[SIP::call_id] any virtual"]
logic to use appropriate pool
pool sip
return
}
iRule sip_in_2:
when SIP_RESPONSE {
pool sip
set clientside [clientside]
log local0. "clientside = [clientside]"
if { $clientside == 0 }
{
log local0. "call id: [SIP::call_id]"
log local0. "From: [SIP::from]"
log local0. "To: [SIP::to]"
log local0. "Method: [SIP::method]"
log local0. "Response: [SIP::response code] [SIP::response phrase]"
return
}
set abcd "[SIP::call_id] any virtual"
set id "[persist lookup sip $abcd]"
log local0.alert "ID found in persist lookup is: $id"
if { [llength $id] } {
logic to use appropriate pool
pool sip
return
}
set id "[SIP::call_id] any virtual"
set sessionInfo [session lookup uie "[SIP::call_id] any virtual"]
logic to use appropriate pool
pool sip
return
}
iRule sip_out:
when SIP_REQUEST {
pool sip
log local0. "clientside = [clientside]"
session add uie [SIP::call_id] [IP::client_addr] 3600
forward
}
iRule sip_out_2:
when SIP_RESPONSE {
pool sip
log local0. "clientside = [clientside]"
forward
}
After putting check for which side of context iRules is at the moment. I observed following:
a. When a new SIP request comes into LTM from Client 1. LTM uses sip_in iRule and forward it to Server instance 1.
b. Then Server processes on that SIP request for forward it to deliver to client 2 through LTM. At this point sip_out iRule is hit.
c. Then client 2 responds then sip_in_2 iRule is hit (with clientside context). Per sip_in_2 IRule LTM forwards thus received SIP response to Server instance 1.
d. Then Server processes on that SIP response and forward it to be delivered to client 1. At this point sip_in_2 iRule is hit (with serverside context!!!).
Can you help me understand why sip_in_2 is hit instead of sip_out_2 in d above?