Skip to content
Snippets Groups Projects
Commit d4a522d5 authored by Richard Mudgett's avatar Richard Mudgett
Browse files

res_pjsip_outbound_registration.c: Be tolerant of short registration timeouts.

Change-Id: Ie16f5053ebde0dc6507845393709b4d6a3ea526d
parent e44ab381
Branches
Tags
No related merge requests found
...@@ -796,11 +796,18 @@ static int handle_registration_response(void *data) ...@@ -796,11 +796,18 @@ static int handle_registration_response(void *data)
if (PJSIP_IS_STATUS_IN_CLASS(response->code, 200)) { if (PJSIP_IS_STATUS_IN_CLASS(response->code, 200)) {
/* Check if this is in regards to registering or unregistering */ /* Check if this is in regards to registering or unregistering */
if (response->expiration) { if (response->expiration) {
int next_registration_round;
/* If the registration went fine simply reschedule registration for the future */ /* If the registration went fine simply reschedule registration for the future */
ast_debug(1, "Outbound registration to '%s' with client '%s' successful\n", server_uri, client_uri); ast_debug(1, "Outbound registration to '%s' with client '%s' successful\n", server_uri, client_uri);
response->client_state->status = SIP_REGISTRATION_REGISTERED; response->client_state->status = SIP_REGISTRATION_REGISTERED;
response->client_state->retries = 0; response->client_state->retries = 0;
schedule_registration(response->client_state, response->expiration - REREGISTER_BUFFER_TIME); next_registration_round = response->expiration - REREGISTER_BUFFER_TIME;
if (next_registration_round < 0) {
/* Re-register immediately. */
next_registration_round = 0;
}
schedule_registration(response->client_state, next_registration_round);
} else { } else {
ast_debug(1, "Outbound unregistration to '%s' with client '%s' successful\n", server_uri, client_uri); ast_debug(1, "Outbound unregistration to '%s' with client '%s' successful\n", server_uri, client_uri);
response->client_state->status = SIP_REGISTRATION_UNREGISTERED; response->client_state->status = SIP_REGISTRATION_UNREGISTERED;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment