Please read the docs at https://wiki.asterisk.org/wiki/display/AST/Building+Queues they have a good start there for a full multi-queue login / logout..