]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't try to pickup a call in the middle of a masquerade
authorTerry Wilson <twilson@digium.com>
Mon, 7 Feb 2011 22:35:20 +0000 (22:35 +0000)
committerTerry Wilson <twilson@digium.com>
Mon, 7 Feb 2011 22:35:20 +0000 (22:35 +0000)
If A calls B which doesn't answer and C & D both try to do a call pickup, it is
possible for ast_pickup_call to answer the call, then fail to masquerade one of
the calls because the other one is already in the process of masquerading. This
patch checks to see if the channel is in the process of masquerading before
call before selecting it for a pickup.

Review: https://reviewboard.asterisk.org/r/1094/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@306672 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_features.c

index 76fcec2afa9544b19a0db2ca1ddf05bbe58a429d..e7b5aed0ffa182d1371bac15566f8cc152ad5de6 100644 (file)
@@ -3288,7 +3288,8 @@ int ast_pickup_call(struct ast_channel *chan)
                        (cur != chan) &&
                        (chan->pickupgroup & cur->callgroup) &&
                        ((cur->_state == AST_STATE_RINGING) ||
-                        (cur->_state == AST_STATE_RING))) {
+                        (cur->_state == AST_STATE_RING)) &&
+                       !cur->masq) {
                                break;
                }
                ast_channel_unlock(cur);