]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip_transport_websocket: Also set the remote name.
authorJoshua C. Colp <jcolp@sangoma.com>
Tue, 17 May 2022 12:18:03 +0000 (09:18 -0300)
committerJoshua Colp <jcolp@sangoma.com>
Thu, 19 May 2022 15:21:17 +0000 (10:21 -0500)
As part of PJSIP 2.11 a behavior change was done to require
a matching remote hostname on an established transport for
secure transports. Since the Websocket transport is considered
a secure transport this caused the existing connection to not
be found and used.

We now set the remote hostname and the transport can be found.

ASTERISK-30065

Change-Id: Ia1cdef33e1411f927985b4b852c95e163c080e94
(cherry picked from commit c5c858287a6d7fb17af84e6abd90447afb26eb94)

res/res_pjsip_transport_websocket.c

index 1b882dac14bd90faee172c51c7cf0affe293a284..5de17b93a4399c2992eaa0ca34b27c83181e892f 100644 (file)
@@ -225,6 +225,7 @@ static int transport_create(void *data)
        pj_sockaddr_parse(pj_AF_UNSPEC(), 0, pj_cstr(&buf, ws_addr_str), &newtransport->transport.local_addr);
        pj_strdup2(pool, &newtransport->transport.local_name.host, ast_sockaddr_stringify_addr(ast_websocket_local_address(newtransport->ws_session)));
        newtransport->transport.local_name.port = ast_sockaddr_port(ast_websocket_local_address(newtransport->ws_session));
+       pj_strdup2(pool, &newtransport->transport.remote_name.host, ast_sockaddr_stringify_addr(ast_websocket_remote_address(newtransport->ws_session)));
 
        newtransport->transport.flag = pjsip_transport_get_flag_from_type((pjsip_transport_type_e)newtransport->transport.key.type);
        newtransport->transport.dir = PJSIP_TP_DIR_INCOMING;