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 you are in agentpool, you can check the status of all agents using:
agentmanager show
Agents
Id Status LoggedAsType Direction Endpoint State DeviceState HintState ChannelId Wrapuptime
Agent/1000 LoggedIn callback inbound PJSIP/102 OFFLINE UNAVAILABLE UNAVAILABLE 0
Agent/4187 LoggedOut 8
Agent/4188 LoggedOut OFFLINE INVALID UNAVAILABLE 8
Agent/4189 LoggedOut OFFLINE INVALID UNAVAILABLE 8
Agent/5555 LoggedOut 0
Agent/6666 LoggedIn callback inbound PJSIP/121 OFFLINE UNAVAILABLE UNAVAILABLE 0
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}}
Status portion "status":1
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 with "status": 0:
{"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}}