res_pjsip: Fixed format of IPv6 addresses for external media addresses
authorDanielYK <daniel.heckl@gmail.com>
Wed, 15 Apr 2020 20:13:39 +0000 (22:13 +0200)
committerKevin Harwell <kharwell@digium.com>
Tue, 21 Apr 2020 22:45:42 +0000 (17:45 -0500)
ASTERISK-28835

Change-Id: I66289afd164c5cdd6c5caa39e79d629a467e7a26

res/res_pjsip_sdp_rtp.c
res/res_pjsip_session.c

index bb7c43e..1bcb661 100644 (file)
@@ -2180,8 +2180,8 @@ static void change_outgoing_sdp_stream_media_address(pjsip_tx_data *tdata, struc
        if (ast_sip_transport_is_nonlocal(transport_state, &our_sdp_addr) && transport_state->localnet) {
                return;
        }
-       ast_debug(5, "Setting media address to %s\n", ast_sockaddr_stringify_host(&transport_state->external_media_address));
-       pj_strdup2(tdata->pool, &stream->conn->addr, ast_sockaddr_stringify_host(&transport_state->external_media_address));
+       ast_debug(5, "Setting media address to %s\n", ast_sockaddr_stringify_addr_remote(&transport_state->external_media_address));
+       pj_strdup2(tdata->pool, &stream->conn->addr, ast_sockaddr_stringify_addr_remote(&transport_state->external_media_address));
 }
 
 /*! \brief Function which stops the RTP instance */
index 3a7d562..ceb1c34 100644 (file)
@@ -4485,8 +4485,8 @@ static void session_outgoing_nat_hook(pjsip_tx_data *tdata, struct ast_sip_trans
                 * outgoing session IP is local. If it is, we'll do
                 * rewriting. No localnet configured? Always rewrite. */
                if (ast_sip_transport_is_local(transport_state, &our_sdp_addr) || !transport_state->localnet) {
-                       ast_debug(5, "Setting external media address to %s\n", ast_sockaddr_stringify_host(&transport_state->external_media_address));
-                       pj_strdup2(tdata->pool, &sdp->conn->addr, ast_sockaddr_stringify_host(&transport_state->external_media_address));
+                       ast_debug(5, "Setting external media address to %s\n", ast_sockaddr_stringify_addr_remote(&transport_state->external_media_address));
+                       pj_strdup2(tdata->pool, &sdp->conn->addr, ast_sockaddr_stringify_addr_remote(&transport_state->external_media_address));
                        pj_strassign(&sdp->origin.addr, &sdp->conn->addr);
                }
        }