In Asterisk 1.4 and above, you can dynamically add and remove queue members from an extension or the command-line interface (CLI). Although you will most likely do most of your adding and removing via extensions, you might also find it helpful to remove a queue member by hand on occasion.
These commands can appear in standard extension configuration files or using the Asterisk Extension Language (AEL).
The only required parameter for this command is the name of the queue. If no interface parameter is provided, the command assumes that the calling device should be added. Since my agents do not map directly to SIP devices, I provide an interface. I also provide a penalty since some agents should receive more calls than others.
Like the previous command, this only requires a queue name. Again, I provide the interface name since my Agent IDs do not map directly to SIP devices.
Sometimes, you need to remove a member from a queue without dialing an extension. These handy CLI commands can do just that.
*CLI> queue add member interface to queuename *CLI> queue remove member interface from queuename
queuename are required here. Fortunately, the CLI supports
command completion when possible. In other words, if you know which letter the
queue starts with, you don't need to type the whole name.
Further reading: Asterisk: The Definitive Guide