aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-19 02:57:45 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-05-19 02:57:45 +0000
commitaa026fc3e868aa7b7571946fea38b69d704c8feb (patch)
treed6a9c7474688fc733b0b01d7ad956577c7d44d83 /res/res_agi.c
parent815a2a9fc642a031fc87d2354ebc38122585e768 (diff)
support labels as targets of SET PRIORITY command (bug #4057)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5727 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_agi.c')
-rwxr-xr-xres/res_agi.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index b417dd8ca..7f58d6593 100755
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -756,9 +756,13 @@ static int handle_setpriority(struct ast_channel *chan, AGI *agi, int argc, char
int pri;
if (argc != 3)
return RESULT_SHOWUSAGE;
- if (sscanf(argv[2], "%d", &pri) != 1)
- return RESULT_SHOWUSAGE;
- chan->priority = pri - 1;
+
+ if (sscanf(argv[2], "%d", &pri) != 1) {
+ if ((pri = ast_findlabel_extension(chan, chan->context, chan->exten, argv[2], chan->cid.cid_num)) < 1)
+ return RESULT_SHOWUSAGE;
+ }
+
+ ast_explicit_goto(chan, NULL, NULL, pri);
fdprintf(agi->fd, "200 result=0\n");
return RESULT_SUCCESS;
}
@@ -1458,8 +1462,9 @@ static char usage_setextension[] =
" Changes the extension for continuation upon exiting the application.\n";
static char usage_setpriority[] =
-" Usage: SET PRIORITY <num>\n"
-" Changes the priority for continuation upon exiting the application.\n";
+" Usage: SET PRIORITY <priority>\n"
+" Changes the priority for continuation upon exiting the application.\n"
+" The priority must be a valid priority or label.\n";
static char usage_recordfile[] =
" Usage: RECORD FILE <filename> <format> <escape digits> <timeout> \\\n"