From 415082bc751e61045ed797d361c92df8b480e1db Mon Sep 17 00:00:00 2001 From: Automerge script Date: Thu, 30 Aug 2012 19:24:57 +0000 Subject: [PATCH] Merged revisions 372049 via svnmerge from file:///srv/subversion/repos/asterisk/branches/10 ................ r372049 | mmichelson | 2012-08-30 13:33:37 -0500 (Thu, 30 Aug 2012) | 16 lines Help prevent ringing queue members from being rung when ringinuse set to no. Queue member status would not always get updated properly when the member was called, thus resulting in the member getting multiple calls. With this change, we update the member's status at the time of calling, and we also check to make sure the member is still available to take the call before placing an outbound call. (closes issue ASTERISK-16115) reported by nik600 Patches: app_queue.c-svn-r370418.patch uploaded by Italo Rossi (license #6409) ........ Merged revisions 372048 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@372088 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_queue.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/app_queue.c b/apps/app_queue.c index 60be75e0ee..8668140290 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3223,10 +3223,19 @@ static int ring_entry(struct queue_ent *qe, struct callattempt *tmp, int *busies ast_channel_unlock(tmp->chan); ast_channel_unlock(qe->chan); - /* Place the call, but don't wait on the answer */ - if ((res = ast_call(tmp->chan, location, 0))) { + ao2_lock(tmp->member); + update_status(qe->parent, tmp->member, get_queue_member_status(tmp->member)); + if (!qe->parent->ringinuse && (tmp->member->status != AST_DEVICE_NOT_INUSE) && (tmp->member->status != AST_DEVICE_UNKNOWN)) { + ast_verb(1, "Member %s is busy, cannot dial", tmp->member->interface); + res = -1; + } + else { + /* Place the call, but don't wait on the answer */ + res = ast_call(tmp->chan, location, 0); + } + ao2_unlock(tmp->member); + if (res) { /* Again, keep going even if there's an error */ - ast_debug(1, "ast call on peer returned %d\n", res); ast_verb(3, "Couldn't call %s\n", tmp->interface); do_hang(tmp); (*busies)++;