]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_ari: Fix inverted test giving wrong error message.
authorRichard Mudgett <rmudgett@digium.com>
Sun, 26 Nov 2017 15:44:51 +0000 (09:44 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Sun, 26 Nov 2017 15:51:42 +0000 (09:51 -0600)
The patch for ASTERISK_24560 inverted a test checking if the bridge name
is being updated to a different name.

* Fix the test to return "Changing bridge name is not implemented" when
someone attempts to change the bridge name.

ASTERISK-27445

Change-Id: I4b70bf08b0e02e016108b077ff75b345dec12fc9

res/ari/resource_bridges.c

index d6a0400c86e03faf6ccbee57234844f9186bbbe0..643cc30a22cf4960d3fa592082b023bcf7de46a9 100644 (file)
@@ -957,13 +957,12 @@ void ast_ari_bridges_create_with_id(struct ast_variable *headers,
 
        if (bridge) {
                /* update */
-               if (!ast_strlen_zero(args->name)) {
-                       if (!strcmp(args->name, bridge->name)) {
-                               ast_ari_response_error(
-                                       response, 500, "Internal Error",
-                                       "Changing bridge name is not implemented");
-                               return;
-                       }
+               if (!ast_strlen_zero(args->name)
+                       && strcmp(args->name, bridge->name)) {
+                       ast_ari_response_error(
+                               response, 500, "Internal Error",
+                               "Changing bridge name is not implemented");
+                       return;
                }
                if (!ast_strlen_zero(args->type)) {
                        ast_ari_response_error(