[Asterisk-code-review] res_pjsip_transport_websocket: Also set the remote name. (asterisk[certified/18.9])

George Joseph asteriskteam at digium.com
Fri Dec 23 06:32:52 CST 2022


George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19751 )


Change subject: res_pjsip_transport_websocket: Also set the remote name.
......................................................................

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
---
M res/res_pjsip_transport_websocket.c
1 file changed, 20 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/51/19751/1

diff --git a/res/res_pjsip_transport_websocket.c b/res/res_pjsip_transport_websocket.c
index 1b882da..5de17b9 100644
--- a/res/res_pjsip_transport_websocket.c
+++ b/res/res_pjsip_transport_websocket.c
@@ -225,6 +225,7 @@
 	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;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19751
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: certified/18.9
Gerrit-Change-Id: Ia1cdef33e1411f927985b4b852c95e163c080e94
Gerrit-Change-Number: 19751
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-CC: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221223/280a235c/attachment.html>


More information about the asterisk-code-review mailing list