There are cases when the new presence is offline even if one extension of the user is online, it happens more often with custom or physical devices.
Steps to reproduce
Close all the cti clients connected to the ws
Take an user with the personal presence set to online and a linked physical device
Restart the nethcti-server or if it isn't reproducible in this way try to restart only asterisk
Send the /user/endpoints/all request and note that mainPresence is offline for the users with a connected physical device
Send the /astproxy/extensions request and note that the related extension is online
In this case the mainPresence for the user must be online.
Note: generate an authorization token using the mobile qrcode, in this way the token will persist after the server restart
Solution
The mainPresence must be updated from extenUpdate even if no client are connected to the ws, in this way the mainPresence status is more precise and performant and doesn't depend by the connected clients
The mainPresence must have a default value and it must be checked and initialized on users startup after the extensions initalizzation to avoid wrong statuses caused by the lack of events
There are cases when the new presence is offline even if one extension of the user is online, it happens more often with custom or physical devices.
Steps to reproduce
/user/endpoints/all
request and note that mainPresence is offline for the users with a connected physical device/astproxy/extensions
request and note that the related extension is onlineIn this case the mainPresence for the user must be online.
Note: generate an authorization token using the mobile qrcode, in this way the token will persist after the server restart
Solution
Components
nethcti-server3