aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_directed_pickup.c
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-09-14 15:20:40 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-09-14 15:20:40 +0000
commit439f4d1be50af3726a02270d460817444b915be6 (patch)
tree9436266c08c3c71da455142e3dcb8560c9ab0e96 /apps/app_directed_pickup.c
parent0c0108543ef59068bd9b9efabc78e92b7178e75a (diff)
Merged revisions 218224 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r218224 | mnicholson | 2009-09-14 09:57:23 -0500 (Mon, 14 Sep 2009) | 14 lines Merged revisions 218223 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r218223 | mnicholson | 2009-09-14 09:53:57 -0500 (Mon, 14 Sep 2009) | 8 lines Ensure we don't pickup ourselves when doing pickup by exten. (closes issue #15100) Reported by: lmsteffan Patches: (modified) pickup.patch uploaded by lmsteffan (license 779) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@218238 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_directed_pickup.c')
-rw-r--r--apps/app_directed_pickup.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_directed_pickup.c b/apps/app_directed_pickup.c
index 605d11faf..c409a245b 100644
--- a/apps/app_directed_pickup.c
+++ b/apps/app_directed_pickup.c
@@ -172,6 +172,7 @@ static int pickup_by_channel(struct ast_channel *chan, char *pickup)
struct pickup_criteria {
const char *exten;
const char *context;
+ struct ast_channel *chan;
};
static int find_by_exten(struct ast_channel *c, void *data)
@@ -180,7 +181,7 @@ static int find_by_exten(struct ast_channel *c, void *data)
return (!strcasecmp(c->macroexten, info->exten) || !strcasecmp(c->exten, info->exten)) &&
!strcasecmp(c->dialcontext, info->context) &&
- can_pickup(c);
+ (info->chan != c) && can_pickup(c);
}
/* Attempt to pick up specified extension with context */
@@ -190,6 +191,7 @@ static int pickup_by_exten(struct ast_channel *chan, const char *exten, const ch
struct pickup_criteria search = {
.exten = exten,
.context = context,
+ .chan = chan,
};
target = ast_channel_search_locked(find_by_exten, &search);