[asterisk-dev] Realtime queue members

Atis Lezdins atis at iq-labs.net
Wed Oct 3 16:48:56 CDT 2007


Hi,

As i'm moving to realtime queue members, i'm parallely diggin the code to find 
out hidden features (already updated voip-info on what i've found) :D 

As far as i have got, AddQueueMember doesn't insert corresponding member in RT 
table - it's added as dynamic member. This is discussed in #0004037, however 
there are no references on further work regarding this.

It would be nice (however undesirable for some huge configurations), that RT 
queue members would be refreshed every second or so from database. Currently 
if you insert a member in database, and there is call in queue (but no agents 
available) it will wait forever. However with current queue implementation i 
don't see easy way how this can be achieved - callers are on separate 
threads, each checking for available members. So, if i would add 
load_realtime_queue() within wait_our_turn() it would result in multiple 
checks (on every thread) per loop. So, unless there is some synchronization 
mechanism, this is quite ineffective.

What i would propose is to add AMI (QueueRefresh) and CLI ("queue refresh") 
commands for refreshing queue from RT database. I know that "queue show 
<name>" could do that, but i would still prefer separate action - as i 
actually don't need the result.

Additionaly i think i fixed bug that QUEUE_MEMBER_COUNT() doesn't load queue 
from RT (and doesn't update agent count on changes). As this is generally 
used before routing call to queue, it should refresh members from database. 
Can anybody commit this w/o issue? If not, i will open one.

the code would look:

static int queue_function_qac 

  ...

  load_realtime_queue(data);

  AST_LIST_LOCK(&queues);
  AST_LIST_TRAVERSE(&queues, q, list) {
    if (!strcasecmp(q->name, data)) {
      ast_mutex_lock(&q->lock);
      break;
    }
  }
  AST_LIST_UNLOCK(&queues);


Regards,
Atis


-- 
Atis Lezdins
VoIP Developer,
IQ Labs Inc.
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Work phone: +1 800 7502835



More information about the asterisk-dev mailing list