HOWTO Agent login stuck
From Bicom Systems Wiki
HOWTO Agent login stuck
To get the information on agent's status in Agentpool you first have to enter Agentpool CLI using this command:
chroot /opt/pbxware/pw/ agentpool -r
Once in there, you can check the status of all agents using:
agentmanager show
In order to check specific agent, you will have to use API request below, while replacing 1000 with the number of agent you are experiencing issues with:
api request GET /agent/info '{"agent_id": "Agent/1000"}'
Reply should look something like this:
{"requestid":"94912916-17cf-43c7-8213-291b68a33148","method":"GET","resource":"/agent/info","code":200,"data":{"id":"Agent/1000", "name":"TestAgent","number":1000,"endpoint":"","status":1 ,"pause_reason":"2","device_state":"","hint_state":"", "state":"","login_time":1607035859,"logged_as_type":"","pause_time":1607114520,"start_call_time":0,"connect_call_time":0,"ended_call_time":0,"channelid":"","direction":"","accountcode":"100","wrapuptime":15}}
You will notice I have bolded status portion, as this is what gives us information on what is the current status of this agent in Agentpool.
Status values:
0 - LoggedOut
1 - LoggedIn
2 - Paused
Now, as this agent is not supposed to be logged in, we need to log him out of the Agentpool, and we can do that using command:
api request DELETE /agent/login '{"agent_id": "Agent/1000"}'
Once done, please log in to this agent and confirm if issue has been resolved or additionally re-check current status with above command
api request GET /agent/info '{"agent_id": "Agent/1000"}'
Reply should look something like this:
{"requestid":"94912916-17cf-43c7-8213-291b68a33148","method":"GET","resource":"/agent/info","code":200,"data":{"id":"Agent/1000", "name":"TestAgent","number":1000,"endpoint":"","status": 0, "pause_reason":"2","device_state":"","hint_state":"", "state":"","login_time":1607035859,"logged_as_type":"","pause_time":1607114520,"start_call_time":0,"connect_call_time":0, "ended_call_time":0,"channelid":"","direction":"","accountcode":"100","wrapuptime":15}}