summaryrefslogtreecommitdiff
path: root/include/asterisk
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 11:53:07 -0500
commit29e0add14f8db9ea28a7fbb32c2efec8c9738196 (patch)
tree461927c17793f96b09ef923f1f362881f079f987 /include/asterisk
parenta6d2926e5dc1c8216ee207c1f11460587a6abe93 (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/asterisk')
-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 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