# Agents logged in in multiple queues.Ring Strategy

**URL:** <https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882>\
**Category:** Asterisk Support\
**Created:** [September 30, 2020, 6:16pm UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882 "2020-09-30T18:16:16Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarodriguez](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@jarodriguez](https://community.asterisk.org/u/jarodriguez)\
**Post date:** [September 30, 2020, 6:16pm UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/1 "2020-09-30T18:16:16Z")

</div>

I have Asterisk 11 and I have 95 different queues configured (for 95 different incoming numbers). Each queue has about 10 dynamic agents logged in.  
Within each queue I can configure a ring strategy, but it only affects a particular queue. For example, if I configure “rmmemory”, the call takes into account how much time has passed since the last answered call for each agent … but of course, just look at that queue, if the agent has answered other calls from other queues it does not have it consider…  
I don’t know if I explain myself …

Is it possible to establish a general ring strategy for the 95 queues, which sees them all as “a single queue”?

Thanks!!

---

<div class="post-metadata">

**Author:** ![vijo.jose](https://avatars.discourse-cdn.com/v4/letter/v/9fc29f/32.png) [@vijo.jose](https://community.asterisk.org/u/vijo.jose)\
**Post date:** [October 1, 2020, 9:21am UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/2 "2020-10-01T09:21:09Z")

</div>

@jarodriguez : Kindly refer the [https://wiki.asterisk.org/wiki/display/AST/Building+Queues](https://wiki.asterisk.org/wiki/display/AST/Building+Queues) .

---

<div class="post-metadata">

**Author:** ![a4business](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/a4business/32/4701_2.png) [@a4business](https://community.asterisk.org/u/a4business)\
**Post date:** [October 1, 2020, 9:40am UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/3 "2020-10-01T09:40:07Z")

</div>

You also can try options for agent SIP :

callcounter=yes  
busylevel=1

> **[chan\_sip State and Presence Options - Asterisk Project - Asterisk Project Wiki](https://wiki.asterisk.org/wiki/display/AST/chan_sip+State+and+Presence+Options)**

or implement queue auto-pause trigger for required period after the call completed

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [October 1, 2020, 9:55am UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/4 "2020-10-01T09:55:45Z")

</div>

```auto
; shared_lastcall will make the lastcall and calls received be the same in
; members logged in more than one queue. This is useful to make the queue
; respect the wrapuptime of another queue for a shared member.
; The default value is no.
;
;shared_lastcall=yes

```

> <https://github.com/asterisk/asterisk/blob/master/configs/samples/queues.conf.sample#L57>

---

<div class="post-metadata">

**Author:** ![jarodriguez](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@jarodriguez](https://community.asterisk.org/u/jarodriguez)\
**Post date:** [October 1, 2020, 10:13am UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/5 "2020-10-01T10:13:24Z")

</div>

> [@a4business](#):
>
> callcounter

vijo.jose and a4business, Thanks for the comments … but what you write has nothing to do with the problem I am exposing.  
I return to the problem: "Asterisk’s ring strategy seems to only affect the queue level. Therefore, if you have agents who are logged in in several queues, there is no way to propose a ring strategy that affects equally all agents ?, regardless of the queues they belong to.

David551, I already have that parameter set:  
"  
persistentmembers=yes  
shared\_lastcall=yes  
updatecdr=yes  
monitor-type=MixMonitor  
"

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [October 1, 2020, 10:39am UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/6 "2020-10-01T10:39:41Z")

</div>

As far as I know, only the leastrecent strategy uses last call information, and is therefore affected by shared\_lastcall.

---

<div class="post-metadata">

**Author:** ![jarodriguez](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@jarodriguez](https://community.asterisk.org/u/jarodriguez)\
**Post date:** [October 1, 2020, 11:10am UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/7 "2020-10-01T11:10:41Z")

</div>

Thanks David  
That is, Asterisk recognizes that “agent 1” is that it has answered the last call in queue 1 (for example), and if a call comes in queue 2 (which is also “agent 1”) will forward the call to a different agent. is that so?

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [October 1, 2020, 11:38am UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/8 "2020-10-01T11:38:43Z")

</div>

I think it uses the time the agent finishes with the call, rather than the time the call is answered.

---

<div class="post-metadata">

**Author:** ![jarodriguez](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@jarodriguez](https://community.asterisk.org/u/jarodriguez)\
**Post date:** [October 1, 2020, 11:58am UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/9 "2020-10-01T11:58:07Z")

</div>

David,

I think this you say is not going to work with multiple queues…

Looking at the documentation, asterisk indicates:  
“ **leastrecent** : ring interface which was least recently called by this queue”  
Then, “…by this queue”, this means that it does not take into account the time since the last call between different queues, which is what I need.

---

<div class="post-metadata">

**Author:** ![a4business](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/a4business/32/4701_2.png) [@a4business](https://community.asterisk.org/u/a4business)\
**Post date:** [October 1, 2020, 12:06pm UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/10 "2020-10-01T12:06:59Z")

</div>

callcounters=yes  
even if you say its not related, you may check at least … do you have this option set tp yes?

not sure exactly, but according to this post, that option prevents of wrapuptime to be working:

> [@WrapUp Time is not working any more](https://community.asterisk.org/t/wrapup-time-is-not-working-any-more/80472):
>
> Hi guys, I need some help here. Wrap up time just stop working. It was working fine but not any more. I can’t figure out why! I saw many post about it, but nothing like this. Queues are very easy to configure. Maybe you can give me some help. Thanks in advance! [201] announce-frequency=0 announce-holdtime=no announce-position=no autofill=no autopause=no autopausebusy=no autopausedelay=0 autopauseunavail=no eventmemberstatus=yes eventwhencalled=yes joinempty=yes leavewhenempty=no maxlen=20 me…

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [October 1, 2020, 1:04pm UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/11 "2020-10-01T13:04:11Z")

</div>

> [@jarodriguez](#):
>
> “ **leastrecent** : ring interface which was least recently called by this queue”

shared\_lastcall modifes that. Specifically, when setting the last call time, it trawls all the queues for the same interface, and sets the last call time for that interface in every queue, so when the queue comes to schedule an agent, the sort order of the interfaces is global, not local.

```auto
	if (shared_lastcall) {
		queue_iter = ao2_iterator_init(queues, 0);
		while ((qtmp = ao2_t_iterator_next(&queue_iter, "Iterate through queues"))) {
			ao2_lock(qtmp);
			if ((mem = ao2_find(qtmp->members, member, OBJ_POINTER))) {
				time(&mem->lastcall);
				mem->calls++;
				mem->callcompletedinsl = 0;
				mem->starttime = 0;
				mem->lastqueue = q;
				ao2_ref(mem, -1);
			}
			ao2_unlock(qtmp);
			queue_t_unref(qtmp, "Done with iterator");
		}
		ao2_iterator_destroy(&queue_iter);

```

---

<div class="post-metadata">

**Author:** ![jarodriguez](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@jarodriguez](https://community.asterisk.org/u/jarodriguez)\
**Post date:** [October 1, 2020, 3:34pm UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/12 "2020-10-01T15:34:42Z")

</div>

David

You’re right. It works correctly as you say.

Thank you very much!!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [October 31, 2020, 3:34pm UTC](https://community.asterisk.org/t/agents-logged-in-in-multiple-queues-ring-strategy/85882/13 "2020-10-31T15:34:53Z")

</div>

Closed on October 31, 2020, 3:34pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
