Debian Codegraph @

res/ari/resource_events.h

raw symbols SCIP
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() */
43 struct ast_ari_events_event_websocket_args {
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'. */
51 int subscribe_all;
52 };
53 /*! Argument struct for ast_ari_events_user_event() */
54 struct ast_ari_events_user_event_args {
55 /*! Event name */
56 const char *event_name;
57 /*! The name of the application that will receive this event */
58 const char *application;
59 /*! Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName} */
60 const char **source;
61 /*! Length of source array. */
62 size_t source_count;
63 /*! Parsing context for source. */
64 char *source_parse;
65 /*! The "variables" key in the body object holds custom key/value pairs to add to the user event. Ex. { "variables": { "key": "value" } } */
66 struct ast_json *variables;
67 };
68 /*!
69 * \brief Body parsing function for /events/user/{eventName}.
70 * \param body The JSON body from which to parse parameters.
71 * \param[out] args The args structure to parse into.
72 * \retval zero on success
73 * \retval non-zero on failure
74 */
75 int ast_ari_events_user_event_parse_body(
76 struct ast_json *body,
77 struct ast_ari_events_user_event_args *args);
78
79 /*!
80 * \brief Generate a user event.
81 *
82 * \param headers HTTP headers
83 * \param args Swagger parameters
84 * \param[out] response HTTP response
85 */
86 void ast_ari_events_user_event(struct ast_variable *headers, struct ast_ari_events_user_event_args *args, struct ast_ari_response *response);
87 /*! Argument struct for ast_ari_events_claim_channel() */
88 struct ast_ari_events_claim_channel_args {
89 /*! The ID of the channel to claim */
90 const char *channel_id;
91 /*! The name of the application claiming the channel */
92 const char *application;
93 };
94 /*!
95 * \brief Body parsing function for /events/claim.
96 * \param body The JSON body from which to parse parameters.
97 * \param[out] args The args structure to parse into.
98 * \retval zero on success
99 * \retval non-zero on failure
100 */
101 int ast_ari_events_claim_channel_parse_body(
102 struct ast_json *body,
103 struct ast_ari_events_claim_channel_args *args);
104
105 /*!
106 * \brief Claim a broadcast channel for this application.
107 *
108 * Atomically claims a channel that is in broadcast state. Only the first claim succeeds.
109 *
110 * \param headers HTTP headers
111 * \param args Swagger parameters
112 * \param[out] response HTTP response
113 */
114 void ast_ari_events_claim_channel(struct ast_variable *headers, struct ast_ari_events_claim_channel_args *args, struct ast_ari_response *response);
115
116 #endif /* _ASTERISK_RESOURCE_EVENTS_H */