[asterisk-dev] Member order in RealTime dynamic queues

Saúl Ibarra saghul at gmail.com
Tue Jun 24 09:25:28 CDT 2008


> The hash is based on the "interface" associated with a queue member. There is a
> way you can edit the code such that you can predict the order of queue members.
> In the function init_queue(), look for the following line:
>
> q->members = ao2_container_alloc(37, member_hash_fn, member_cmp_fn);
>
> If you change the 37 to a 1, then the result will be that the hash table for
> that queue's members will have one bucket instead of 37. Since all members will
> hash to the same bucket, you essentially will be using a linked list for queue
> members. Members would then be stored in the order in which they are parsed in
> the configuration.
>

Yeah!! It works!! Members are listed ordered by interface!! Now iI
have another little question :) Now when I logout (delete from the
table) and login back again (insert in the table), the member is
inserted in last place. Would there be a way for this member to be
inserted in order? Modifying the hash function maybe?

Thanks a lot Mark!!


-- 
Saúl -- "Nunca subestimes el ancho de banda de un camión lleno de disketes."
----------------------------------------------------------------
http://www.saghul.net/



More information about the asterisk-dev mailing list