mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-07 22:03:50 +00:00
[mod_sofia] release nat mapping when nua create failed
This commit is contained in:
parent
deecaae870
commit
583443e384
@ -3188,7 +3188,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
|||||||
if (!sofia_glue_init_sql(profile)) {
|
if (!sofia_glue_init_sql(profile)) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open SQL Database [%s]!\n", profile->name);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Cannot Open SQL Database [%s]!\n", profile->name);
|
||||||
sofia_profile_start_failure(profile, profile->name);
|
sofia_profile_start_failure(profile, profile->name);
|
||||||
goto end;
|
goto db_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
supported = switch_core_sprintf(profile->pool, "%s%s%spath, replaces", use_100rel ? "100rel, " : "", use_timer ? "timer, " : "", use_rfc_5626 ? "outbound, " : "");
|
supported = switch_core_sprintf(profile->pool, "%s%s%spath, replaces", use_100rel ? "100rel, " : "", use_timer ? "timer, " : "", use_rfc_5626 ? "outbound, " : "");
|
||||||
@ -3339,7 +3339,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
|||||||
}
|
}
|
||||||
|
|
||||||
sofia_profile_start_failure(profile, profile->name);
|
sofia_profile_start_failure(profile, profile->name);
|
||||||
goto end;
|
goto nua_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created agent for %s\n", profile->name);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Created agent for %s\n", profile->name);
|
||||||
@ -3570,6 +3570,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
|||||||
switch_event_fire(&s_event);
|
switch_event_fire(&s_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nua_fail:
|
||||||
if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_nat_get_type()) {
|
if (sofia_test_pflag(profile, PFLAG_AUTO_NAT) && switch_nat_get_type()) {
|
||||||
if (switch_nat_del_mapping(profile->sip_port, SWITCH_NAT_UDP) == SWITCH_STATUS_SUCCESS) {
|
if (switch_nat_del_mapping(profile->sip_port, SWITCH_NAT_UDP) == SWITCH_STATUS_SUCCESS) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deleted UDP nat mapping for %s port %d\n", profile->name, profile->sip_port);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Deleted UDP nat mapping for %s port %d\n", profile->name, profile->sip_port);
|
||||||
@ -3582,7 +3583,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
db_fail:
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write lock %s\n", profile->name);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write lock %s\n", profile->name);
|
||||||
switch_thread_rwlock_wrlock(profile->rwlock);
|
switch_thread_rwlock_wrlock(profile->rwlock);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user