resource_bridges.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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_with_id() */
  78. struct ast_ari_bridges_create_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_with_id_parse_body(
  94. struct ast_json *body,
  95. struct ast_ari_bridges_create_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_with_id(struct ast_variable *headers, struct ast_ari_bridges_create_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_set_video_source() */
  195. struct ast_ari_bridges_set_video_source_args {
  196. /*! Bridge's id */
  197. const char *bridge_id;
  198. /*! Channel's id */
  199. const char *channel_id;
  200. };
  201. /*!
  202. * \brief Set a channel as the video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants.
  203. *
  204. * \param headers HTTP headers
  205. * \param args Swagger parameters
  206. * \param[out] response HTTP response
  207. */
  208. void ast_ari_bridges_set_video_source(struct ast_variable *headers, struct ast_ari_bridges_set_video_source_args *args, struct ast_ari_response *response);
  209. /*! Argument struct for ast_ari_bridges_clear_video_source() */
  210. struct ast_ari_bridges_clear_video_source_args {
  211. /*! Bridge's id */
  212. const char *bridge_id;
  213. };
  214. /*!
  215. * \brief Removes any explicit video source in a multi-party mixing bridge. This operation has no effect on bridges with two or fewer participants. When no explicit video source is set, talk detection will be used to determine the active video stream.
  216. *
  217. * \param headers HTTP headers
  218. * \param args Swagger parameters
  219. * \param[out] response HTTP response
  220. */
  221. void ast_ari_bridges_clear_video_source(struct ast_variable *headers, struct ast_ari_bridges_clear_video_source_args *args, struct ast_ari_response *response);
  222. /*! Argument struct for ast_ari_bridges_start_moh() */
  223. struct ast_ari_bridges_start_moh_args {
  224. /*! Bridge's id */
  225. const char *bridge_id;
  226. /*! Channel's id */
  227. const char *moh_class;
  228. };
  229. /*!
  230. * \brief Body parsing function for /bridges/{bridgeId}/moh.
  231. * \param body The JSON body from which to parse parameters.
  232. * \param[out] args The args structure to parse into.
  233. * \retval zero on success
  234. * \retval non-zero on failure
  235. */
  236. int ast_ari_bridges_start_moh_parse_body(
  237. struct ast_json *body,
  238. struct ast_ari_bridges_start_moh_args *args);
  239. /*!
  240. * \brief Play music on hold to a bridge or change the MOH class that is playing.
  241. *
  242. * \param headers HTTP headers
  243. * \param args Swagger parameters
  244. * \param[out] response HTTP response
  245. */
  246. void ast_ari_bridges_start_moh(struct ast_variable *headers, struct ast_ari_bridges_start_moh_args *args, struct ast_ari_response *response);
  247. /*! Argument struct for ast_ari_bridges_stop_moh() */
  248. struct ast_ari_bridges_stop_moh_args {
  249. /*! Bridge's id */
  250. const char *bridge_id;
  251. };
  252. /*!
  253. * \brief Stop playing music on hold to a bridge.
  254. *
  255. * This will only stop music on hold being played via POST bridges/{bridgeId}/moh.
  256. *
  257. * \param headers HTTP headers
  258. * \param args Swagger parameters
  259. * \param[out] response HTTP response
  260. */
  261. void ast_ari_bridges_stop_moh(struct ast_variable *headers, struct ast_ari_bridges_stop_moh_args *args, struct ast_ari_response *response);
  262. /*! Argument struct for ast_ari_bridges_play() */
  263. struct ast_ari_bridges_play_args {
  264. /*! Bridge's id */
  265. const char *bridge_id;
  266. /*! Media's URI to play. */
  267. const char *media;
  268. /*! For sounds, selects language for sound. */
  269. const char *lang;
  270. /*! Number of media to skip before playing. */
  271. int offsetms;
  272. /*! Number of milliseconds to skip for forward/reverse operations. */
  273. int skipms;
  274. /*! Playback Id. */
  275. const char *playback_id;
  276. };
  277. /*!
  278. * \brief Body parsing function for /bridges/{bridgeId}/play.
  279. * \param body The JSON body from which to parse parameters.
  280. * \param[out] args The args structure to parse into.
  281. * \retval zero on success
  282. * \retval non-zero on failure
  283. */
  284. int ast_ari_bridges_play_parse_body(
  285. struct ast_json *body,
  286. struct ast_ari_bridges_play_args *args);
  287. /*!
  288. * \brief Start playback of media on a bridge.
  289. *
  290. * 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.)
  291. *
  292. * \param headers HTTP headers
  293. * \param args Swagger parameters
  294. * \param[out] response HTTP response
  295. */
  296. void ast_ari_bridges_play(struct ast_variable *headers, struct ast_ari_bridges_play_args *args, struct ast_ari_response *response);
  297. /*! Argument struct for ast_ari_bridges_play_with_id() */
  298. struct ast_ari_bridges_play_with_id_args {
  299. /*! Bridge's id */
  300. const char *bridge_id;
  301. /*! Playback ID. */
  302. const char *playback_id;
  303. /*! Media's URI to play. */
  304. const char *media;
  305. /*! For sounds, selects language for sound. */
  306. const char *lang;
  307. /*! Number of media to skip before playing. */
  308. int offsetms;
  309. /*! Number of milliseconds to skip for forward/reverse operations. */
  310. int skipms;
  311. };
  312. /*!
  313. * \brief Body parsing function for /bridges/{bridgeId}/play/{playbackId}.
  314. * \param body The JSON body from which to parse parameters.
  315. * \param[out] args The args structure to parse into.
  316. * \retval zero on success
  317. * \retval non-zero on failure
  318. */
  319. int ast_ari_bridges_play_with_id_parse_body(
  320. struct ast_json *body,
  321. struct ast_ari_bridges_play_with_id_args *args);
  322. /*!
  323. * \brief Start playback of media on a bridge.
  324. *
  325. * 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.)
  326. *
  327. * \param headers HTTP headers
  328. * \param args Swagger parameters
  329. * \param[out] response HTTP response
  330. */
  331. 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);
  332. /*! Argument struct for ast_ari_bridges_record() */
  333. struct ast_ari_bridges_record_args {
  334. /*! Bridge's id */
  335. const char *bridge_id;
  336. /*! Recording's filename */
  337. const char *name;
  338. /*! Format to encode audio in */
  339. const char *format;
  340. /*! Maximum duration of the recording, in seconds. 0 for no limit. */
  341. int max_duration_seconds;
  342. /*! Maximum duration of silence, in seconds. 0 for no limit. */
  343. int max_silence_seconds;
  344. /*! Action to take if a recording with the same name already exists. */
  345. const char *if_exists;
  346. /*! Play beep when recording begins */
  347. int beep;
  348. /*! DTMF input to terminate recording. */
  349. const char *terminate_on;
  350. };
  351. /*!
  352. * \brief Body parsing function for /bridges/{bridgeId}/record.
  353. * \param body The JSON body from which to parse parameters.
  354. * \param[out] args The args structure to parse into.
  355. * \retval zero on success
  356. * \retval non-zero on failure
  357. */
  358. int ast_ari_bridges_record_parse_body(
  359. struct ast_json *body,
  360. struct ast_ari_bridges_record_args *args);
  361. /*!
  362. * \brief Start a recording.
  363. *
  364. * This records the mixed audio from all channels participating in this bridge.
  365. *
  366. * \param headers HTTP headers
  367. * \param args Swagger parameters
  368. * \param[out] response HTTP response
  369. */
  370. void ast_ari_bridges_record(struct ast_variable *headers, struct ast_ari_bridges_record_args *args, struct ast_ari_response *response);
  371. #endif /* _ASTERISK_RESOURCE_BRIDGES_H */