]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5761 --resolve this solution is sufficient
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 16 Sep 2013 17:28:20 +0000 (22:28 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 16 Sep 2013 17:28:20 +0000 (22:28 +0500)
src/mod/applications/mod_spandsp/mod_spandsp_modem.c

index dec93970a04b2fc32bcb71009b97838b7f5d64da..3a84a451ded3ca3cbc163806ede9ef44ac9115f8 100644 (file)
@@ -47,7 +47,6 @@
 #define DEFAULT_FEC_SPAN            3
 
 static struct {
-       int NEXT_ID;
        int REF_COUNT;
        int THREADCOUNT;
        switch_memory_pool_t *pool;
@@ -223,8 +222,6 @@ switch_status_t modem_init(modem_t *modem, modem_control_handler_t control_handl
 #endif
        logging_state_t *logging;
 
-       memset(modem, 0, sizeof(*modem));
-
        modem->master = -1;
        modem->slave = -1;
 
@@ -298,8 +295,6 @@ switch_status_t modem_init(modem_t *modem, modem_control_handler_t control_handl
 #endif
 
 #ifndef WIN32
-       modem->slot = globals.NEXT_ID++;
-    
        snprintf(modem->devlink, sizeof(modem->devlink), "%s/FS%d", spandsp_globals.modem_directory, modem->slot);
        
        unlink(modem->devlink);
@@ -1351,11 +1346,12 @@ static void activate_modems(void)
        int x;
 
        switch_mutex_lock(globals.mutex);
-       memset(globals.MODEM_POOL, 0, MAX_MODEMS);
+       memset(globals.MODEM_POOL, 0, sizeof(globals.MODEM_POOL));
        for (x = 0; x < max; x++) {
 
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Starting Modem SLOT %d\n", x);
 
+               globals.MODEM_POOL[x].slot = x;
                launch_modem_thread(&globals.MODEM_POOL[x]);
        }
        switch_mutex_unlock(globals.mutex);