How to get queue hold time information

I need to know which variable provides me the average queue waiting time.
I took a read at voip-info site and found the QUEUEHOLDTIME variable.

I tried to use that but it returns me only the 0 or -1 values, and I must have the average queue hold TIME, cos I need to write a context to redirect the calls if the queue hold time is superior to 15 minutes.
How can a I this?

I’m using asterisk

Sorry about my English.

QUEUEHOLDTIME is correct. It is not set unless you enable it, with setqueuevar in queues.conf, or force it with the “function” QUEUEVARIABLES.

Whether it is useful might be a different question. It is only updated when calls are answered, and is an exponential average, so will lag.

david55, can you help me one more time and put an example ?