diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index b88f80e114..644a1ecc88 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -83,9 +83,9 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now) switch_core_hash_delete(mod_sofia_globals.gateway_hash, gateway_ptr->name); switch_core_hash_delete(mod_sofia_globals.gateway_hash, gateway_ptr->register_from); switch_core_hash_delete(mod_sofia_globals.gateway_hash, gateway_ptr->register_contact); - - last = gateway_ptr; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "deleted gateway %s\n", gateway_ptr->name); + } else { + last = gateway_ptr; } }