add sofia global standby on that makes sofia not do anything but refuse to work until sofia global standby off or sofia recover is issued

This commit is contained in:
Anthony Minessale committed 2011-12-16 13:41:25 -06:00
1 parent 10dfc37770
commit 6dd5e59b05
4 files changed
+73 -4

No files matched your search

+26
View File
@@ -5312,6 +5312,30 @@ void sofia_glue_global_siptrace(switch_bool_t on)
}
void sofia_glue_global_standby(switch_bool_t on)
{
switch_hash_index_t *hi;
const void *var;
void *val;
sofia_profile_t *pptr;
switch_mutex_lock(mod_sofia_globals.hash_mutex);
if (mod_sofia_globals.profile_hash) {
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &var, NULL, &val);
if ((pptr = (sofia_profile_t *) val)) {
if (on) {
sofia_set_pflag_locked(pptr, PFLAG_STANDBY);
} else {
sofia_clear_pflag_locked(pptr, PFLAG_STANDBY);
}
}
}
}
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
}
void sofia_glue_global_capture(switch_bool_t on)
{
switch_hash_index_t *hi;
@@ -5674,6 +5698,8 @@ int sofia_glue_recover(switch_bool_t flush)
h.profile = profile;
h.total = 0;
sofia_clear_pflag_locked(profile, PFLAG_STANDBY);
if (flush) {
sql = switch_mprintf("delete from sip_recovery where profile_name='%q'", profile->name);
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);