Asterisk - The Open Source Telephony Project GIT-master-a358458
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 <dlee@digium.com>
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 <dlee@digium.com>
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 */
66
67/*!
68 * \brief WebSocket connection for events.
69 *
70 * \param ser HTTP TCP/TLS Server Session
71 * \param headers HTTP headers
72 * \param args Swagger parameters
73 * \param session_id The id of the current session.
74 *
75 * \retval 0 success
76 * \retval non-zero error
77 */
79 struct ast_variable *headers, struct ast_ari_events_event_websocket_args *args, const char *session_id);
80
81/*!
82 * \brief WebSocket connection for events.
83 *
84 * \param session ARI WebSocket.
85 * \param headers HTTP headers.
86 * \param args Swagger parameters.
87 */
90/*! Argument struct for ast_ari_events_user_event() */
92 /*! Event name */
93 const char *event_name;
94 /*! The name of the application that will receive this event */
95 const char *application;
96 /*! Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName} */
97 const char **source;
98 /*! Length of source array. */
100 /*! Parsing context for source. */
102 /*! The "variables" key in the body object holds custom key/value pairs to add to the user event. Ex. { "variables": { "key": "value" } } */
104};
105/*!
106 * \brief Body parsing function for /events/user/{eventName}.
107 * \param body The JSON body from which to parse parameters.
108 * \param[out] args The args structure to parse into.
109 * \retval zero on success
110 * \retval non-zero on failure
111 */
113 struct ast_json *body,
115
116/*!
117 * \brief Generate a user event.
118 *
119 * \param headers HTTP headers
120 * \param args Swagger parameters
121 * \param[out] response HTTP response
122 */
123void ast_ari_events_user_event(struct ast_variable *headers, struct ast_ari_events_user_event_args *args, struct ast_ari_response *response);
124
125#endif /* _ASTERISK_RESOURCE_EVENTS_H */
Asterisk RESTful API hooks.
static struct ast_mansession session
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}.
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.
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_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.
int ast_ari_websocket_events_event_websocket_init(void)
WebSocket connection for events.
void ast_ari_websocket_events_event_websocket_dtor(void)
WebSocket connection for events.
Abstract JSON element (object, array, string, int, ...).
describes a server instance
Definition: tcptls.h:150
Structure for variables, used for configurations and for channel variables.
const char * args