Asterisk - The Open Source Telephony Project  18.5.0
resource_events.h
Go to the documentation of this file.
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2012 - 2013, Digium, Inc.
5  *
6  * David M. Lee, II <[email protected]>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18 
19 /*! \file
20  *
21  * \brief Generated file - declares stubs to be implemented in
22  * res/ari/resource_events.c
23  *
24  * WebSocket resource
25  *
26  * \author David M. Lee, II <[email protected]>
27  */
28 
29 /*
30  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
31  * !!!!! DO NOT EDIT !!!!!
32  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33  * This file is generated by a mustache template. Please see the original
34  * template in rest-api-templates/ari_resource.h.mustache
35  */
36 
37 #ifndef _ASTERISK_RESOURCE_EVENTS_H
38 #define _ASTERISK_RESOURCE_EVENTS_H
39 
40 #include "asterisk/ari.h"
41 
42 /*! Argument struct for ast_ari_events_event_websocket() */
44  /*! Array of Applications to subscribe to. */
45  const char **app;
46  /*! Length of app array. */
47  size_t app_count;
48  /*! Parsing context for app. */
49  char *app_parse;
50  /*! Subscribe to all Asterisk events. If provided, the applications listed will be subscribed to all events, effectively disabling the application specific subscriptions. Default is 'false'. */
52 };
53 
54 /*!
55  * \brief WebSocket connection for events.
56  *
57  * \retval 0 success
58  * \retval -1 error
59  */
61 
62 /*!
63  * \brief WebSocket connection for events.
64  *
65  * \return Nothing
66  */
68 
69 /*!
70  * \brief WebSocket connection for events.
71  *
72  * \param ser HTTP TCP/TLS Server Session
73  * \param headers HTTP headers
74  * \param args Swagger parameters
75  * \param session_id The id of the current session.
76  *
77  * \retval 0 success
78  * \retval non-zero error
79  */
81  struct ast_variable *headers, struct ast_ari_events_event_websocket_args *args, const char *session_id);
82 
83 /*!
84  * \brief WebSocket connection for events.
85  *
86  * \param session ARI WebSocket.
87  * \param headers HTTP headers.
88  * \param args Swagger parameters.
89  * \param session_id The id of the current session.
90  */
92  struct ast_variable *headers, struct ast_ari_events_event_websocket_args *args);
93 /*! Argument struct for ast_ari_events_user_event() */
95  /*! Event name */
96  const char *event_name;
97  /*! The name of the application that will receive this event */
98  const char *application;
99  /*! Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName} */
100  const char **source;
101  /*! Length of source array. */
102  size_t source_count;
103  /*! Parsing context for source. */
105  /*! The "variables" key in the body object holds custom key/value pairs to add to the user event. Ex. { "variables": { "key": "value" } } */
107 };
108 /*!
109  * \brief Body parsing function for /events/user/{eventName}.
110  * \param body The JSON body from which to parse parameters.
111  * \param[out] args The args structure to parse into.
112  * \retval zero on success
113  * \retval non-zero on failure
114  */
116  struct ast_json *body,
118 
119 /*!
120  * \brief Generate a user event.
121  *
122  * \param headers HTTP headers
123  * \param args Swagger parameters
124  * \param[out] response HTTP response
125  */
126 void ast_ari_events_user_event(struct ast_variable *headers, struct ast_ari_events_user_event_args *args, struct ast_ari_response *response);
127 
128 #endif /* _ASTERISK_RESOURCE_EVENTS_H */
void ast_ari_websocket_events_event_websocket_established(struct ast_ari_websocket_session *session, struct ast_variable *headers, struct ast_ari_events_event_websocket_args *args)
WebSocket connection for events.
Structure for variables, used for configurations and for channel variables.
Asterisk RESTful API hooks.
const char * args
int ast_ari_websocket_events_event_websocket_init(void)
WebSocket connection for events.
void ast_ari_events_user_event(struct ast_variable *headers, struct ast_ari_events_user_event_args *args, struct ast_ari_response *response)
Generate a user event.
int ast_ari_events_user_event_parse_body(struct ast_json *body, struct ast_ari_events_user_event_args *args)
Body parsing function for /events/user/{eventName}.
static struct ast_mansession session
describes a server instance
Definition: tcptls.h:149
void ast_ari_websocket_events_event_websocket_dtor(void)
WebSocket connection for events.
Abstract JSON element (object, array, string, int, ...).
int ast_ari_websocket_events_event_websocket_attempted(struct ast_tcptls_session_instance *ser, struct ast_variable *headers, struct ast_ari_events_event_websocket_args *args, const char *session_id)
WebSocket connection for events.