From 29e0add14f8db9ea28a7fbb32c2efec8c9738196 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Mon, 13 Nov 2017 13:14:23 +0000 Subject: pjsip / hep: Provide correct local address for Websockets. Previously for PJSIP the local address of WebSocket connections was set to the remote address. For logging purposes this is not particularly useful. The WebSocket API has been extended to allow the local address to be queried and this is used in PJSIP to set the local address to the correct value. The PJSIP HEP support has also been tweaked so that reliable transports always use the local address on the transport and do not try to (wrongly) guess. As they are connection based it is impossible for the source to be anything else. ASTERISK-26758 ASTERISK-27363 Change-Id: Icd305fd038ad755e2682ab2786e381f6bf29e8ca --- include/asterisk/http_websocket.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/asterisk/http_websocket.h') diff --git a/include/asterisk/http_websocket.h b/include/asterisk/http_websocket.h index cd49dbe48..2180ef46b 100644 --- a/include/asterisk/http_websocket.h +++ b/include/asterisk/http_websocket.h @@ -344,6 +344,15 @@ AST_OPTIONAL_API(int, ast_websocket_fd, (struct ast_websocket *session), { errno */ AST_OPTIONAL_API(struct ast_sockaddr *, ast_websocket_remote_address, (struct ast_websocket *session), {return NULL;}); +/*! + * \brief Get the local address for a WebSocket connection session. + * + * \retval ast_sockaddr Local address + * + * \since 13.19.0 + */ +AST_OPTIONAL_API(struct ast_sockaddr *, ast_websocket_local_address, (struct ast_websocket *session), {return NULL;}); + /*! * \brief Get whether the WebSocket session is using a secure transport or not. * -- cgit v1.2.3