mod_sofia: Correct a problem where restarting profile would cause some profile…

mod_sofia: Correct a problem where restarting profile would cause some profile hash entry to remain.
上级 dc35bb96
...@@ -5210,12 +5210,14 @@ void sofia_glue_del_profile(sofia_profile_t *profile) ...@@ -5210,12 +5210,14 @@ void sofia_glue_del_profile(sofia_profile_t *profile)
} }
for (gp = profile->gateways; gp; gp = gp->next) { for (gp = profile->gateways; gp; gp = gp->next) {
char *pkey = switch_mprintf("%s::%s", profile->name, gp->name);
switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->name); switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->name);
switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->register_from); switch_core_hash_delete(mod_sofia_globals.gateway_hash, pkey);
switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->register_contact); switch_safe_free(pkey);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "deleted gateway %s\n", gp->name); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "deleted gateway %s from profile %s\n", gp->name, profile->name);
profile->gateways = NULL;
} }
profile->gateways = NULL;
} }
switch_mutex_unlock(mod_sofia_globals.hash_mutex); switch_mutex_unlock(mod_sofia_globals.hash_mutex);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论