Skip to content
Snippets Groups Projects
Commit 8f6e0f93 authored by Nick French's avatar Nick French Committed by Joshua Colp
Browse files

res_pjsip: dont return early from registration if init auth fails

If set_outbound_initial_authentication_credentials() fails,
handle_client_registration() bails early without creating or
sending a register message.

[set_outbound_initial_authentication_credentials() failures
can occur during the process of retrieving an oauth access
token.]

The return from handle_client_registration is ignored, so
returning an error doesn't do any good.

This is a real problem when the registration request is a
re-register, because then the registration will still be
marked 'active' despite the re-register never being sent at all.

So instead, log a warning but let the registration be created
and sent (and probably fail) and follow the normal registration
failed retry/abort logic.

ASTERISK-29315 #close

Change-Id: I2e03b1ea7fba1fa1a8279086aa4b17679e7fa7fa
parent d2f623ba
Branches
Tags
3 merge requests!138Merge branch asterisk-20.3.0 into devel properly,!123Merge asterisk '20.3.0' into devel,!118Draft: manager: AOC-S support for AOCMessage
...@@ -672,7 +672,6 @@ static int handle_client_registration(void *data) ...@@ -672,7 +672,6 @@ static int handle_client_registration(void *data)
if (set_outbound_initial_authentication_credentials(client_state->client, &client_state->outbound_auths)) { if (set_outbound_initial_authentication_credentials(client_state->client, &client_state->outbound_auths)) {
ast_log(LOG_WARNING, "Failed to set initial authentication credentials\n"); ast_log(LOG_WARNING, "Failed to set initial authentication credentials\n");
return -1;
} }
if (client_state->status == SIP_REGISTRATION_STOPPED if (client_state->status == SIP_REGISTRATION_STOPPED
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment