Queue Agent Login Remotely as Static Agents

I need some custom work for Free PBX.

I would like to have user login to queues, it should ask them for a user and password. if verified, it should play a message there name and status (if they are logged in or out)
to login press 1 to logout press 2

Pressing 1:
Add Record:
Database: Asterisk
Table: Queues_Details
Fields: ID=8101, Keyword=member, data=Local/[userinfo]@from-queue/n,0, flags=0
Now it needs to run the cmd apply config.

Pressing 2:
Delete this users record from this server.