diff options
author | Joshua Colp <jcolp@digium.com> | 2017-11-13 13:14:23 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2017-11-14 16:50:31 +0000 |
commit | b4ef4636858fbee349cb17a3cbd56f349ad90c88 (patch) | |
tree | 9fe2ecce8bbf6b93aeb688f6ee0ac64dc581443a /include | |
parent | 8c01f7d32c476a9ab146360591a3f68a2bc2c8d1 (diff) |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/http_websocket.h | 9 |
1 files changed, 9 insertions, 0 deletions
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 @@ -345,6 +345,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. * * \retval 0 if unsecure |