Add new option to Queue function

Hi all,
I’m using Queue function of Asterisk to arrange calls which is coming to my agents. I want to customize the way asterisk arrange coming call, in other word, is it possible to create a new option instead of using the existing:RINGALL, ROUNDROBIN,… . For example: The incoming call should come to the argent who has the most waiting time (idle time). I find out that the algorithm of each option of Queue is defined in “app_queue.c” in the source code but I don’t know how to change, how to add the waiting time as a new option to sort by.

This question is quite related to the development of asterisk, so please help if you have any idea or experience on that. Thank you very much.

Use the asterisk-developers mailing list for coding questions.