Summary:ASTERISK-09491: [patch] Wrapuptime persistent in a multiple queues with shared members enviroment.
Reporter:Eliel Sardanons (eliel)Labels:
Date Opened:2007-05-22 13:28:20Date Closed:2007-10-24 16:24:56
Versions:Frequency of
Environment:Attachments:( 0) app_queue.c.patch
( 1) app_queue.c.patch.r83986
( 2) app_queue.c.patch.r84015
( 3) app_queue.c.trunk.patch
Description:Suppose we have a member (tom) logged in more than one queue (queue1 and queue2).
tom received a call from queue1 with wrapuptime (5 minutes).
This is because tom needs 5 minutes of work before receiving the next call, but after a minute tom receives another call from queue2 because queue2 knows nothing about queue1 wrapuptime (lastcall time).
To solve this issue we implement a feature called shared_lastcall, and we copy the lastcall timer to all the members (with the same interface) on the other queues.
This can be enabled by configuration:

shared_lastcall = yes|no

With this option enabled (not by default), queue2 will wait until queue1 wrapuptime expires.
Comments:By: Eliel Sardanons (eliel) 2007-05-24 13:13:26

Do you need some testers for this new feature?

By: Tomas Peralta (tomas) 2007-05-24 16:36:19

Eliel, as you suggested me in IRC, I add a note about my testing.

I have been using this patch since Tuesday in my lab and works as expected, without problems in any sense. Also, I made tests with sipp as UAC to simulate a real enviroment and everything looks fine.
I'm going to deploy this patch in a production call center in two weeks.

By: Eliel Sardanons (eliel) 2007-06-27 20:53:06


By: Eliel Sardanons (eliel) 2007-08-06 13:08:34

Is any possibility of this patch to be commited on trunk? If so, I could update this to the latest trunk.

Thanks in advanced.

By: BJ Weschke (bweschke) 2007-08-24 14:18:16

eliel - this is a cool feature and great to hear it's testing out well! can you guys please bring this up to date with trunk and I'll work to get it in? I'm sorry I didn't find it sooner to get it in before the patch got stale.

By: jmls (jmls) 2007-09-12 16:42:36

eliel, were you able to supply a patch to the latest trunk ? Thanks

By: Eliel Sardanons (eliel) 2007-09-12 16:52:35

jmls, I have the patch, but i'm testing it, I will supply it on three days.

By: Eliel Sardanons (eliel) 2007-09-12 17:50:34

Ok, here you are... uploaded patch agains trunk (rev 82304).
Please review the way I use the iterator (is the first time I used it).

By: Eliel Sardanons (eliel) 2007-09-12 17:51:08

the ao2_iterator_init

By: Eliel Sardanons (eliel) 2007-09-14 10:07:10

I took the time to test the new patch and it seems to be working fine.

By: Eliel Sardanons (eliel) 2007-09-17 12:57:19

Do you need something else bweschke?

By: Eliel Sardanons (eliel) 2007-09-26 20:57:37

Added app_queue.c.patch.r83986 against trunk 83986
This version uses astobj2 while trying to find a member and while traversing the queues list and makes the compare function of the object container member to use strcasecmp instead of strcmp.

By: Eliel Sardanons (eliel) 2007-09-27 08:48:51

This patch fixed a problem while trying to find members in other queues:
SIP/eliel is the same as sip/eliel (case insensitive). Like while doing a compare_weight()

By: Eliel Sardanons (eliel) 2007-09-27 09:14:17

Added app_queue.c.patch.r84015 with a minor fix (ao2_ref(mem, -1)).

By: Eliel Sardanons (eliel) 2007-10-01 08:36:41

ping bweschke.
Please notice that ao2_find for members is using a case sensitive compare and should be case insensitive (this is because sip/eliel is the same as SIP/eliel), I think at least that minor change should be commited.

@@ -785,7 +790,7 @@
static int member_cmp_fn(void *obj1, void *obj2, int flags)
struct member *mem1 = obj1, *mem2 = obj2;
- return strcmp(mem1->interface, mem2->interface) ? 0 : CMP_MATCH;
+ return strcasecmp(mem1->interface, mem2->interface) ? 0 : CMP_MATCH;

static void init_queue(struct call_queue *q)

By: Mark Michelson (mmichelson) 2007-10-11 18:16:52

I'm just giving a heads up to say that I tested this and it is working as expected!

I've reviewed the code, too, and it seems fine by me. I'll leave this issue open a bit longer in case anyone tries it and finds any problems. If no problems are reported, I'll commit this next week.

By: Eliel Sardanons (eliel) 2007-10-16 10:57:36

Thanks putnopvut, we have been using this patch in a production enviroment since it was uploaded here.

By: Ronald Chan (loloski) 2007-10-16 11:00:43

This patch works for me too about a 3 days now, so far so good....

By: Ronald Chan (loloski) 2007-10-16 11:01:56

but of course on a non-production system since this is from trunk and i haven't verified this if this also applies to SVN 1.4 branch

By: Eliel Sardanons (eliel) 2007-10-19 15:56:22

ping, any news about commiting this patch?

By: Mark Michelson (mmichelson) 2007-10-19 16:00:19

The plan was to commit this along with some other queue patches from the tracker today, but unfortunately I got busy with other things. I may end up committing them from home this evening, but I can't guarantee it. What I will guarantee is that these will go in next week at the latest.

By: Eliel Sardanons (eliel) 2007-10-19 16:04:41

Thanks in advance

By: Digium Subversion (svnbot) 2007-10-24 16:24:56

Repository: asterisk
Revision: 86985

U   trunk/apps/app_queue.c
U   trunk/configs/queues.conf.sample

r86985 | mmichelson | 2007-10-24 16:24:55 -0500 (Wed, 24 Oct 2007) | 6 lines

Adding the general option "shared_lastcall" to queues so that a member's wrapuptime
may be used across multiple queues.

(closes issue ASTERISK-9491, reported and patched by eliel)