summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/ari.h10
-rw-r--r--include/asterisk/astobj2.h2
-rw-r--r--include/asterisk/http_websocket.h10
-rw-r--r--include/asterisk/vector.h2
4 files changed, 21 insertions, 3 deletions
diff --git a/include/asterisk/ari.h b/include/asterisk/ari.h
index c3df46a2b..c9f47a6e5 100644
--- a/include/asterisk/ari.h
+++ b/include/asterisk/ari.h
@@ -188,6 +188,16 @@ int ast_ari_websocket_session_write(struct ast_ari_websocket_session *session,
struct ast_json *message);
/*!
+ * \brief Get the Session ID for an ARI WebSocket.
+ *
+ * \param session Session to query.
+ * \return Session ID.
+ * \return \c NULL on error.
+ */
+const char *ast_ari_websocket_session_id(
+ const struct ast_ari_websocket_session *session);
+
+/*!
* \brief The stock message to return when out of memory.
*
* The refcount is NOT bumped on this object, so ast_json_ref() if you want to
diff --git a/include/asterisk/astobj2.h b/include/asterisk/astobj2.h
index 4a7aeeedd..c28dd2387 100644
--- a/include/asterisk/astobj2.h
+++ b/include/asterisk/astobj2.h
@@ -1642,7 +1642,7 @@ void *__ao2_unlink(struct ao2_container *c, void *obj, int flags,
* The use of flags argument is the follow:
*
* OBJ_UNLINK unlinks the object found
- * OBJ_NODATA on match, do return an object
+ * OBJ_NODATA on match, do not return an object
* Callbacks use OBJ_NODATA as a default
* functions such as find() do
* OBJ_MULTIPLE return multiple matches
diff --git a/include/asterisk/http_websocket.h b/include/asterisk/http_websocket.h
index 5adc08925..23492ff95 100644
--- a/include/asterisk/http_websocket.h
+++ b/include/asterisk/http_websocket.h
@@ -77,13 +77,14 @@ struct ast_websocket;
* \param ser The TCP/TLS session
* \param parameters Parameters extracted from the request URI
* \param headers Headers included in the request
+ * \param session_id The id of the current session.
*
* \retval 0 The session should be accepted
* \retval -1 The session should be rejected. Note that the caller must send an error
* response using \ref ast_http_error.
* \since 13.5.0
*/
-typedef int (*ast_websocket_pre_callback)(struct ast_tcptls_session_instance *ser, struct ast_variable *parameters, struct ast_variable *headers);
+typedef int (*ast_websocket_pre_callback)(struct ast_tcptls_session_instance *ser, struct ast_variable *parameters, struct ast_variable *headers, const char *session_id);
/*!
* \brief Callback for when a new connection for a sub-protocol is established
@@ -360,6 +361,13 @@ AST_OPTIONAL_API(int, ast_websocket_is_secure, (struct ast_websocket *session),
AST_OPTIONAL_API(int, ast_websocket_set_nonblock, (struct ast_websocket *session), { errno = ENOSYS; return -1;});
/*!
+ * \brief Get the session ID for a WebSocket session.
+ *
+ * \retval session id
+ */
+AST_OPTIONAL_API(const char *, ast_websocket_session_id, (struct ast_websocket *session), { errno = ENOSYS; return NULL;});
+
+/*!
* \brief Result code for a websocket client.
*/
enum ast_websocket_result {
diff --git a/include/asterisk/vector.h b/include/asterisk/vector.h
index 0a13c560b..be9091272 100644
--- a/include/asterisk/vector.h
+++ b/include/asterisk/vector.h
@@ -110,7 +110,7 @@
/*!
* \brief Deallocates this vector.
*
- * If any code to free the elements of this vector need to be run, that should
+ * If any code to free the elements of this vector needs to be run, that should
* be done prior to this call.
*
* \param vec Vector to deallocate.