[Asterisk-Users] Avoiding queue retries without hangs?

Bruno Hertz brrhtz at yahoo.de
Fri Jan 28 09:21:29 MST 2005


On Thu, 2005-01-27 at 20:35 +0100, Bruno Hertz wrote:

> Anybody found a way around this (bug?), i.e. avoiding retries with
> Queue(...|t) properly timing out at the same time ?

OK, I took a look at app_queue.c, and while the described behavior isn't
a bug, I still hacked the source to give me a different retry semantics.

Specifically, if retry=0 the original strategy is to set it to a default
value of 5. My hack is to don't do any retries in this case anyway and
behave the same way as if the call timed out on the queue.

For those interested, the changes to app_queue.c are small:

in reload_queues

- if (q->retry < 1)
+ if ( (q->retry < 1) &&  (q->retry != 0) )
	q->retry = DEFAULT_RETRY;

in queue_exec

/* Leave if we have exceeded our queuetimeout */
if (qe.queuetimeout && ( (time(NULL) - qe.start) >= qe.queuetimeout) ) {
	res = 0;
	break;
}

+ if ( (qe.parent)->retry == 0 ) {
+ 	res = 0;
+ 	break;
+ }

That's it. That way, no retries are attempted at all if retry=0, and
Queue times out if it does so on the queue members, i.e. according to
timeout in queue.conf. Tested though only with ringall, don't sure how
it works with other ringing strategies.

Thanks, Bruno.





More information about the asterisk-users mailing list