Find which extension is going to ring in queue

Is there anyway to fetch that which extension is going to ring in a Queue which is of having 5 agent
s extensions …Apart from the ring strategy of the queue.If it is possible then I can pass that as a variable to external DB using AGI…and further popup and all in the webgui.

I am newbie in Asterisk Manager Interface…
If anyone knows jz help me out of these…
Thanks in Advance

Please dont duplicate threads.

If you are new with AMI, You need to read about this or pay for. This is not an easy task for newbie and there is not an step by step guide.

You could use the option :

membergosub=gosub_context_name[,arg1[,…][,argN]]

if set, run this gosub when connected to the queue member
you can override this gosub by setting the gosub option on
the queue application

Related to AM here you have some links:

wiki.asterisk.org/wiki/pages/vi … Id=4817239

the-asterisk-book.com/1.6/asteri … r-api.html

Note you can use VICIDIAL and avoid the programming task.