]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ensure we don't pickup ourselves when doing pickup by exten.
authorMatthew Nicholson <mnicholson@digium.com>
Mon, 14 Sep 2009 14:53:57 +0000 (14:53 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Mon, 14 Sep 2009 14:53:57 +0000 (14:53 +0000)
(closes issue #15100)
Reported by: lmsteffan
Patches:
      (modified) pickup.patch uploaded by lmsteffan (license 779)

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

apps/app_directed_pickup.c

index 68d9652444f1be05a10254a65e5922bb9f5a7045..d591ca18003a17e2d2ed20a7053cafabd54a9b62 100644 (file)
@@ -98,7 +98,7 @@ static int pickup_by_exten(struct ast_channel *chan, char *exten, char *context)
        while ((target = ast_channel_walk_locked(target))) {
                if ((!strcasecmp(target->macroexten, exten) || !strcasecmp(target->exten, exten)) &&
                    !strcasecmp(target->dialcontext, context) &&
-                   can_pickup(target)) {
+                   (chan != target) && can_pickup(target)) {
                        res = pickup_do(chan, target);
                        ast_channel_unlock(target);
                        break;