[Asterisk-code-review] res_pjsip_transport_websocket: Add remote port to transport (asterisk[certified/18.9])
George Joseph
asteriskteam at digium.com
Fri Dec 23 06:32:51 CST 2022
George Joseph has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19752 )
Change subject: res_pjsip_transport_websocket: Add remote port to transport
......................................................................
res_pjsip_transport_websocket: Add remote port to transport
When Asterisk receives a new websocket conenction, it creates a new
pjsip transport for it and copies connection data into it. The
transport manager then uses the remote IP address and port on the
transport to create a monitor for each connection. However, the
remote port wasn't being copied, only the IP address which meant
that the transport manager was creating only 1 monitoring entry for
all websocket connections from the same IP address. Therefore, if
one of those connections failed, it deleted the transport taking
all the the connections from that same IP address with it.
* We now copy the remote port into the created transport and the
transport manager behaves correctly.
ASTERISK-30369
Change-Id: Ib506d40897ea6286455ac0be4dfbb0ed43b727e1
---
M res/res_pjsip_transport_websocket.c
1 file changed, 25 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/52/19752/1
diff --git a/res/res_pjsip_transport_websocket.c b/res/res_pjsip_transport_websocket.c
index 5de17b9..d11c1fc 100644
--- a/res/res_pjsip_transport_websocket.c
+++ b/res/res_pjsip_transport_websocket.c
@@ -226,6 +226,7 @@
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.remote_name.port = ast_sockaddr_port(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/+/19752
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: Ib506d40897ea6286455ac0be4dfbb0ed43b727e1
Gerrit-Change-Number: 19752
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221223/a8f69249/attachment.html>
More information about the asterisk-code-review
mailing list