res_pjsip_transport_websocket: Also set the remote name.

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
This commit is contained in:
Joshua C. Colp 2022-05-17 09:18:03 -03:00 committed by Joshua Colp
parent a143c37fc0
commit dc1e446ebd
1 changed files with 1 additions and 0 deletions

View 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;