From 5407ee2d88d3088ac3c40b3203efbbdfeb4b6156 Mon Sep 17 00:00:00 2001 From: Akos Marton Date: Mon, 12 Oct 2026 08:34:20 +0300 Subject: [PATCH] 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. --- res/res_pjsip_nat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }