app_queue: Update lastpause on realtime pause transition

Realtime queue members used lastpause to determine whether a member
had transitioned from unpaused to paused. However, lastpause also
stores the timestamp of the member's most recent pause and should not
be cleared when the member is unpaused.

Compare the existing paused state with the new realtime value instead,
and update lastpause only when the member transitions from unpaused to
paused.

Resolves: #1760
22
seifzadeh 2 months ago
parent e80ed05877
commit 437085acc0

@ -3869,10 +3869,10 @@ static void rt_handle_member_record(struct call_queue *q, char *category, struct
m->dead = 0; /* Do not delete this one. */
ast_copy_string(m->rt_uniqueid, rt_uniqueid, sizeof(m->rt_uniqueid));
if (paused_str) {
m->paused = paused;
if (paused && m->lastpause == 0) {
if (paused && !m->paused) {
time(&m->lastpause); /* XXX: Should this come from realtime? */
}
m->paused = paused;
ast_devstate_changed(m->paused ? QUEUE_PAUSED_DEVSTATE : QUEUE_UNPAUSED_DEVSTATE,
AST_DEVSTATE_CACHABLE, "Queue:%s_pause_%s", q->name, m->interface);
}

Loading…
Cancel
Save