]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
ARI: Don't complain about missing ARI users when we aren't enabled
authorSean Bright <sean@malleable.com>
Tue, 25 Mar 2014 18:44:57 +0000 (18:44 +0000)
committerSean Bright <sean@malleable.com>
Tue, 25 Mar 2014 18:44:57 +0000 (18:44 +0000)
Currently, if ARI is not enabled it will still complain that there are no
configured users.  This patch checks to see if ARI is enabled before logging and
error or iterating the container to validate the users.

Review: https://reviewboard.asterisk.org/r/3391/
........

Merged revisions 411173 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411174 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/ari/config.c

index e25fa8ad1f362eb131365974f2811a18f9619193..59c4d7d9499c2a6a7e292a9b9bfad6b47ec6d37a 100644 (file)
@@ -290,12 +290,14 @@ static int process_config(int reload)
                return -1;
        }
 
-       if (ao2_container_count(conf->users) == 0) {
-               ast_log(LOG_ERROR, "No configured users for ARI\n");
+       if (conf->general->enabled) {
+               if (ao2_container_count(conf->users) == 0) {
+                       ast_log(LOG_ERROR, "No configured users for ARI\n");
+               } else {
+                       ao2_callback(conf->users, OBJ_NODATA, validate_user_cb, NULL);
+               }
        }
 
-       ao2_callback(conf->users, OBJ_NODATA, validate_user_cb, NULL);
-
        return 0;
 }