summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/json.h9
-rw-r--r--include/asterisk/stasis_http.h12
2 files changed, 20 insertions, 1 deletions
diff --git a/include/asterisk/json.h b/include/asterisk/json.h
index 61685fd9f..0584c99af 100644
--- a/include/asterisk/json.h
+++ b/include/asterisk/json.h
@@ -158,6 +158,15 @@ enum ast_json_type
*/
enum ast_json_type ast_json_typeof(const struct ast_json *value);
+/*!
+ * \brief Get the string name for the given type.
+ * \since 12.0.0
+ * \param type Type to convert to string.
+ * \return Simple string for the type name (object, array, string, etc.)
+ * \return \c "?" for invalid types.
+ */
+const char *ast_json_typename(enum ast_json_type type);
+
/*!@}*/
/*!@{*/
diff --git a/include/asterisk/stasis_http.h b/include/asterisk/stasis_http.h
index 05e9dded7..8d5a74ee7 100644
--- a/include/asterisk/stasis_http.h
+++ b/include/asterisk/stasis_http.h
@@ -33,6 +33,12 @@
#include "asterisk/json.h"
#include "asterisk/http_websocket.h"
+/*!
+ * \brief Configured encoding format for JSON output.
+ * \return JSON output encoding (compact, pretty, etc.)
+ */
+enum ast_json_encoding_format stasis_http_json_format(void);
+
struct stasis_http_response;
/*!
@@ -141,12 +147,16 @@ struct ari_websocket_session;
/*!
* \brief Create an ARI WebSocket session.
*
+ * If \c NULL is given for the validator function, no validation will be
+ * performed.
+ *
* \param ws_session Underlying WebSocket session.
+ * \param validator Function to validate outgoing messages.
* \return New ARI WebSocket session.
* \return \c NULL on error.
*/
struct ari_websocket_session *ari_websocket_session_create(
- struct ast_websocket *ws_session);
+ struct ast_websocket *ws_session, int (*validator)(struct ast_json *));
/*!
* \brief Read a message from an ARI WebSocket.