[asterisk-dev] Direction on how to "fix" linear realtime queue

Leandro Dardini ldardini at gmail.com
Sun Dec 8 16:04:48 CST 2013


Hello,
I start using realtime queue and while all queue types perform great, I
find not usable the linear strategy. In the linear strategy, order of the
agents matters. The problem is due to the fact it is not possible (in a
clean way) to list the agents in the desired order. There is no field in
the queue_member table to use for ordering the agents and the order is done
using the interface name.

The query performed by Asterisk while retrieving the agents for a queue is
the following:

SELECT * FROM queue_member WHERE interface LIKE '%' AND queue_name = '13'
ORDER BY interface

I'd like to add a new column "inorder" and have the queue members to be
retrieved in the order given by that column.

I check the apps/app_queue.c and in the function
"find_load_queue_rt_friendly" there is the retrieval of the queue members:

                queue_vars = ast_load_realtime("queues", "name", queuename,
SENTINEL);
                if (queue_vars) {
                        member_config =
ast_load_realtime_multientry("queue_members", "interface LIKE", "%",
"queue_name", queuename, SENTINEL);
                        if (!member_config) {
                                ast_debug(1, "No queue_members defined in
config extconfig.conf\n");
                                member_config = ast_config_new();
                        }
                }

I haven't fully understood the ast_load_realtime_multientry syntax, but it
seems it apply an "order by" on the first column used as filter.
Unfortunately the first column filtered is also the one used to specify the
value to retrieve.

Is there a way to specify which column use for ordering while getting the
value from another one?

Leandro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131208/d9578689/attachment-0001.html>


More information about the asterisk-dev mailing list