summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-11-13 13:14:23 +0000
committerJoshua Colp <jcolp@digium.com>2017-11-14 12:09:22 +0000
commitc2dddb001aa01f6786278bfdb54908ca9b0e3271 (patch)
treea066f9b9bd91a1476ed53388ab0fbd3865e8dd40 /include
parent1250b7c66401910f1b41f01b783725d9c99c7255 (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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asterisk/http_websocket.h b/include/asterisk/http_websocket.h
index d8e7d063b..83d5d4f78 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.
*
* \retval 0 if unsecure