[asterisk-dev] modification for QUEUE_WAITING_COUNT

Clod Patry cpatry at gmail.com
Tue Sep 13 23:05:43 CDT 2011


hi,

I've an application using the AMI, and that app is calling Getvar with
Variable: QUEUE_WAITING_COUNT(queue_foo).
I can see:


[Sep 13 23:56:03] WARNING[28779]: app_queue.c:4316
queue_function_queuewaitingcount: queue 'queue_foo' was not found
in the CLI (which is not really useful with the AMI)

But, the AMI is returning:
Response: Success
Variable: QUEUE_WAITING_COUNT('queue_foo')
Value: 0

which makes sense so far.

But why queue_function_queuewaitingcount (from app_queue.c) is returning 0
if the queue_foo doesnt exist.

Does that makes sense to set the count, by default at -1 instead of 0 and in
case the queue exists, that will be set to:
count = q->count;
Like we can see in app_queue.c

By changing that behavior, that will be much easy for error management:
-1 : error (queue was not found)
0: there's really 0 customers waiting in the queue
>0: x customers are waiting in the queue.


Does that make sense?
If it's approve, i'll supply the patch for this.





-- 
Clod Patry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110914/bfb7e680/attachment.htm>


More information about the asterisk-dev mailing list