ensure that app_queue won't crash if no members are defined via Realtime (issue ...
authorKevin P. Fleming <kpfleming@digium.com>
Thu, 29 Sep 2005 04:12:08 +0000 (04:12 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Thu, 29 Sep 2005 04:12:08 +0000 (04:12 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6693 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 626c7ca..27a4662 100755 (executable)
@@ -874,6 +874,11 @@ static int join_queue(char *queuename, struct queue_ent *qe, enum queue_result *
        queue_vars = ast_load_realtime("queues", "name", queuename, NULL);
        if(queue_vars)
                member_config = ast_load_realtime_multientry("queue_members", "interface LIKE", "%", "queue_name", queuename, NULL);
        queue_vars = ast_load_realtime("queues", "name", queuename, NULL);
        if(queue_vars)
                member_config = ast_load_realtime_multientry("queue_members", "interface LIKE", "%", "queue_name", queuename, NULL);
+       
+       if (!member_config) {
+               ast_log(LOG_ERROR, "no queue_members defined in your config (extconfig.conf).\n");
+               return res;
+       }
 
        ast_mutex_lock(&qlock);
        q = reload_queue_rt(queuename, queue_vars, member_config);
 
        ast_mutex_lock(&qlock);
        q = reload_queue_rt(queuename, queue_vars, member_config);