]> 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 C. Colp <jcolp@sangoma.com>
Tue, 17 May 2022 12:18:03 +0000 (09:18 -0300)
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

res/res_pjsip_transport_websocket.c

index 9894a8c4ae1cb11727265f781ea5e56508f5ce72..e6ae100cca951c89e59931e9102a2049564aad06 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;