mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-09 09:17:34 +00:00
fix registration overlap timeout snafu
This commit is contained in:
parent
97d80d924a
commit
df52cc0952
@ -1 +1 @@
|
|||||||
Mon May 31 09:47:08 EDT 2010
|
Tue Nov 2 17:57:25 CDT 2010
|
||||||
|
@ -8660,6 +8660,10 @@ void outgoing_destroy(nta_outgoing_t *orq)
|
|||||||
orq->orq_destroyed = 1;
|
orq->orq_destroyed = 1;
|
||||||
orq->orq_callback = outgoing_default_cb;
|
orq->orq_callback = outgoing_default_cb;
|
||||||
orq->orq_magic = NULL;
|
orq->orq_magic = NULL;
|
||||||
|
|
||||||
|
if (orq->orq_method != sip_method_invite &&
|
||||||
|
orq->orq_method != sip_method_ack)
|
||||||
|
outgoing_terminate(orq);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @internal Outgoing transaction timer routine.
|
/** @internal Outgoing transaction timer routine.
|
||||||
|
@ -343,6 +343,7 @@ typedef enum {
|
|||||||
REG_STATE_FAIL_WAIT,
|
REG_STATE_FAIL_WAIT,
|
||||||
REG_STATE_EXPIRED,
|
REG_STATE_EXPIRED,
|
||||||
REG_STATE_NOREG,
|
REG_STATE_NOREG,
|
||||||
|
REG_STATE_TIMEOUT,
|
||||||
REG_STATE_LAST
|
REG_STATE_LAST
|
||||||
} reg_state_t;
|
} reg_state_t;
|
||||||
|
|
||||||
|
@ -369,11 +369,24 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
|
|||||||
user_via = NULL;
|
user_via = NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case REG_STATE_TIMEOUT:
|
||||||
|
{
|
||||||
|
nua_handle_t *nh = gateway_ptr->nh;
|
||||||
|
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Timeout Registering %s\n", gateway_ptr->name);
|
||||||
|
|
||||||
|
gateway_ptr->nh = NULL;
|
||||||
|
nua_handle_destroy(nh);
|
||||||
|
gateway_ptr->state = REG_STATE_FAILED;
|
||||||
|
gateway_ptr->failures++;
|
||||||
|
gateway_ptr->failure_status = 908;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case REG_STATE_FAILED:
|
case REG_STATE_FAILED:
|
||||||
{
|
{
|
||||||
int sec;
|
int sec;
|
||||||
|
|
||||||
if (gateway_ptr->failure_status == 503) {
|
if (gateway_ptr->failure_status == 503 || gateway_ptr->failure_status == 908) {
|
||||||
sec = gateway_ptr->retry_seconds;
|
sec = gateway_ptr->retry_seconds;
|
||||||
} else {
|
} else {
|
||||||
sec = gateway_ptr->retry_seconds * (gateway_ptr->failures + 1);
|
sec = gateway_ptr->retry_seconds * (gateway_ptr->failures + 1);
|
||||||
@ -384,8 +397,8 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
|
|||||||
gateway_ptr->state = REG_STATE_FAIL_WAIT;
|
gateway_ptr->state = REG_STATE_FAIL_WAIT;
|
||||||
gateway_ptr->failure_status = 0;
|
gateway_ptr->failure_status = 0;
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s Failed Registration, setting retry to %d seconds.\n",
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "%s Failed Registration [%d], setting retry to %d seconds.\n",
|
||||||
gateway_ptr->name, sec);
|
gateway_ptr->name, gateway_ptr->failure_status, sec);
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -396,7 +409,7 @@ void sofia_reg_check_gateway(sofia_profile_t *profile, time_t now)
|
|||||||
break;
|
break;
|
||||||
case REG_STATE_TRYING:
|
case REG_STATE_TRYING:
|
||||||
if (!gateway_ptr->retry || now >= gateway_ptr->retry) {
|
if (!gateway_ptr->retry || now >= gateway_ptr->retry) {
|
||||||
gateway_ptr->state = REG_STATE_FAILED;
|
gateway_ptr->state = REG_STATE_TIMEOUT;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user