diff options
Diffstat (limited to 'apps/app_directed_pickup.c')
-rw-r--r-- | apps/app_directed_pickup.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/apps/app_directed_pickup.c b/apps/app_directed_pickup.c index 9ae3fc842..6fcde0748 100644 --- a/apps/app_directed_pickup.c +++ b/apps/app_directed_pickup.c @@ -252,29 +252,13 @@ static int pickup_by_mark(struct ast_channel *chan, const char *mark) return res; } -static int find_channel_by_group(void *obj, void *arg, void *data, int flags) -{ - struct ast_channel *target = obj;/*!< Potential pickup target */ - struct ast_channel *chan = data;/*!< Channel wanting to pickup call */ - - ast_channel_lock(target); - if (chan != target && (ast_channel_pickupgroup(chan) & ast_channel_callgroup(target)) - && ast_can_pickup(target)) { - /* Return with the channel still locked on purpose */ - return CMP_MATCH | CMP_STOP; - } - ast_channel_unlock(target); - - return 0; -} - static int pickup_by_group(struct ast_channel *chan) { struct ast_channel *target;/*!< Potential pickup target */ int res = -1; /* The found channel is already locked. */ - target = ast_channel_callback(find_channel_by_group, NULL, chan, 0); + target = ast_pickup_find_by_group(chan); if (target) { ast_log(LOG_NOTICE, "pickup %s attempt by %s\n", ast_channel_name(target), ast_channel_name(chan)); res = ast_do_pickup(chan, target); |