]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
sleep when loading odbc profiles to prevent connection races in underlying libs
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 7 May 2009 15:14:28 +0000 (15:14 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 7 May 2009 15:14:28 +0000 (15:14 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13251 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index a5cf709dc3fd233c719580896fbf1780dc387568..1407e286575667dffc365554f1e1184cd9cf4622 100644 (file)
@@ -2664,8 +2664,13 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                }
 
                                if (profile->sipip) {
-                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Started Profile %s [%s]\n", profile->name, url);
                                        launch_sofia_profile_thread(profile);
+                                       if (profile->odbc_dsn) {
+                                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Connecting ODBC Profile %s [%s]\n", profile->name, url);
+                                               switch_yield(1000000);
+                                       } else {
+                                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Started Profile %s [%s]\n", profile->name, url);
+                                       }
                                } else {
                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Unable to start Profile %s due to no configured sip-ip\n", profile->name);
                                }