resource_channels.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  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_channels.c
  22. *
  23. * Channel 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_CHANNELS_H
  35. #define _ASTERISK_RESOURCE_CHANNELS_H
  36. #include "asterisk/ari.h"
  37. /*! Argument struct for ast_ari_channels_list() */
  38. struct ast_ari_channels_list_args {
  39. };
  40. /*!
  41. * \brief List all active channels in Asterisk.
  42. *
  43. * \param headers HTTP headers
  44. * \param args Swagger parameters
  45. * \param[out] response HTTP response
  46. */
  47. void ast_ari_channels_list(struct ast_variable *headers, struct ast_ari_channels_list_args *args, struct ast_ari_response *response);
  48. /*! Argument struct for ast_ari_channels_originate() */
  49. struct ast_ari_channels_originate_args {
  50. /*! Endpoint to call. */
  51. const char *endpoint;
  52. /*! The extension to dial after the endpoint answers. Mutually exclusive with 'app'. */
  53. const char *extension;
  54. /*! The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'. */
  55. const char *context;
  56. /*! The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'. */
  57. long priority;
  58. /*! The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'. */
  59. const char *label;
  60. /*! The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */
  61. const char *app;
  62. /*! The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */
  63. const char *app_args;
  64. /*! CallerID to use when dialing the endpoint or extension. */
  65. const char *caller_id;
  66. /*! Timeout (in seconds) before giving up dialing, or -1 for no timeout. */
  67. int timeout;
  68. /*! The "variables" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { "endpoint": "SIP/Alice", "variables": { "CALLERID(name)": "Alice" } } */
  69. struct ast_json *variables;
  70. /*! The unique id to assign the channel on creation. */
  71. const char *channel_id;
  72. /*! The unique id to assign the second channel when using local channels. */
  73. const char *other_channel_id;
  74. /*! The unique id of the channel which is originating this one. */
  75. const char *originator;
  76. /*! The format name capability list to use if originator is not specified. Ex. "ulaw,slin16". Format names can be found with "core show codecs". */
  77. const char *formats;
  78. };
  79. /*!
  80. * \brief Body parsing function for /channels.
  81. * \param body The JSON body from which to parse parameters.
  82. * \param[out] args The args structure to parse into.
  83. * \retval zero on success
  84. * \retval non-zero on failure
  85. */
  86. int ast_ari_channels_originate_parse_body(
  87. struct ast_json *body,
  88. struct ast_ari_channels_originate_args *args);
  89. /*!
  90. * \brief Create a new channel (originate).
  91. *
  92. * The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.
  93. *
  94. * \param headers HTTP headers
  95. * \param args Swagger parameters
  96. * \param[out] response HTTP response
  97. */
  98. void ast_ari_channels_originate(struct ast_variable *headers, struct ast_ari_channels_originate_args *args, struct ast_ari_response *response);
  99. /*! Argument struct for ast_ari_channels_get() */
  100. struct ast_ari_channels_get_args {
  101. /*! Channel's id */
  102. const char *channel_id;
  103. };
  104. /*!
  105. * \brief Channel details.
  106. *
  107. * \param headers HTTP headers
  108. * \param args Swagger parameters
  109. * \param[out] response HTTP response
  110. */
  111. void ast_ari_channels_get(struct ast_variable *headers, struct ast_ari_channels_get_args *args, struct ast_ari_response *response);
  112. /*! Argument struct for ast_ari_channels_originate_with_id() */
  113. struct ast_ari_channels_originate_with_id_args {
  114. /*! The unique id to assign the channel on creation. */
  115. const char *channel_id;
  116. /*! Endpoint to call. */
  117. const char *endpoint;
  118. /*! The extension to dial after the endpoint answers. Mutually exclusive with 'app'. */
  119. const char *extension;
  120. /*! The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'. */
  121. const char *context;
  122. /*! The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'. */
  123. long priority;
  124. /*! The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'. */
  125. const char *label;
  126. /*! The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */
  127. const char *app;
  128. /*! The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */
  129. const char *app_args;
  130. /*! CallerID to use when dialing the endpoint or extension. */
  131. const char *caller_id;
  132. /*! Timeout (in seconds) before giving up dialing, or -1 for no timeout. */
  133. int timeout;
  134. /*! The "variables" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { "endpoint": "SIP/Alice", "variables": { "CALLERID(name)": "Alice" } } */
  135. struct ast_json *variables;
  136. /*! The unique id to assign the second channel when using local channels. */
  137. const char *other_channel_id;
  138. /*! The unique id of the channel which is originating this one. */
  139. const char *originator;
  140. /*! The format name capability list to use if originator is not specified. Ex. "ulaw,slin16". Format names can be found with "core show codecs". */
  141. const char *formats;
  142. };
  143. /*!
  144. * \brief Body parsing function for /channels/{channelId}.
  145. * \param body The JSON body from which to parse parameters.
  146. * \param[out] args The args structure to parse into.
  147. * \retval zero on success
  148. * \retval non-zero on failure
  149. */
  150. int ast_ari_channels_originate_with_id_parse_body(
  151. struct ast_json *body,
  152. struct ast_ari_channels_originate_with_id_args *args);
  153. /*!
  154. * \brief Create a new channel (originate with id).
  155. *
  156. * The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.
  157. *
  158. * \param headers HTTP headers
  159. * \param args Swagger parameters
  160. * \param[out] response HTTP response
  161. */
  162. void ast_ari_channels_originate_with_id(struct ast_variable *headers, struct ast_ari_channels_originate_with_id_args *args, struct ast_ari_response *response);
  163. /*! Argument struct for ast_ari_channels_hangup() */
  164. struct ast_ari_channels_hangup_args {
  165. /*! Channel's id */
  166. const char *channel_id;
  167. /*! Reason for hanging up the channel */
  168. const char *reason;
  169. };
  170. /*!
  171. * \brief Body parsing function for /channels/{channelId}.
  172. * \param body The JSON body from which to parse parameters.
  173. * \param[out] args The args structure to parse into.
  174. * \retval zero on success
  175. * \retval non-zero on failure
  176. */
  177. int ast_ari_channels_hangup_parse_body(
  178. struct ast_json *body,
  179. struct ast_ari_channels_hangup_args *args);
  180. /*!
  181. * \brief Delete (i.e. hangup) a channel.
  182. *
  183. * \param headers HTTP headers
  184. * \param args Swagger parameters
  185. * \param[out] response HTTP response
  186. */
  187. void ast_ari_channels_hangup(struct ast_variable *headers, struct ast_ari_channels_hangup_args *args, struct ast_ari_response *response);
  188. /*! Argument struct for ast_ari_channels_continue_in_dialplan() */
  189. struct ast_ari_channels_continue_in_dialplan_args {
  190. /*! Channel's id */
  191. const char *channel_id;
  192. /*! The context to continue to. */
  193. const char *context;
  194. /*! The extension to continue to. */
  195. const char *extension;
  196. /*! The priority to continue to. */
  197. int priority;
  198. /*! The label to continue to - will supersede 'priority' if both are provided. */
  199. const char *label;
  200. };
  201. /*!
  202. * \brief Body parsing function for /channels/{channelId}/continue.
  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_channels_continue_in_dialplan_parse_body(
  209. struct ast_json *body,
  210. struct ast_ari_channels_continue_in_dialplan_args *args);
  211. /*!
  212. * \brief Exit application; continue execution in the dialplan.
  213. *
  214. * \param headers HTTP headers
  215. * \param args Swagger parameters
  216. * \param[out] response HTTP response
  217. */
  218. void ast_ari_channels_continue_in_dialplan(struct ast_variable *headers, struct ast_ari_channels_continue_in_dialplan_args *args, struct ast_ari_response *response);
  219. /*! Argument struct for ast_ari_channels_redirect() */
  220. struct ast_ari_channels_redirect_args {
  221. /*! Channel's id */
  222. const char *channel_id;
  223. /*! The endpoint to redirect the channel to */
  224. const char *endpoint;
  225. };
  226. /*!
  227. * \brief Body parsing function for /channels/{channelId}/redirect.
  228. * \param body The JSON body from which to parse parameters.
  229. * \param[out] args The args structure to parse into.
  230. * \retval zero on success
  231. * \retval non-zero on failure
  232. */
  233. int ast_ari_channels_redirect_parse_body(
  234. struct ast_json *body,
  235. struct ast_ari_channels_redirect_args *args);
  236. /*!
  237. * \brief Redirect the channel to a different location.
  238. *
  239. * \param headers HTTP headers
  240. * \param args Swagger parameters
  241. * \param[out] response HTTP response
  242. */
  243. void ast_ari_channels_redirect(struct ast_variable *headers, struct ast_ari_channels_redirect_args *args, struct ast_ari_response *response);
  244. /*! Argument struct for ast_ari_channels_answer() */
  245. struct ast_ari_channels_answer_args {
  246. /*! Channel's id */
  247. const char *channel_id;
  248. };
  249. /*!
  250. * \brief Answer a channel.
  251. *
  252. * \param headers HTTP headers
  253. * \param args Swagger parameters
  254. * \param[out] response HTTP response
  255. */
  256. void ast_ari_channels_answer(struct ast_variable *headers, struct ast_ari_channels_answer_args *args, struct ast_ari_response *response);
  257. /*! Argument struct for ast_ari_channels_ring() */
  258. struct ast_ari_channels_ring_args {
  259. /*! Channel's id */
  260. const char *channel_id;
  261. };
  262. /*!
  263. * \brief Indicate ringing to a channel.
  264. *
  265. * \param headers HTTP headers
  266. * \param args Swagger parameters
  267. * \param[out] response HTTP response
  268. */
  269. void ast_ari_channels_ring(struct ast_variable *headers, struct ast_ari_channels_ring_args *args, struct ast_ari_response *response);
  270. /*! Argument struct for ast_ari_channels_ring_stop() */
  271. struct ast_ari_channels_ring_stop_args {
  272. /*! Channel's id */
  273. const char *channel_id;
  274. };
  275. /*!
  276. * \brief Stop ringing indication on a channel if locally generated.
  277. *
  278. * \param headers HTTP headers
  279. * \param args Swagger parameters
  280. * \param[out] response HTTP response
  281. */
  282. void ast_ari_channels_ring_stop(struct ast_variable *headers, struct ast_ari_channels_ring_stop_args *args, struct ast_ari_response *response);
  283. /*! Argument struct for ast_ari_channels_send_dtmf() */
  284. struct ast_ari_channels_send_dtmf_args {
  285. /*! Channel's id */
  286. const char *channel_id;
  287. /*! DTMF To send. */
  288. const char *dtmf;
  289. /*! Amount of time to wait before DTMF digits (specified in milliseconds) start. */
  290. int before;
  291. /*! Amount of time in between DTMF digits (specified in milliseconds). */
  292. int between;
  293. /*! Length of each DTMF digit (specified in milliseconds). */
  294. int duration;
  295. /*! Amount of time to wait after DTMF digits (specified in milliseconds) end. */
  296. int after;
  297. };
  298. /*!
  299. * \brief Body parsing function for /channels/{channelId}/dtmf.
  300. * \param body The JSON body from which to parse parameters.
  301. * \param[out] args The args structure to parse into.
  302. * \retval zero on success
  303. * \retval non-zero on failure
  304. */
  305. int ast_ari_channels_send_dtmf_parse_body(
  306. struct ast_json *body,
  307. struct ast_ari_channels_send_dtmf_args *args);
  308. /*!
  309. * \brief Send provided DTMF to a given channel.
  310. *
  311. * \param headers HTTP headers
  312. * \param args Swagger parameters
  313. * \param[out] response HTTP response
  314. */
  315. void ast_ari_channels_send_dtmf(struct ast_variable *headers, struct ast_ari_channels_send_dtmf_args *args, struct ast_ari_response *response);
  316. /*! Argument struct for ast_ari_channels_mute() */
  317. struct ast_ari_channels_mute_args {
  318. /*! Channel's id */
  319. const char *channel_id;
  320. /*! Direction in which to mute audio */
  321. const char *direction;
  322. };
  323. /*!
  324. * \brief Body parsing function for /channels/{channelId}/mute.
  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_channels_mute_parse_body(
  331. struct ast_json *body,
  332. struct ast_ari_channels_mute_args *args);
  333. /*!
  334. * \brief Mute a channel.
  335. *
  336. * \param headers HTTP headers
  337. * \param args Swagger parameters
  338. * \param[out] response HTTP response
  339. */
  340. void ast_ari_channels_mute(struct ast_variable *headers, struct ast_ari_channels_mute_args *args, struct ast_ari_response *response);
  341. /*! Argument struct for ast_ari_channels_unmute() */
  342. struct ast_ari_channels_unmute_args {
  343. /*! Channel's id */
  344. const char *channel_id;
  345. /*! Direction in which to unmute audio */
  346. const char *direction;
  347. };
  348. /*!
  349. * \brief Body parsing function for /channels/{channelId}/mute.
  350. * \param body The JSON body from which to parse parameters.
  351. * \param[out] args The args structure to parse into.
  352. * \retval zero on success
  353. * \retval non-zero on failure
  354. */
  355. int ast_ari_channels_unmute_parse_body(
  356. struct ast_json *body,
  357. struct ast_ari_channels_unmute_args *args);
  358. /*!
  359. * \brief Unmute a channel.
  360. *
  361. * \param headers HTTP headers
  362. * \param args Swagger parameters
  363. * \param[out] response HTTP response
  364. */
  365. void ast_ari_channels_unmute(struct ast_variable *headers, struct ast_ari_channels_unmute_args *args, struct ast_ari_response *response);
  366. /*! Argument struct for ast_ari_channels_hold() */
  367. struct ast_ari_channels_hold_args {
  368. /*! Channel's id */
  369. const char *channel_id;
  370. };
  371. /*!
  372. * \brief Hold a channel.
  373. *
  374. * \param headers HTTP headers
  375. * \param args Swagger parameters
  376. * \param[out] response HTTP response
  377. */
  378. void ast_ari_channels_hold(struct ast_variable *headers, struct ast_ari_channels_hold_args *args, struct ast_ari_response *response);
  379. /*! Argument struct for ast_ari_channels_unhold() */
  380. struct ast_ari_channels_unhold_args {
  381. /*! Channel's id */
  382. const char *channel_id;
  383. };
  384. /*!
  385. * \brief Remove a channel from hold.
  386. *
  387. * \param headers HTTP headers
  388. * \param args Swagger parameters
  389. * \param[out] response HTTP response
  390. */
  391. void ast_ari_channels_unhold(struct ast_variable *headers, struct ast_ari_channels_unhold_args *args, struct ast_ari_response *response);
  392. /*! Argument struct for ast_ari_channels_start_moh() */
  393. struct ast_ari_channels_start_moh_args {
  394. /*! Channel's id */
  395. const char *channel_id;
  396. /*! Music on hold class to use */
  397. const char *moh_class;
  398. };
  399. /*!
  400. * \brief Body parsing function for /channels/{channelId}/moh.
  401. * \param body The JSON body from which to parse parameters.
  402. * \param[out] args The args structure to parse into.
  403. * \retval zero on success
  404. * \retval non-zero on failure
  405. */
  406. int ast_ari_channels_start_moh_parse_body(
  407. struct ast_json *body,
  408. struct ast_ari_channels_start_moh_args *args);
  409. /*!
  410. * \brief Play music on hold to a channel.
  411. *
  412. * Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.
  413. *
  414. * \param headers HTTP headers
  415. * \param args Swagger parameters
  416. * \param[out] response HTTP response
  417. */
  418. void ast_ari_channels_start_moh(struct ast_variable *headers, struct ast_ari_channels_start_moh_args *args, struct ast_ari_response *response);
  419. /*! Argument struct for ast_ari_channels_stop_moh() */
  420. struct ast_ari_channels_stop_moh_args {
  421. /*! Channel's id */
  422. const char *channel_id;
  423. };
  424. /*!
  425. * \brief Stop playing music on hold to a channel.
  426. *
  427. * \param headers HTTP headers
  428. * \param args Swagger parameters
  429. * \param[out] response HTTP response
  430. */
  431. void ast_ari_channels_stop_moh(struct ast_variable *headers, struct ast_ari_channels_stop_moh_args *args, struct ast_ari_response *response);
  432. /*! Argument struct for ast_ari_channels_start_silence() */
  433. struct ast_ari_channels_start_silence_args {
  434. /*! Channel's id */
  435. const char *channel_id;
  436. };
  437. /*!
  438. * \brief Play silence to a channel.
  439. *
  440. * Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.
  441. *
  442. * \param headers HTTP headers
  443. * \param args Swagger parameters
  444. * \param[out] response HTTP response
  445. */
  446. void ast_ari_channels_start_silence(struct ast_variable *headers, struct ast_ari_channels_start_silence_args *args, struct ast_ari_response *response);
  447. /*! Argument struct for ast_ari_channels_stop_silence() */
  448. struct ast_ari_channels_stop_silence_args {
  449. /*! Channel's id */
  450. const char *channel_id;
  451. };
  452. /*!
  453. * \brief Stop playing silence to a channel.
  454. *
  455. * \param headers HTTP headers
  456. * \param args Swagger parameters
  457. * \param[out] response HTTP response
  458. */
  459. void ast_ari_channels_stop_silence(struct ast_variable *headers, struct ast_ari_channels_stop_silence_args *args, struct ast_ari_response *response);
  460. /*! Argument struct for ast_ari_channels_play() */
  461. struct ast_ari_channels_play_args {
  462. /*! Channel's id */
  463. const char *channel_id;
  464. /*! Media's URI to play. */
  465. const char *media;
  466. /*! For sounds, selects language for sound. */
  467. const char *lang;
  468. /*! Number of media to skip before playing. */
  469. int offsetms;
  470. /*! Number of milliseconds to skip for forward/reverse operations. */
  471. int skipms;
  472. /*! Playback ID. */
  473. const char *playback_id;
  474. };
  475. /*!
  476. * \brief Body parsing function for /channels/{channelId}/play.
  477. * \param body The JSON body from which to parse parameters.
  478. * \param[out] args The args structure to parse into.
  479. * \retval zero on success
  480. * \retval non-zero on failure
  481. */
  482. int ast_ari_channels_play_parse_body(
  483. struct ast_json *body,
  484. struct ast_ari_channels_play_args *args);
  485. /*!
  486. * \brief Start playback of media.
  487. *
  488. * 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.)
  489. *
  490. * \param headers HTTP headers
  491. * \param args Swagger parameters
  492. * \param[out] response HTTP response
  493. */
  494. void ast_ari_channels_play(struct ast_variable *headers, struct ast_ari_channels_play_args *args, struct ast_ari_response *response);
  495. /*! Argument struct for ast_ari_channels_play_with_id() */
  496. struct ast_ari_channels_play_with_id_args {
  497. /*! Channel's id */
  498. const char *channel_id;
  499. /*! Playback ID. */
  500. const char *playback_id;
  501. /*! Media's URI to play. */
  502. const char *media;
  503. /*! For sounds, selects language for sound. */
  504. const char *lang;
  505. /*! Number of media to skip before playing. */
  506. int offsetms;
  507. /*! Number of milliseconds to skip for forward/reverse operations. */
  508. int skipms;
  509. };
  510. /*!
  511. * \brief Body parsing function for /channels/{channelId}/play/{playbackId}.
  512. * \param body The JSON body from which to parse parameters.
  513. * \param[out] args The args structure to parse into.
  514. * \retval zero on success
  515. * \retval non-zero on failure
  516. */
  517. int ast_ari_channels_play_with_id_parse_body(
  518. struct ast_json *body,
  519. struct ast_ari_channels_play_with_id_args *args);
  520. /*!
  521. * \brief Start playback of media and specify the playbackId.
  522. *
  523. * 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.)
  524. *
  525. * \param headers HTTP headers
  526. * \param args Swagger parameters
  527. * \param[out] response HTTP response
  528. */
  529. void ast_ari_channels_play_with_id(struct ast_variable *headers, struct ast_ari_channels_play_with_id_args *args, struct ast_ari_response *response);
  530. /*! Argument struct for ast_ari_channels_record() */
  531. struct ast_ari_channels_record_args {
  532. /*! Channel's id */
  533. const char *channel_id;
  534. /*! Recording's filename */
  535. const char *name;
  536. /*! Format to encode audio in */
  537. const char *format;
  538. /*! Maximum duration of the recording, in seconds. 0 for no limit */
  539. int max_duration_seconds;
  540. /*! Maximum duration of silence, in seconds. 0 for no limit */
  541. int max_silence_seconds;
  542. /*! Action to take if a recording with the same name already exists. */
  543. const char *if_exists;
  544. /*! Play beep when recording begins */
  545. int beep;
  546. /*! DTMF input to terminate recording */
  547. const char *terminate_on;
  548. };
  549. /*!
  550. * \brief Body parsing function for /channels/{channelId}/record.
  551. * \param body The JSON body from which to parse parameters.
  552. * \param[out] args The args structure to parse into.
  553. * \retval zero on success
  554. * \retval non-zero on failure
  555. */
  556. int ast_ari_channels_record_parse_body(
  557. struct ast_json *body,
  558. struct ast_ari_channels_record_args *args);
  559. /*!
  560. * \brief Start a recording.
  561. *
  562. * Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.
  563. *
  564. * \param headers HTTP headers
  565. * \param args Swagger parameters
  566. * \param[out] response HTTP response
  567. */
  568. void ast_ari_channels_record(struct ast_variable *headers, struct ast_ari_channels_record_args *args, struct ast_ari_response *response);
  569. /*! Argument struct for ast_ari_channels_get_channel_var() */
  570. struct ast_ari_channels_get_channel_var_args {
  571. /*! Channel's id */
  572. const char *channel_id;
  573. /*! The channel variable or function to get */
  574. const char *variable;
  575. };
  576. /*!
  577. * \brief Body parsing function for /channels/{channelId}/variable.
  578. * \param body The JSON body from which to parse parameters.
  579. * \param[out] args The args structure to parse into.
  580. * \retval zero on success
  581. * \retval non-zero on failure
  582. */
  583. int ast_ari_channels_get_channel_var_parse_body(
  584. struct ast_json *body,
  585. struct ast_ari_channels_get_channel_var_args *args);
  586. /*!
  587. * \brief Get the value of a channel variable or function.
  588. *
  589. * \param headers HTTP headers
  590. * \param args Swagger parameters
  591. * \param[out] response HTTP response
  592. */
  593. void ast_ari_channels_get_channel_var(struct ast_variable *headers, struct ast_ari_channels_get_channel_var_args *args, struct ast_ari_response *response);
  594. /*! Argument struct for ast_ari_channels_set_channel_var() */
  595. struct ast_ari_channels_set_channel_var_args {
  596. /*! Channel's id */
  597. const char *channel_id;
  598. /*! The channel variable or function to set */
  599. const char *variable;
  600. /*! The value to set the variable to */
  601. const char *value;
  602. };
  603. /*!
  604. * \brief Body parsing function for /channels/{channelId}/variable.
  605. * \param body The JSON body from which to parse parameters.
  606. * \param[out] args The args structure to parse into.
  607. * \retval zero on success
  608. * \retval non-zero on failure
  609. */
  610. int ast_ari_channels_set_channel_var_parse_body(
  611. struct ast_json *body,
  612. struct ast_ari_channels_set_channel_var_args *args);
  613. /*!
  614. * \brief Set the value of a channel variable or function.
  615. *
  616. * \param headers HTTP headers
  617. * \param args Swagger parameters
  618. * \param[out] response HTTP response
  619. */
  620. void ast_ari_channels_set_channel_var(struct ast_variable *headers, struct ast_ari_channels_set_channel_var_args *args, struct ast_ari_response *response);
  621. /*! Argument struct for ast_ari_channels_snoop_channel() */
  622. struct ast_ari_channels_snoop_channel_args {
  623. /*! Channel's id */
  624. const char *channel_id;
  625. /*! Direction of audio to spy on */
  626. const char *spy;
  627. /*! Direction of audio to whisper into */
  628. const char *whisper;
  629. /*! Application the snooping channel is placed into */
  630. const char *app;
  631. /*! The application arguments to pass to the Stasis application */
  632. const char *app_args;
  633. /*! Unique ID to assign to snooping channel */
  634. const char *snoop_id;
  635. };
  636. /*!
  637. * \brief Body parsing function for /channels/{channelId}/snoop.
  638. * \param body The JSON body from which to parse parameters.
  639. * \param[out] args The args structure to parse into.
  640. * \retval zero on success
  641. * \retval non-zero on failure
  642. */
  643. int ast_ari_channels_snoop_channel_parse_body(
  644. struct ast_json *body,
  645. struct ast_ari_channels_snoop_channel_args *args);
  646. /*!
  647. * \brief Start snooping.
  648. *
  649. * Snoop (spy/whisper) on a specific channel.
  650. *
  651. * \param headers HTTP headers
  652. * \param args Swagger parameters
  653. * \param[out] response HTTP response
  654. */
  655. void ast_ari_channels_snoop_channel(struct ast_variable *headers, struct ast_ari_channels_snoop_channel_args *args, struct ast_ari_response *response);
  656. /*! Argument struct for ast_ari_channels_snoop_channel_with_id() */
  657. struct ast_ari_channels_snoop_channel_with_id_args {
  658. /*! Channel's id */
  659. const char *channel_id;
  660. /*! Unique ID to assign to snooping channel */
  661. const char *snoop_id;
  662. /*! Direction of audio to spy on */
  663. const char *spy;
  664. /*! Direction of audio to whisper into */
  665. const char *whisper;
  666. /*! Application the snooping channel is placed into */
  667. const char *app;
  668. /*! The application arguments to pass to the Stasis application */
  669. const char *app_args;
  670. };
  671. /*!
  672. * \brief Body parsing function for /channels/{channelId}/snoop/{snoopId}.
  673. * \param body The JSON body from which to parse parameters.
  674. * \param[out] args The args structure to parse into.
  675. * \retval zero on success
  676. * \retval non-zero on failure
  677. */
  678. int ast_ari_channels_snoop_channel_with_id_parse_body(
  679. struct ast_json *body,
  680. struct ast_ari_channels_snoop_channel_with_id_args *args);
  681. /*!
  682. * \brief Start snooping.
  683. *
  684. * Snoop (spy/whisper) on a specific channel.
  685. *
  686. * \param headers HTTP headers
  687. * \param args Swagger parameters
  688. * \param[out] response HTTP response
  689. */
  690. void ast_ari_channels_snoop_channel_with_id(struct ast_variable *headers, struct ast_ari_channels_snoop_channel_with_id_args *args, struct ast_ari_response *response);
  691. #endif /* _ASTERISK_RESOURCE_CHANNELS_H */