]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix handling of the 'state_interface' option of the 'queue add member' CLI
authorSean Bright <sean@malleable.com>
Wed, 27 May 2009 13:54:35 +0000 (13:54 +0000)
committerSean Bright <sean@malleable.com>
Wed, 27 May 2009 13:54:35 +0000 (13:54 +0000)
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

apps/app_queue.c

index 3660573266e7116ca7f2cfc6b9a0dfd801607b18..6cbba3103fd65596c3b2cca62901cee44e93f695 100644 (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;
        int penalty;
 
-       if ((argc != 6) && (argc != 8) && (argc != 10)) {
+       if ((argc != 6) && (argc != 8) && (argc != 10) && (argc != 12)) {
                return RESULT_SHOWUSAGE;
        } else if (strcmp(argv[4], "to")) {
                return RESULT_SHOWUSAGE;
@@ -4958,6 +4958,8 @@ static int handle_queue_add_member(int fd, int argc, char *argv[])
                return RESULT_SHOWUSAGE;
        } else if ((argc == 10) && strcmp(argv[8], "as")) {
                return RESULT_SHOWUSAGE;
+       } else if ((argc == 12) && strcmp(argv[10], "state_interface")) {
+               return RESULT_SHOWUSAGE;
        }
 
        queuename = argv[5];