resource_bridges.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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. /*! \file
  19. *
  20. * \brief Generated file - declares stubs to be implemented in
  21. * res/ari/resource_bridges.c
  22. *
  23. * Bridge resources
  24. *
  25. * \author David M. Lee, II <dlee@digium.com>
  26. */
  27. /*
  28. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  29. * !!!!! DO NOT EDIT !!!!!
  30. * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  31. * This file is generated by a mustache template. Please see the original
  32. * template in rest-api-templates/ari_resource.h.mustache
  33. */
  34. #ifndef _ASTERISK_RESOURCE_BRIDGES_H
  35. #define _ASTERISK_RESOURCE_BRIDGES_H
  36. #include "asterisk/ari.h"
  37. /*! Argument struct for ast_ari_bridges_list() */
  38. struct ast_ari_bridges_list_args {
  39. };
  40. /*!
  41. * \brief List all active bridges in Asterisk.
  42. *
  43. * \param headers HTTP headers
  44. * \param args Swagger parameters
  45. * \param[out] response HTTP response
  46. */
  47. void ast_ari_bridges_list(struct ast_variable *headers, struct ast_ari_bridges_list_args *args, struct ast_ari_response *response);
  48. /*! Argument struct for ast_ari_bridges_create() */
  49. struct ast_ari_bridges_create_args {
  50. /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media). */
  51. const char *type;
  52. /*! Unique ID to give to the bridge being created. */
  53. const char *bridge_id;
  54. /*! Name to give to the bridge being created. */
  55. const char *name;
  56. };
  57. /*!
  58. * \brief Body parsing function for /bridges.
  59. * \param body The JSON body from which to parse parameters.
  60. * \param[out] args The args structure to parse into.
  61. * \retval zero on success
  62. * \retval non-zero on failure
  63. */
  64. int ast_ari_bridges_create_parse_body(
  65. struct ast_json *body,
  66. struct ast_ari_bridges_create_args *args);
  67. /*!
  68. * \brief Create a new bridge.
  69. *
  70. * This bridge persists until it has been shut down, or Asterisk has been shut down.
  71. *
  72. * \param headers HTTP headers
  73. * \param args Swagger parameters
  74. * \param[out] response HTTP response
  75. */
  76. void ast_ari_bridges_create(struct ast_variable *headers, struct ast_ari_bridges_create_args *args, struct ast_ari_response *response);
  77. /*! Argument struct for ast_ari_bridges_create_or_update_with_id() */
  78. struct ast_ari_bridges_create_or_update_with_id_args {
  79. /*! Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set. */
  80. const char *type;
  81. /*! Unique ID to give to the bridge being created. */
  82. const char *bridge_id;
  83. /*! Set the name of the bridge. */
  84. const char *name;
  85. };
  86. /*!
  87. * \brief Body parsing function for /bridges/{bridgeId}.
  88. * \param body The JSON body from which to parse parameters.
  89. * \param[out] args The args structure to parse into.
  90. * \retval zero on success
  91. * \retval non-zero on failure
  92. */
  93. int ast_ari_bridges_create_or_update_with_id_parse_body(
  94. struct ast_json *body,
  95. struct ast_ari_bridges_create_or_update_with_id_args *args);
  96. /*!
  97. * \brief Create a new bridge or updates an existing one.
  98. *
  99. * This bridge persists until it has been shut down, or Asterisk has been shut down.
  100. *
  101. * \param headers HTTP headers
  102. * \param args Swagger parameters
  103. * \param[out] response HTTP response
  104. */
  105. void ast_ari_bridges_create_or_update_with_id(struct ast_variable *headers, struct ast_ari_bridges_create_or_update_with_id_args *args, struct ast_ari_response *response);
  106. /*! Argument struct for ast_ari_bridges_get() */
  107. struct ast_ari_bridges_get_args {
  108. /*! Bridge's id */
  109. const char *bridge_id;
  110. };
  111. /*!
  112. * \brief Get bridge details.
  113. *
  114. * \param headers HTTP headers
  115. * \param args Swagger parameters
  116. * \param[out] response HTTP response
  117. */
  118. void ast_ari_bridges_get(struct ast_variable *headers, struct ast_ari_bridges_get_args *args, struct ast_ari_response *response);
  119. /*! Argument struct for ast_ari_bridges_destroy() */
  120. struct ast_ari_bridges_destroy_args {
  121. /*! Bridge's id */
  122. const char *bridge_id;
  123. };
  124. /*!
  125. * \brief Shut down a bridge.
  126. *
  127. * If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.
  128. *
  129. * \param headers HTTP headers
  130. * \param args Swagger parameters
  131. * \param[out] response HTTP response
  132. */
  133. void ast_ari_bridges_destroy(struct ast_variable *headers, struct ast_ari_bridges_destroy_args *args, struct ast_ari_response *response);
  134. /*! Argument struct for ast_ari_bridges_add_channel() */
  135. struct ast_ari_bridges_add_channel_args {
  136. /*! Bridge's id */
  137. const char *bridge_id;
  138. /*! Array of Ids of channels to add to bridge */
  139. const char **channel;
  140. /*! Length of channel array. */
  141. size_t channel_count;
  142. /*! Parsing context for channel. */
  143. char *channel_parse;
  144. /*! Channel's role in the bridge */
  145. const char *role;
  146. };
  147. /*!
  148. * \brief Body parsing function for /bridges/{bridgeId}/addChannel.
  149. * \param body The JSON body from which to parse parameters.
  150. * \param[out] args The args structure to parse into.
  151. * \retval zero on success
  152. * \retval non-zero on failure
  153. */
  154. int ast_ari_bridges_add_channel_parse_body(
  155. struct ast_json *body,
  156. struct ast_ari_bridges_add_channel_args *args);
  157. /*!
  158. * \brief Add a channel to a bridge.
  159. *
  160. * \param headers HTTP headers
  161. * \param args Swagger parameters
  162. * \param[out] response HTTP response
  163. */
  164. void ast_ari_bridges_add_channel(struct ast_variable *headers, struct ast_ari_bridges_add_channel_args *args, struct ast_ari_response *response);
  165. /*! Argument struct for ast_ari_bridges_remove_channel() */
  166. struct ast_ari_bridges_remove_channel_args {
  167. /*! Bridge's id */
  168. const char *bridge_id;
  169. /*! Array of Ids of channels to remove from bridge */
  170. const char **channel;
  171. /*! Length of channel array. */
  172. size_t channel_count;
  173. /*! Parsing context for channel. */
  174. char *channel_parse;
  175. };
  176. /*!
  177. * \brief Body parsing function for /bridges/{bridgeId}/removeChannel.
  178. * \param body The JSON body from which to parse parameters.
  179. * \param[out] args The args structure to parse into.
  180. * \retval zero on success
  181. * \retval non-zero on failure
  182. */
  183. int ast_ari_bridges_remove_channel_parse_body(
  184. struct ast_json *body,
  185. struct ast_ari_bridges_remove_channel_args *args);
  186. /*!
  187. * \brief Remove a channel from a bridge.
  188. *
  189. * \param headers HTTP headers
  190. * \param args Swagger parameters
  191. * \param[out] response HTTP response
  192. */
  193. void ast_ari_bridges_remove_channel(struct ast_variable *headers, struct ast_ari_bridges_remove_channel_args *args, struct ast_ari_response *response);
  194. /*! Argument struct for ast_ari_bridges_start_moh() */
  195. struct ast_ari_bridges_start_moh_args {
  196. /*! Bridge's id */
  197. const char *bridge_id;
  198. /*! Channel's id */
  199. const char *moh_class;
  200. };
  201. /*!
  202. * \brief Body parsing function for /bridges/{bridgeId}/moh.
  203. * \param body The JSON body from which to parse parameters.
  204. * \param[out] args The args structure to parse into.
  205. * \retval zero on success
  206. * \retval non-zero on failure
  207. */
  208. int ast_ari_bridges_start_moh_parse_body(
  209. struct ast_json *body,
  210. struct ast_ari_bridges_start_moh_args *args);
  211. /*!
  212. * \brief Play music on hold to a bridge or change the MOH class that is playing.
  213. *
  214. * \param headers HTTP headers
  215. * \param args Swagger parameters
  216. * \param[out] response HTTP response
  217. */
  218. void ast_ari_bridges_start_moh(struct ast_variable *headers, struct ast_ari_bridges_start_moh_args *args, struct ast_ari_response *response);
  219. /*! Argument struct for ast_ari_bridges_stop_moh() */
  220. struct ast_ari_bridges_stop_moh_args {
  221. /*! Bridge's id */
  222. const char *bridge_id;
  223. };
  224. /*!
  225. * \brief Stop playing music on hold to a bridge.
  226. *
  227. * This will only stop music on hold being played via POST bridges/{bridgeId}/moh.
  228. *
  229. * \param headers HTTP headers
  230. * \param args Swagger parameters
  231. * \param[out] response HTTP response
  232. */
  233. void ast_ari_bridges_stop_moh(struct ast_variable *headers, struct ast_ari_bridges_stop_moh_args *args, struct ast_ari_response *response);
  234. /*! Argument struct for ast_ari_bridges_play() */
  235. struct ast_ari_bridges_play_args {
  236. /*! Bridge's id */
  237. const char *bridge_id;
  238. /*! Media's URI to play. */
  239. const char *media;
  240. /*! For sounds, selects language for sound. */
  241. const char *lang;
  242. /*! Number of media to skip before playing. */
  243. int offsetms;
  244. /*! Number of milliseconds to skip for forward/reverse operations. */
  245. int skipms;
  246. /*! Playback Id. */
  247. const char *playback_id;
  248. };
  249. /*!
  250. * \brief Body parsing function for /bridges/{bridgeId}/play.
  251. * \param body The JSON body from which to parse parameters.
  252. * \param[out] args The args structure to parse into.
  253. * \retval zero on success
  254. * \retval non-zero on failure
  255. */
  256. int ast_ari_bridges_play_parse_body(
  257. struct ast_json *body,
  258. struct ast_ari_bridges_play_args *args);
  259. /*!
  260. * \brief Start playback of media on a bridge.
  261. *
  262. * The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)
  263. *
  264. * \param headers HTTP headers
  265. * \param args Swagger parameters
  266. * \param[out] response HTTP response
  267. */
  268. void ast_ari_bridges_play(struct ast_variable *headers, struct ast_ari_bridges_play_args *args, struct ast_ari_response *response);
  269. /*! Argument struct for ast_ari_bridges_play_with_id() */
  270. struct ast_ari_bridges_play_with_id_args {
  271. /*! Bridge's id */
  272. const char *bridge_id;
  273. /*! Playback ID. */
  274. const char *playback_id;
  275. /*! Media's URI to play. */
  276. const char *media;
  277. /*! For sounds, selects language for sound. */
  278. const char *lang;
  279. /*! Number of media to skip before playing. */
  280. int offsetms;
  281. /*! Number of milliseconds to skip for forward/reverse operations. */
  282. int skipms;
  283. };
  284. /*!
  285. * \brief Body parsing function for /bridges/{bridgeId}/play/{playbackId}.
  286. * \param body The JSON body from which to parse parameters.
  287. * \param[out] args The args structure to parse into.
  288. * \retval zero on success
  289. * \retval non-zero on failure
  290. */
  291. int ast_ari_bridges_play_with_id_parse_body(
  292. struct ast_json *body,
  293. struct ast_ari_bridges_play_with_id_args *args);
  294. /*!
  295. * \brief Start playback of media on a bridge.
  296. *
  297. * The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)
  298. *
  299. * \param headers HTTP headers
  300. * \param args Swagger parameters
  301. * \param[out] response HTTP response
  302. */
  303. void ast_ari_bridges_play_with_id(struct ast_variable *headers, struct ast_ari_bridges_play_with_id_args *args, struct ast_ari_response *response);
  304. /*! Argument struct for ast_ari_bridges_record() */
  305. struct ast_ari_bridges_record_args {
  306. /*! Bridge's id */
  307. const char *bridge_id;
  308. /*! Recording's filename */
  309. const char *name;
  310. /*! Format to encode audio in */
  311. const char *format;
  312. /*! Maximum duration of the recording, in seconds. 0 for no limit. */
  313. int max_duration_seconds;
  314. /*! Maximum duration of silence, in seconds. 0 for no limit. */
  315. int max_silence_seconds;
  316. /*! Action to take if a recording with the same name already exists. */
  317. const char *if_exists;
  318. /*! Play beep when recording begins */
  319. int beep;
  320. /*! DTMF input to terminate recording. */
  321. const char *terminate_on;
  322. };
  323. /*!
  324. * \brief Body parsing function for /bridges/{bridgeId}/record.
  325. * \param body The JSON body from which to parse parameters.
  326. * \param[out] args The args structure to parse into.
  327. * \retval zero on success
  328. * \retval non-zero on failure
  329. */
  330. int ast_ari_bridges_record_parse_body(
  331. struct ast_json *body,
  332. struct ast_ari_bridges_record_args *args);
  333. /*!
  334. * \brief Start a recording.
  335. *
  336. * This records the mixed audio from all channels participating in this bridge.
  337. *
  338. * \param headers HTTP headers
  339. * \param args Swagger parameters
  340. * \param[out] response HTTP response
  341. */
  342. void ast_ari_bridges_record(struct ast_variable *headers, struct ast_ari_bridges_record_args *args, struct ast_ari_response *response);
  343. #endif /* _ASTERISK_RESOURCE_BRIDGES_H */