Queues and remote agents connected via IAX2

Hello. So I’ve got two phone server connected through the internet via IAX2. I am trying to get it so that an extension on server B can log into a queue on server A. I can get it to work if I add the remote extension as a static agent. But I cannot get it if I use command line to log the extension in. I’ve tried having it log the ext in as a local/ext and a sip/ext. Not sure what else I could try.

I did discover that if I use the command:

Action: queueadd
Queue: 801
Interface: local/322@from-queue/n

Then ext 322 which is on a remote serverB connected via IAX2 will receive incoming calls on the queue from serverA