mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
* Put more information in pickup_exec() LOG_NOTICE.
* Delay duplicating a string on the stack in pickup_exec(). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -274,14 +274,16 @@ static int pickup_by_group(struct ast_channel *chan)
|
|||||||
/* application entry point for Pickup() */
|
/* application entry point for Pickup() */
|
||||||
static int pickup_exec(struct ast_channel *chan, const char *data)
|
static int pickup_exec(struct ast_channel *chan, const char *data)
|
||||||
{
|
{
|
||||||
char *tmp = ast_strdupa(data);
|
char *tmp;
|
||||||
char *exten = NULL, *context = NULL;
|
char *exten;
|
||||||
|
char *context;
|
||||||
|
|
||||||
if (ast_strlen_zero(data)) {
|
if (ast_strlen_zero(data)) {
|
||||||
return pickup_by_group(chan) ? 0 : -1;
|
return pickup_by_group(chan) ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse extension (and context if there) */
|
/* Parse extension (and context if there) */
|
||||||
|
tmp = ast_strdupa(data);
|
||||||
while (!ast_strlen_zero(tmp) && (exten = strsep(&tmp, "&"))) {
|
while (!ast_strlen_zero(tmp) && (exten = strsep(&tmp, "&"))) {
|
||||||
if ((context = strchr(exten, '@')))
|
if ((context = strchr(exten, '@')))
|
||||||
*context++ = '\0';
|
*context++ = '\0';
|
||||||
@@ -291,12 +293,15 @@ static int pickup_exec(struct ast_channel *chan, const char *data)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!pickup_by_exten(chan, exten, !ast_strlen_zero(context) ? context : ast_channel_context(chan))) {
|
if (ast_strlen_zero(context)) {
|
||||||
|
context = (char *) ast_channel_context(chan);
|
||||||
|
}
|
||||||
|
if (!pickup_by_exten(chan, exten, context)) {
|
||||||
/* Pickup successful. Stop the dialplan this channel is a zombie. */
|
/* Pickup successful. Stop the dialplan this channel is a zombie. */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast_log(LOG_NOTICE, "No target channel found for %s.\n", exten);
|
ast_log(LOG_NOTICE, "No target channel found for %s@%s.\n", exten, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pickup failed. Keep going in the dialplan. */
|
/* Pickup failed. Keep going in the dialplan. */
|
||||||
|
Reference in New Issue
Block a user