Rafael,
APM makes use of an special EVENT that is only triggered when the policy is evaluated and you have an irule event box. You need an irule more like this:
when ACCESS_POLICY_AGENT_EVENT {
if { [ACCESS::policy agent_id] eq "event_name_in_your_accesspolicy" } {
if {[active_members pool_SMS] > 1} {
ACCESS::session data set session.custom.sms_server 1
} else {
ACCESS::session data set session.custom.sms_server 0
}
}
}
I have not tested the irule but it should be something like that. Pay special attention to the agent_id in your policy as it must match. If everything is fine then you should see that variable when you execute sessiondump