resource_channels.h 24 KB

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