Fix handling of the 'state_interface' option of the 'queue add member' CLI

command.

This change relates to r184980, which was a backport of the state interface
changes to app_queue from trunk.  trunk and all of the 1.6.x branches are not
affected.

'queue add member' allows for specifying an interface to use for device state
when adding a queue member via CLI, but the validation code was not properly
updated to reflect this optional argument.

(closes issue #15198)
Reported by: loloski
Patches:
      05272009_app_queue.diff uploaded by seanbright (license 71)
Tested by: loloski


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@197024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Sean Bright
2009-05-27 13:54:35 +00:00
parent 245950ad00
commit a2fd7f4e47

View File

@@ -4950,7 +4950,7 @@ static int handle_queue_add_member(int fd, int argc, char *argv[])
char *queuename, *interface, *membername = NULL, *state_interface = NULL; char *queuename, *interface, *membername = NULL, *state_interface = NULL;
int penalty; int penalty;
if ((argc != 6) && (argc != 8) && (argc != 10)) { if ((argc != 6) && (argc != 8) && (argc != 10) && (argc != 12)) {
return RESULT_SHOWUSAGE; return RESULT_SHOWUSAGE;
} else if (strcmp(argv[4], "to")) { } else if (strcmp(argv[4], "to")) {
return RESULT_SHOWUSAGE; return RESULT_SHOWUSAGE;
@@ -4958,6 +4958,8 @@ static int handle_queue_add_member(int fd, int argc, char *argv[])
return RESULT_SHOWUSAGE; return RESULT_SHOWUSAGE;
} else if ((argc == 10) && strcmp(argv[8], "as")) { } else if ((argc == 10) && strcmp(argv[8], "as")) {
return RESULT_SHOWUSAGE; return RESULT_SHOWUSAGE;
} else if ((argc == 12) && strcmp(argv[10], "state_interface")) {
return RESULT_SHOWUSAGE;
} }
queuename = argv[5]; queuename = argv[5];