Merge the adaptive realtime branch, which will make adding new required fields
[asterisk/asterisk.git] / apps / app_meetme.c
index 08e2fb5..14ba77b 100644 (file)
@@ -1743,6 +1743,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int c
        if (rt_log_members) {
                /* Update table */
                snprintf(members, sizeof(members), "%d", conf->users);
+               ast_realtime_require_field("meetme", "confno", RQ_INTEGER, strlen(conf->confno), "members", RQ_INTEGER, strlen(members), NULL);
                ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
        }
        setusercount = 1;
@@ -2682,6 +2683,7 @@ bailoutandtrynormal:
                        if (rt_log_members) {
                                /* Update table */
                                snprintf(members, sizeof(members), "%d", conf->users);
+                               ast_realtime_require_field("meetme", "confno", RQ_INTEGER, strlen(conf->confno), "members", RQ_INTEGER, strlen(members), NULL);
                                ast_update_realtime("meetme", "confno", conf->confno, "members", members, NULL);
                        }
                        if (confflags & CONFFLAG_MARKEDUSER) 
@@ -5677,6 +5679,7 @@ static int unload_module(void)
        sla_destroy();
        
        res |= ast_custom_function_unregister(&meetme_info_acf);
+       ast_unload_realtime("meetme");
 
        return res;
 }
@@ -5707,12 +5710,14 @@ static int load_module(void)
        res |= ast_devstate_prov_add("SLA", sla_state);
 
        res |= ast_custom_function_register(&meetme_info_acf);
+       ast_realtime_require_field("meetme", "confno", RQ_INTEGER, 3, "members", RQ_INTEGER, 3, NULL);
 
        return res;
 }
 
 static int reload(void)
 {
+       ast_unload_realtime("meetme");
        return load_config(1);
 }