Commit 1956e8b29f for asterisk.org
commit 1956e8b29fe6a30a7af8ec942179799cf42a3f01
Author: Aerohades <330524797+Aerohades@users.noreply.github.com>
Date: Wed Oct 21 15:11:31 2026 +0200
res_pjsip_outbound_registration: Preserve flow transport during authentication
When an outbound registration using a flow transport receives an
authentication challenge over a reliable transport, bind the configured
flow transport to the transport that delivered the challenge before
sending the authenticated REGISTER.
Without this, the authenticated REGISTER may select a different TCP/TLS
connection. Some registrars associate the authentication challenge with
the connection that received it, causing authentication to fail when the
connection changes.
Normal transports are unaffected because
ast_sip_transport_state_set_transport() only stores the received
transport for flow transports.
Fixes: #2245
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index 21b4640d0c..26eaa59a42 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -1491,6 +1491,8 @@ static int handle_registration_response(void *data)
server_uri, client_uri);
pjsip_tx_data_add_ref(tdata);
+ save_response_fields_to_transport(response);
+
res = registration_client_send(response->client_state, tdata);
/* Save the cseq that actually got sent. */