After your advice, looking for ' UserDeviceAdded', in 'user_login_out.agi' fop2 seems to be OK.
This is what shows up on telnet to port:
Event: UserEvent
Privilege: user,all
UserEvent: UserDeviceRemoved|Data: 378
115
This is not correct as the UserEvent with data passed is all merged into one string. I guess this is the reason why why your fop2 event parser does not capture this. You might want to make your parser also to support this odd string.
Code in ' 'user_login_out.agi'' is
agi->exec("UserEvent", "\"UserDeviceRemoved|Data: {$current_user},{$device}\"");
Note that pipe '|'. Asterisk seems to have broken handling of pipe '|' as delimiter. Using ',' as delimiter soved it. So this will work:
// $agi->exec("UserEvent", "\"UserDeviceAdded|Data: {$user},{$device}\"");
$agi->exec("UserEvent", "\"UserDeviceAdded,Data: {$user},{$device}\"");
and ...
$agi->exec("UserEvent", "\"UserDeviceRemoved,Data: {$current_user},{$device}\"");
Thank you for your support yesterday, it helped me in the right direction.
I will perform some more stress testing to verify, but for now this fixed my problems.