/* Set our last_pos indicators */
qe->last_pos = now;
qe->last_pos_said = qe->pos;
- ast_moh_start(qe->chan, qe->moh);
+ /* Don't restart music on hold if we're about to exit the caller from the queue */
+ if (res)
+ ast_moh_start(qe->chan, qe->moh);
return res;
}
/* Make a position announcement, if enabled */
if (qe.parent->announcefrequency && !ringing)
res = say_position(&qe);
- if (res && valid_exit(&qe, res)) {
+ if (res) {
ast_queue_log(queuename, chan->uniqueid, "NONE", "EXITWITHKEY", "%s|%d", qe.digits, qe.pos);
break;
}
}
ast_mutex_unlock(&q->lock);
}
- ast_mutex_unlock(&qlock);
ast_cli(s->fd,
"Event: QueueStatusComplete\r\n"
"%s"
"\r\n",idText);
+ ast_mutex_unlock(&qlock);
return RESULT_SUCCESS;
}