Commit 57e2743cc5 for asterisk.org
commit 57e2743cc5f6354ac71b5c0118152581d849c893
Author: Akos Marton <akos.marton@gmail.com>
Date: Mon Oct 12 08:34:20 2026 +0300
res_pjsip_nat: Apply external addresses to IPv6 TCP/TLS transports
process_nat() calls ast_sip_set_request_transport_details() with use_ipv6
disabled, so on an IPv6 TCP or TLS transport without an explicit transport
selector the transport type mapping fails and the function returns early,
skipping the Contact/Via and SDP external address rewrites.
Passing use_ipv6 maps TCP6 to TCP and TLS6 to TLS, as
ast_sip_rewrite_uri_to_local() already does.
Fixes: #2222
UserNote: The external_media_address, external_signaling_address and
local_net transport options are now also applied to messages sent over IPv6
TCP and TLS transports.
diff --git a/res/res_pjsip_nat.c b/res/res_pjsip_nat.c
index a7689dee60..5749a3d610 100644
--- a/res/res_pjsip_nat.c
+++ b/res/res_pjsip_nat.c
@@ -327,7 +327,7 @@ static pj_status_t process_nat(pjsip_tx_data *tdata)
RAII_VAR(struct ao2_container *, hooks, NULL, ao2_cleanup);
const char *transport_type_name = "unknown";
- if (ast_sip_set_request_transport_details(&details, tdata, 0)) {
+ if (ast_sip_set_request_transport_details(&details, tdata, 1)) {
ast_debug(4, "Unable to process message for transport type '%s'\n", transport_type_name);
return PJ_SUCCESS;
}