Asterisk - The Open Source Telephony Project GIT-master-f36a736
resource_applications.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 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_applications.c
23 *
24 * Stasis application resources
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_APPLICATIONS_H
38#define _ASTERISK_RESOURCE_APPLICATIONS_H
39
40#include "asterisk/ari.h"
41
42/*! Argument struct for ast_ari_applications_list() */
44};
45/*!
46 * \brief List all applications.
47 *
48 * \param headers HTTP headers
49 * \param args Swagger parameters
50 * \param[out] response HTTP response
51 */
53/*! Argument struct for ast_ari_applications_get() */
55 /*! Application's name */
56 const char *application_name;
57};
58/*!
59 * \brief Get details of an application.
60 *
61 * \param headers HTTP headers
62 * \param args Swagger parameters
63 * \param[out] response HTTP response
64 */
65void ast_ari_applications_get(struct ast_variable *headers, struct ast_ari_applications_get_args *args, struct ast_ari_response *response);
66/*! Argument struct for ast_ari_applications_subscribe() */
68 /*! Application's name */
69 const char *application_name;
70 /*! Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName} */
71 const char **event_source;
72 /*! Length of event_source array. */
74 /*! Parsing context for event_source. */
76};
77/*!
78 * \brief Body parsing function for /applications/{applicationName}/subscription.
79 * \param body The JSON body from which to parse parameters.
80 * \param[out] args The args structure to parse into.
81 * \retval zero on success
82 * \retval non-zero on failure
83 */
85 struct ast_json *body,
87
88/*!
89 * \brief Subscribe an application to a event source.
90 *
91 * Returns the state of the application after the subscriptions have changed
92 *
93 * \param headers HTTP headers
94 * \param args Swagger parameters
95 * \param[out] response HTTP response
96 */
98/*! Argument struct for ast_ari_applications_unsubscribe() */
100 /*! Application's name */
101 const char *application_name;
102 /*! Array of URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName} */
103 const char **event_source;
104 /*! Length of event_source array. */
106 /*! Parsing context for event_source. */
108};
109/*!
110 * \brief Body parsing function for /applications/{applicationName}/subscription.
111 * \param body The JSON body from which to parse parameters.
112 * \param[out] args The args structure to parse into.
113 * \retval zero on success
114 * \retval non-zero on failure
115 */
117 struct ast_json *body,
119
120/*!
121 * \brief Unsubscribe an application from an event source.
122 *
123 * Returns the state of the application after the subscriptions have changed
124 *
125 * \param headers HTTP headers
126 * \param args Swagger parameters
127 * \param[out] response HTTP response
128 */
130/*! Argument struct for ast_ari_applications_filter() */
132 /*! Application's name */
133 const char *application_name;
134 /*! Specify which event types to allow/disallow */
136};
137/*!
138 * \brief Body parsing function for /applications/{applicationName}/eventFilter.
139 * \param body The JSON body from which to parse parameters.
140 * \param[out] args The args structure to parse into.
141 * \retval zero on success
142 * \retval non-zero on failure
143 */
145 struct ast_json *body,
147
148/*!
149 * \brief Filter application events types.
150 *
151 * Allowed and/or disallowed event type filtering can be done. The body (parameter) should specify a JSON key/value object that describes the type of event filtering needed. One, or both of the following keys can be designated:<br /><br />"allowed" - Specifies an allowed list of event types<br />"disallowed" - Specifies a disallowed list of event types<br /><br />Further, each of those key's value should be a JSON array that holds zero, or more JSON key/value objects. Each of these objects must contain the following key with an associated value:<br /><br />"type" - The type name of the event to filter<br /><br />The value must be the string name (case sensitive) of the event type that needs filtering. For example:<br /><br />{ "allowed": [ { "type": "StasisStart" }, { "type": "StasisEnd" } ] }<br /><br />As this specifies only an allowed list, then only those two event type messages are sent to the application. No other event messages are sent.<br /><br />The following rules apply:<br /><br />* If the body is empty, both the allowed and disallowed filters are set empty.<br />* If both list types are given then both are set to their respective values (note, specifying an empty array for a given type sets that type to empty).<br />* If only one list type is given then only that type is set. The other type is not updated.<br />* An empty "allowed" list means all events are allowed.<br />* An empty "disallowed" list means no events are disallowed.<br />* Disallowed events take precedence over allowed events if the event type is specified in both lists.
152 *
153 * \param headers HTTP headers
154 * \param args Swagger parameters
155 * \param[out] response HTTP response
156 */
158
159#endif /* _ASTERISK_RESOURCE_APPLICATIONS_H */
Asterisk RESTful API hooks.
int ast_ari_applications_filter_parse_body(struct ast_json *body, struct ast_ari_applications_filter_args *args)
Body parsing function for /applications/{applicationName}/eventFilter.
int ast_ari_applications_subscribe_parse_body(struct ast_json *body, struct ast_ari_applications_subscribe_args *args)
Body parsing function for /applications/{applicationName}/subscription.
void ast_ari_applications_subscribe(struct ast_variable *headers, struct ast_ari_applications_subscribe_args *args, struct ast_ari_response *response)
Subscribe an application to a event source.
void ast_ari_applications_get(struct ast_variable *headers, struct ast_ari_applications_get_args *args, struct ast_ari_response *response)
Get details of an application.
void ast_ari_applications_list(struct ast_variable *headers, struct ast_ari_applications_list_args *args, struct ast_ari_response *response)
List all applications.
void ast_ari_applications_filter(struct ast_variable *headers, struct ast_ari_applications_filter_args *args, struct ast_ari_response *response)
Filter application events types.
void ast_ari_applications_unsubscribe(struct ast_variable *headers, struct ast_ari_applications_unsubscribe_args *args, struct ast_ari_response *response)
Unsubscribe an application from an event source.
int ast_ari_applications_unsubscribe_parse_body(struct ast_json *body, struct ast_ari_applications_unsubscribe_args *args)
Body parsing function for /applications/{applicationName}/subscription.
Abstract JSON element (object, array, string, int, ...).
Structure for variables, used for configurations and for channel variables.
const char * args