Merge "astobj2: Create function to copy weak proxied objects from container."
[asterisk/asterisk.git] / apps / app_meetme.c
index 634eac8..6984bd2 100644 (file)
                                <parameter name="Meetme">
                                        <para>The identifier for the MeetMe conference.</para>
                                </parameter>
-                               <parameter name="Usernum">
+                               <parameter name="User">
                                        <para>The identifier of the MeetMe user who joined.</para>
                                </parameter>
                                <channel_snapshot/>
@@ -1624,8 +1624,14 @@ static struct ast_conference *build_conf(const char *confno, const char *pin,
 
        ast_format_cap_append(cap_slin, ast_format_slin, 0);
        /* Make a new one */
-       if (!(cnf = ast_calloc(1, sizeof(*cnf))) ||
-               !(cnf->usercontainer = ao2_container_alloc(1, NULL, user_no_cmp))) {
+       cnf = ast_calloc(1, sizeof(*cnf));
+       if (!cnf) {
+               goto cnfout;
+       }
+
+       cnf->usercontainer = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_MUTEX, 0,
+               NULL, user_no_cmp);
+       if (!cnf->usercontainer) {
                goto cnfout;
        }
 
@@ -3588,7 +3594,7 @@ static int conf_run(struct ast_channel *chan, struct ast_conference *conf, struc
        }
 
        /* Reduce background noise from each participant */
-       if (!ast_test_flag64(confflags, CONFFLAG_DONT_DENOISE) && ast_module_check("func_speex.so")) {
+       if (!ast_test_flag64(confflags, CONFFLAG_DONT_DENOISE)) {
                ast_func_write(chan, "DENOISE(rx)", "on");
        }
 
@@ -7395,13 +7401,6 @@ static void sla_station_destructor(void *obj)
        ast_string_field_free_memory(station);
 }
 
-static int sla_trunk_hash(const void *obj, const int flags)
-{
-       const struct sla_trunk *trunk = obj;
-
-       return ast_str_case_hash(trunk->name);
-}
-
 static int sla_trunk_cmp(void *obj, void *arg, int flags)
 {
        struct sla_trunk *trunk = obj, *trunk2 = arg;
@@ -7409,13 +7408,6 @@ static int sla_trunk_cmp(void *obj, void *arg, int flags)
        return !strcasecmp(trunk->name, trunk2->name) ? CMP_MATCH | CMP_STOP : 0;
 }
 
-static int sla_station_hash(const void *obj, const int flags)
-{
-       const struct sla_station *station = obj;
-
-       return ast_str_case_hash(station->name);
-}
-
 static int sla_station_cmp(void *obj, void *arg, int flags)
 {
        struct sla_station *station = obj, *station2 = arg;
@@ -7869,8 +7861,10 @@ static int sla_load_config(int reload)
        if (!reload) {
                ast_mutex_init(&sla.lock);
                ast_cond_init(&sla.cond, NULL);
-               sla_trunks = ao2_container_alloc(1, sla_trunk_hash, sla_trunk_cmp);
-               sla_stations = ao2_container_alloc(1, sla_station_hash, sla_station_cmp);
+               sla_trunks = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_MUTEX, 0,
+                       NULL, sla_trunk_cmp);
+               sla_stations = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_MUTEX, 0,
+                       NULL, sla_station_cmp);
        }
 
        if (!(cfg = ast_config_load(SLA_CONFIG_FILE, config_flags))) {
@@ -8085,4 +8079,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "MeetMe conference bri
        .unload = unload_module,
        .reload = reload,
        .load_pri = AST_MODPRI_DEVSTATE_PROVIDER,
+       .optional_modules = "func_speex",
 );