Index: res/res_agi.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_agi.c,v retrieving revision 1.32 diff -u -u -r1.32 res_agi.c --- res/res_agi.c 11 Apr 2005 03:23:54 -0000 1.32 +++ res/res_agi.c 21 Apr 2005 00:07:52 -0000 @@ -756,9 +756,11 @@ int pri; if (argc != 3) return RESULT_SHOWUSAGE; - if (sscanf(argv[2], "%i", &pri) != 1) - return RESULT_SHOWUSAGE; - chan->priority = pri - 1; + if (sscanf(argv[2], "%i", &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, "", "", pri - 1); fdprintf(agi->fd, "200 result=0\n"); return RESULT_SUCCESS; } @@ -1458,8 +1460,9 @@ " Changes the extension for continuation upon exiting the application.\n"; static char usage_setpriority[] = -" Usage: SET PRIORITY \n" -" Changes the priority for continuation upon exiting the application.\n"; +" Usage: SET 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 \\\n"