[Asterisk-cvs] asterisk/res res_agi.c,1.34,1.35

kpfleming at lists.digium.com kpfleming at lists.digium.com
Wed May 18 22:52:41 CDT 2005


Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/tmp/cvs-serv9583/res

Modified Files:
	res_agi.c 
Log Message:
support labels as targets of SET PRIORITY command (bug #4057)


Index: res_agi.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_agi.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- res_agi.c	27 Apr 2005 01:42:33 -0000	1.34
+++ res_agi.c	19 May 2005 02:57:45 -0000	1.35
@@ -756,9 +756,13 @@
 	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 @@
 "	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"




More information about the svn-commits mailing list