git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5072 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-05-02 23:32:45 +00:00
parent f8409fe0ac
commit e402c54c1e
4 changed files with 39 additions and 13 deletions
+5 -1
View File
@@ -1426,10 +1426,14 @@ sofia_profile_t *sofia_glue_find_profile(char *key)
switch_mutex_lock(mod_sofia_globals.hash_mutex);
if ((profile = (sofia_profile_t *) switch_core_hash_find(mod_sofia_globals.profile_hash, key))) {
if (!sofia_test_pflag(profile, PFLAG_RUNNING)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile %s is not running\n", profile->name);
profile = NULL;
} else if (switch_thread_rwlock_tryrdlock(profile->rwlock) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile %s is locked\n", profile->name);
profile = NULL;
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Profile %s is not in the hash\n", profile->name);
}
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
@@ -1545,7 +1549,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
}
#endif
return 1;
return profile->master_odbc ? 1 : 0;
}
void sofia_glue_sql_close(sofia_profile_t *profile)