[asterisk-dev] Member order in RealTime dynamic queues

Johan Wilfer johan at wilfer.se
Tue Jun 24 11:17:43 CDT 2008


Can't you use the penalty setting for the agent? Then you can define your
own order... No need to modfy the asterisk source.
/Johan

2008/6/24 Saúl Ibarra <saghul at gmail.com>:

> > 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/
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> AstriCon 2008 - September 22 - 25 Phoenix, Arizona
> Register Now: http://www.astricon.net
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20080624/8eceafae/attachment-0001.htm 


More information about the asterisk-dev mailing list