}
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->register_from);
- switch_core_hash_delete(mod_sofia_globals.gateway_hash, gp->register_contact);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "deleted gateway %s\n", gp->name);
- profile->gateways = NULL;
+ switch_core_hash_delete(mod_sofia_globals.gateway_hash, pkey);
+ switch_safe_free(pkey);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "deleted gateway %s from profile %s\n", gp->name, profile->name);
}
+ profile->gateways = NULL;
}
switch_mutex_unlock(mod_sofia_globals.hash_mutex);
}