Asterisk - The Open Source Telephony Project GIT-master-0deac78
resource_channels.h
Go to the documentation of this file.
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
19/*! \file
20 *
21 * \brief Generated file - declares stubs to be implemented in
22 * res/ari/resource_channels.c
23 *
24 * Channel resources
25 *
26 * \author David M. Lee, II <dlee@digium.com>
27 */
28
29/*
30 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
31 * !!!!! DO NOT EDIT !!!!!
32 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33 * This file is generated by a mustache template. Please see the original
34 * template in rest-api-templates/ari_resource.h.mustache
35 */
36
37#ifndef _ASTERISK_RESOURCE_CHANNELS_H
38#define _ASTERISK_RESOURCE_CHANNELS_H
39
40#include "asterisk/ari.h"
41
42/*! Argument struct for ast_ari_channels_list() */
44};
45/*!
46 * \brief List all active channels in Asterisk.
47 *
48 * \param headers HTTP headers
49 * \param args Swagger parameters
50 * \param[out] response HTTP response
51 */
52void ast_ari_channels_list(struct ast_variable *headers, struct ast_ari_channels_list_args *args, struct ast_ari_response *response);
53/*! Argument struct for ast_ari_channels_originate() */
55 /*! Endpoint to call. */
56 const char *endpoint;
57 /*! The extension to dial after the endpoint answers. Mutually exclusive with 'app'. */
58 const char *extension;
59 /*! The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'. */
60 const char *context;
61 /*! The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'. */
63 /*! The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'. */
64 const char *label;
65 /*! 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'. */
66 const char *app;
67 /*! The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */
68 const char *app_args;
69 /*! CallerID to use when dialing the endpoint or extension. */
70 const char *caller_id;
71 /*! Timeout (in seconds) before giving up dialing, or -1 for no timeout. */
73 /*! 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" } } */
75 /*! The unique id to assign the channel on creation. */
76 const char *channel_id;
77 /*! The unique id to assign the second channel when using local channels. */
78 const char *other_channel_id;
79 /*! The unique id of the channel which is originating this one. */
80 const char *originator;
81 /*! The format name capability list to use if originator is not specified. Ex. "ulaw,slin16". Format names can be found with "core show codecs". */
82 const char *formats;
83};
84/*!
85 * \brief Body parsing function for /channels.
86 * \param body The JSON body from which to parse parameters.
87 * \param[out] args The args structure to parse into.
88 * \retval zero on success
89 * \retval non-zero on failure
90 */
92 struct ast_json *body,
94
95/*!
96 * \brief Create a new channel (originate).
97 *
98 * 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.
99 *
100 * \param headers HTTP headers
101 * \param args Swagger parameters
102 * \param[out] response HTTP response
103 */
105/*! Argument struct for ast_ari_channels_create() */
107 /*! Endpoint for channel communication */
108 const char *endpoint;
109 /*! Stasis Application to place channel into */
110 const char *app;
111 /*! The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */
112 const char *app_args;
113 /*! The unique id to assign the channel on creation. */
114 const char *channel_id;
115 /*! The unique id to assign the second channel when using local channels. */
116 const char *other_channel_id;
117 /*! Unique ID of the calling channel */
118 const char *originator;
119 /*! The format name capability list to use if originator is not specified. Ex. "ulaw,slin16". Format names can be found with "core show codecs". */
120 const char *formats;
121 /*! 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" } } */
123};
124/*!
125 * \brief Body parsing function for /channels/create.
126 * \param body The JSON body from which to parse parameters.
127 * \param[out] args The args structure to parse into.
128 * \retval zero on success
129 * \retval non-zero on failure
130 */
132 struct ast_json *body,
134
135/*!
136 * \brief Create channel.
137 *
138 * \param headers HTTP headers
139 * \param args Swagger parameters
140 * \param[out] response HTTP response
141 */
142void ast_ari_channels_create(struct ast_variable *headers, struct ast_ari_channels_create_args *args, struct ast_ari_response *response);
143/*! Argument struct for ast_ari_channels_get() */
145 /*! Channel's id */
146 const char *channel_id;
147};
148/*!
149 * \brief Channel details.
150 *
151 * \param headers HTTP headers
152 * \param args Swagger parameters
153 * \param[out] response HTTP response
154 */
155void ast_ari_channels_get(struct ast_variable *headers, struct ast_ari_channels_get_args *args, struct ast_ari_response *response);
156/*! Argument struct for ast_ari_channels_originate_with_id() */
158 /*! The unique id to assign the channel on creation. */
159 const char *channel_id;
160 /*! Endpoint to call. */
161 const char *endpoint;
162 /*! The extension to dial after the endpoint answers. Mutually exclusive with 'app'. */
163 const char *extension;
164 /*! The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'. */
165 const char *context;
166 /*! The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'. */
168 /*! The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'. */
169 const char *label;
170 /*! 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'. */
171 const char *app;
172 /*! The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */
173 const char *app_args;
174 /*! CallerID to use when dialing the endpoint or extension. */
175 const char *caller_id;
176 /*! Timeout (in seconds) before giving up dialing, or -1 for no timeout. */
178 /*! 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" } } */
180 /*! The unique id to assign the second channel when using local channels. */
181 const char *other_channel_id;
182 /*! The unique id of the channel which is originating this one. */
183 const char *originator;
184 /*! The format name capability list to use if originator is not specified. Ex. "ulaw,slin16". Format names can be found with "core show codecs". */
185 const char *formats;
186};
187/*!
188 * \brief Body parsing function for /channels/{channelId}.
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 */
195 struct ast_json *body,
197
198/*!
199 * \brief Create a new channel (originate with id).
200 *
201 * 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.
202 *
203 * \param headers HTTP headers
204 * \param args Swagger parameters
205 * \param[out] response HTTP response
206 */
208/*! Argument struct for ast_ari_channels_hangup() */
210 /*! Channel's id */
211 const char *channel_id;
212 /*! The reason code for hanging up the channel for detail use. Mutually exclusive with 'reason'. See detail hangup codes at here. https://docs.asterisk.org/Configuration/Miscellaneous/Hangup-Cause-Mappings/ */
213 const char *reason_code;
214 /*! Reason for hanging up the channel for simple use. Mutually exclusive with 'reason_code'. */
215 const char *reason;
216};
217/*!
218 * \brief Body parsing function for /channels/{channelId}.
219 * \param body The JSON body from which to parse parameters.
220 * \param[out] args The args structure to parse into.
221 * \retval zero on success
222 * \retval non-zero on failure
223 */
225 struct ast_json *body,
227
228/*!
229 * \brief Delete (i.e. hangup) a channel.
230 *
231 * \param headers HTTP headers
232 * \param args Swagger parameters
233 * \param[out] response HTTP response
234 */
235void ast_ari_channels_hangup(struct ast_variable *headers, struct ast_ari_channels_hangup_args *args, struct ast_ari_response *response);
236/*! Argument struct for ast_ari_channels_continue_in_dialplan() */
238 /*! Channel's id */
239 const char *channel_id;
240 /*! The context to continue to. */
241 const char *context;
242 /*! The extension to continue to. */
243 const char *extension;
244 /*! The priority to continue to. */
246 /*! The label to continue to - will supersede 'priority' if both are provided. */
247 const char *label;
248};
249/*!
250 * \brief Body parsing function for /channels/{channelId}/continue.
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 */
257 struct ast_json *body,
259
260/*!
261 * \brief Exit application; continue execution in the dialplan.
262 *
263 * \param headers HTTP headers
264 * \param args Swagger parameters
265 * \param[out] response HTTP response
266 */
268/*! Argument struct for ast_ari_channels_move() */
270 /*! Channel's id */
271 const char *channel_id;
272 /*! The channel will be passed to this Stasis application. */
273 const char *app;
274 /*! The application arguments to pass to the Stasis application provided by 'app'. */
275 const char *app_args;
276};
277/*!
278 * \brief Body parsing function for /channels/{channelId}/move.
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 */
285 struct ast_json *body,
287
288/*!
289 * \brief Move the channel from one Stasis application to another.
290 *
291 * \param headers HTTP headers
292 * \param args Swagger parameters
293 * \param[out] response HTTP response
294 */
295void ast_ari_channels_move(struct ast_variable *headers, struct ast_ari_channels_move_args *args, struct ast_ari_response *response);
296/*! Argument struct for ast_ari_channels_redirect() */
298 /*! Channel's id */
299 const char *channel_id;
300 /*! The endpoint to redirect the channel to */
301 const char *endpoint;
302};
303/*!
304 * \brief Body parsing function for /channels/{channelId}/redirect.
305 * \param body The JSON body from which to parse parameters.
306 * \param[out] args The args structure to parse into.
307 * \retval zero on success
308 * \retval non-zero on failure
309 */
311 struct ast_json *body,
313
314/*!
315 * \brief Redirect the channel to a different location.
316 *
317 * \param headers HTTP headers
318 * \param args Swagger parameters
319 * \param[out] response HTTP response
320 */
321void ast_ari_channels_redirect(struct ast_variable *headers, struct ast_ari_channels_redirect_args *args, struct ast_ari_response *response);
322/*! Argument struct for ast_ari_channels_answer() */
324 /*! Channel's id */
325 const char *channel_id;
326};
327/*!
328 * \brief Answer a channel.
329 *
330 * \param headers HTTP headers
331 * \param args Swagger parameters
332 * \param[out] response HTTP response
333 */
334void ast_ari_channels_answer(struct ast_variable *headers, struct ast_ari_channels_answer_args *args, struct ast_ari_response *response);
335/*! Argument struct for ast_ari_channels_ring() */
337 /*! Channel's id */
338 const char *channel_id;
339};
340/*!
341 * \brief Indicate ringing to a channel.
342 *
343 * \param headers HTTP headers
344 * \param args Swagger parameters
345 * \param[out] response HTTP response
346 */
347void ast_ari_channels_ring(struct ast_variable *headers, struct ast_ari_channels_ring_args *args, struct ast_ari_response *response);
348/*! Argument struct for ast_ari_channels_ring_stop() */
350 /*! Channel's id */
351 const char *channel_id;
352};
353/*!
354 * \brief Stop ringing indication on a channel if locally generated.
355 *
356 * \param headers HTTP headers
357 * \param args Swagger parameters
358 * \param[out] response HTTP response
359 */
361/*! Argument struct for ast_ari_channels_progress() */
363 /*! Channel's id */
364 const char *channel_id;
365};
366/*!
367 * \brief Indicate progress on a channel.
368 *
369 * \param headers HTTP headers
370 * \param args Swagger parameters
371 * \param[out] response HTTP response
372 */
373void ast_ari_channels_progress(struct ast_variable *headers, struct ast_ari_channels_progress_args *args, struct ast_ari_response *response);
374/*! Argument struct for ast_ari_channels_send_dtmf() */
376 /*! Channel's id */
377 const char *channel_id;
378 /*! DTMF To send. */
379 const char *dtmf;
380 /*! Amount of time to wait before DTMF digits (specified in milliseconds) start. */
382 /*! Amount of time in between DTMF digits (specified in milliseconds). */
384 /*! Length of each DTMF digit (specified in milliseconds). */
386 /*! Amount of time to wait after DTMF digits (specified in milliseconds) end. */
387 int after;
388};
389/*!
390 * \brief Body parsing function for /channels/{channelId}/dtmf.
391 * \param body The JSON body from which to parse parameters.
392 * \param[out] args The args structure to parse into.
393 * \retval zero on success
394 * \retval non-zero on failure
395 */
397 struct ast_json *body,
399
400/*!
401 * \brief Send provided DTMF to a given channel.
402 *
403 * \param headers HTTP headers
404 * \param args Swagger parameters
405 * \param[out] response HTTP response
406 */
408/*! Argument struct for ast_ari_channels_mute() */
410 /*! Channel's id */
411 const char *channel_id;
412 /*! Direction in which to mute audio */
413 const char *direction;
414};
415/*!
416 * \brief Body parsing function for /channels/{channelId}/mute.
417 * \param body The JSON body from which to parse parameters.
418 * \param[out] args The args structure to parse into.
419 * \retval zero on success
420 * \retval non-zero on failure
421 */
423 struct ast_json *body,
425
426/*!
427 * \brief Mute a channel.
428 *
429 * \param headers HTTP headers
430 * \param args Swagger parameters
431 * \param[out] response HTTP response
432 */
433void ast_ari_channels_mute(struct ast_variable *headers, struct ast_ari_channels_mute_args *args, struct ast_ari_response *response);
434/*! Argument struct for ast_ari_channels_unmute() */
436 /*! Channel's id */
437 const char *channel_id;
438 /*! Direction in which to unmute audio */
439 const char *direction;
440};
441/*!
442 * \brief Body parsing function for /channels/{channelId}/mute.
443 * \param body The JSON body from which to parse parameters.
444 * \param[out] args The args structure to parse into.
445 * \retval zero on success
446 * \retval non-zero on failure
447 */
449 struct ast_json *body,
451
452/*!
453 * \brief Unmute a channel.
454 *
455 * \param headers HTTP headers
456 * \param args Swagger parameters
457 * \param[out] response HTTP response
458 */
459void ast_ari_channels_unmute(struct ast_variable *headers, struct ast_ari_channels_unmute_args *args, struct ast_ari_response *response);
460/*! Argument struct for ast_ari_channels_hold() */
462 /*! Channel's id */
463 const char *channel_id;
464};
465/*!
466 * \brief Hold a channel.
467 *
468 * \param headers HTTP headers
469 * \param args Swagger parameters
470 * \param[out] response HTTP response
471 */
472void ast_ari_channels_hold(struct ast_variable *headers, struct ast_ari_channels_hold_args *args, struct ast_ari_response *response);
473/*! Argument struct for ast_ari_channels_unhold() */
475 /*! Channel's id */
476 const char *channel_id;
477};
478/*!
479 * \brief Remove a channel from hold.
480 *
481 * \param headers HTTP headers
482 * \param args Swagger parameters
483 * \param[out] response HTTP response
484 */
485void ast_ari_channels_unhold(struct ast_variable *headers, struct ast_ari_channels_unhold_args *args, struct ast_ari_response *response);
486/*! Argument struct for ast_ari_channels_start_moh() */
488 /*! Channel's id */
489 const char *channel_id;
490 /*! Music on hold class to use */
491 const char *moh_class;
492};
493/*!
494 * \brief Body parsing function for /channels/{channelId}/moh.
495 * \param body The JSON body from which to parse parameters.
496 * \param[out] args The args structure to parse into.
497 * \retval zero on success
498 * \retval non-zero on failure
499 */
501 struct ast_json *body,
503
504/*!
505 * \brief Play music on hold to a channel.
506 *
507 * 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.
508 *
509 * \param headers HTTP headers
510 * \param args Swagger parameters
511 * \param[out] response HTTP response
512 */
514/*! Argument struct for ast_ari_channels_stop_moh() */
516 /*! Channel's id */
517 const char *channel_id;
518};
519/*!
520 * \brief Stop playing music on hold to a channel.
521 *
522 * \param headers HTTP headers
523 * \param args Swagger parameters
524 * \param[out] response HTTP response
525 */
526void ast_ari_channels_stop_moh(struct ast_variable *headers, struct ast_ari_channels_stop_moh_args *args, struct ast_ari_response *response);
527/*! Argument struct for ast_ari_channels_start_silence() */
529 /*! Channel's id */
530 const char *channel_id;
531};
532/*!
533 * \brief Play silence to a channel.
534 *
535 * Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.
536 *
537 * \param headers HTTP headers
538 * \param args Swagger parameters
539 * \param[out] response HTTP response
540 */
542/*! Argument struct for ast_ari_channels_stop_silence() */
544 /*! Channel's id */
545 const char *channel_id;
546};
547/*!
548 * \brief Stop playing silence to a channel.
549 *
550 * \param headers HTTP headers
551 * \param args Swagger parameters
552 * \param[out] response HTTP response
553 */
555/*! Argument struct for ast_ari_channels_play() */
557 /*! Channel's id */
558 const char *channel_id;
559 /*! Array of Media URIs to play. */
560 const char **media;
561 /*! Length of media array. */
563 /*! Parsing context for media. */
565 /*! For sounds, selects language for sound. */
566 const char *lang;
567 /*! Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified. */
569 /*! Number of milliseconds to skip for forward/reverse operations. */
571 /*! Playback ID. */
572 const char *playback_id;
573};
574/*!
575 * \brief Body parsing function for /channels/{channelId}/play.
576 * \param body The JSON body from which to parse parameters.
577 * \param[out] args The args structure to parse into.
578 * \retval zero on success
579 * \retval non-zero on failure
580 */
582 struct ast_json *body,
584
585/*!
586 * \brief Start playback of media.
587 *
588 * 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.)
589 *
590 * \param headers HTTP headers
591 * \param args Swagger parameters
592 * \param[out] response HTTP response
593 */
594void ast_ari_channels_play(struct ast_variable *headers, struct ast_ari_channels_play_args *args, struct ast_ari_response *response);
595/*! Argument struct for ast_ari_channels_play_with_id() */
597 /*! Channel's id */
598 const char *channel_id;
599 /*! Playback ID. */
600 const char *playback_id;
601 /*! Array of Media URIs to play. */
602 const char **media;
603 /*! Length of media array. */
605 /*! Parsing context for media. */
607 /*! For sounds, selects language for sound. */
608 const char *lang;
609 /*! Number of milliseconds to skip before playing. Only applies to the first URI if multiple media URIs are specified. */
611 /*! Number of milliseconds to skip for forward/reverse operations. */
613};
614/*!
615 * \brief Body parsing function for /channels/{channelId}/play/{playbackId}.
616 * \param body The JSON body from which to parse parameters.
617 * \param[out] args The args structure to parse into.
618 * \retval zero on success
619 * \retval non-zero on failure
620 */
622 struct ast_json *body,
624
625/*!
626 * \brief Start playback of media and specify the playbackId.
627 *
628 * 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.)
629 *
630 * \param headers HTTP headers
631 * \param args Swagger parameters
632 * \param[out] response HTTP response
633 */
635/*! Argument struct for ast_ari_channels_record() */
637 /*! Channel's id */
638 const char *channel_id;
639 /*! Recording's filename */
640 const char *name;
641 /*! Format to encode audio in */
642 const char *format;
643 /*! Maximum duration of the recording, in seconds. 0 for no limit */
645 /*! Maximum duration of silence, in seconds. 0 for no limit */
647 /*! Action to take if a recording with the same name already exists. */
648 const char *if_exists;
649 /*! Play beep when recording begins */
650 int beep;
651 /*! DTMF input to terminate recording */
652 const char *terminate_on;
653};
654/*!
655 * \brief Body parsing function for /channels/{channelId}/record.
656 * \param body The JSON body from which to parse parameters.
657 * \param[out] args The args structure to parse into.
658 * \retval zero on success
659 * \retval non-zero on failure
660 */
662 struct ast_json *body,
664
665/*!
666 * \brief Start a recording.
667 *
668 * 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.
669 *
670 * \param headers HTTP headers
671 * \param args Swagger parameters
672 * \param[out] response HTTP response
673 */
674void ast_ari_channels_record(struct ast_variable *headers, struct ast_ari_channels_record_args *args, struct ast_ari_response *response);
675/*! Argument struct for ast_ari_channels_get_channel_var() */
677 /*! Channel's id */
678 const char *channel_id;
679 /*! The channel variable or function to get */
680 const char *variable;
681};
682/*!
683 * \brief Body parsing function for /channels/{channelId}/variable.
684 * \param body The JSON body from which to parse parameters.
685 * \param[out] args The args structure to parse into.
686 * \retval zero on success
687 * \retval non-zero on failure
688 */
690 struct ast_json *body,
692
693/*!
694 * \brief Get the value of a channel variable or function.
695 *
696 * \param headers HTTP headers
697 * \param args Swagger parameters
698 * \param[out] response HTTP response
699 */
701/*! Argument struct for ast_ari_channels_set_channel_var() */
703 /*! Channel's id */
704 const char *channel_id;
705 /*! The channel variable or function to set */
706 const char *variable;
707 /*! The value to set the variable to */
708 const char *value;
709};
710/*!
711 * \brief Body parsing function for /channels/{channelId}/variable.
712 * \param body The JSON body from which to parse parameters.
713 * \param[out] args The args structure to parse into.
714 * \retval zero on success
715 * \retval non-zero on failure
716 */
718 struct ast_json *body,
720
721/*!
722 * \brief Set the value of a channel variable or function.
723 *
724 * \param headers HTTP headers
725 * \param args Swagger parameters
726 * \param[out] response HTTP response
727 */
729/*! Argument struct for ast_ari_channels_snoop_channel() */
731 /*! Channel's id */
732 const char *channel_id;
733 /*! Direction of audio to spy on */
734 const char *spy;
735 /*! Direction of audio to whisper into */
736 const char *whisper;
737 /*! Application the snooping channel is placed into */
738 const char *app;
739 /*! The application arguments to pass to the Stasis application */
740 const char *app_args;
741 /*! Unique ID to assign to snooping channel */
742 const char *snoop_id;
743};
744/*!
745 * \brief Body parsing function for /channels/{channelId}/snoop.
746 * \param body The JSON body from which to parse parameters.
747 * \param[out] args The args structure to parse into.
748 * \retval zero on success
749 * \retval non-zero on failure
750 */
752 struct ast_json *body,
754
755/*!
756 * \brief Start snooping.
757 *
758 * Snoop (spy/whisper) on a specific channel.
759 *
760 * \param headers HTTP headers
761 * \param args Swagger parameters
762 * \param[out] response HTTP response
763 */
765/*! Argument struct for ast_ari_channels_snoop_channel_with_id() */
767 /*! Channel's id */
768 const char *channel_id;
769 /*! Unique ID to assign to snooping channel */
770 const char *snoop_id;
771 /*! Direction of audio to spy on */
772 const char *spy;
773 /*! Direction of audio to whisper into */
774 const char *whisper;
775 /*! Application the snooping channel is placed into */
776 const char *app;
777 /*! The application arguments to pass to the Stasis application */
778 const char *app_args;
779};
780/*!
781 * \brief Body parsing function for /channels/{channelId}/snoop/{snoopId}.
782 * \param body The JSON body from which to parse parameters.
783 * \param[out] args The args structure to parse into.
784 * \retval zero on success
785 * \retval non-zero on failure
786 */
788 struct ast_json *body,
790
791/*!
792 * \brief Start snooping.
793 *
794 * Snoop (spy/whisper) on a specific channel.
795 *
796 * \param headers HTTP headers
797 * \param args Swagger parameters
798 * \param[out] response HTTP response
799 */
801/*! Argument struct for ast_ari_channels_dial() */
803 /*! Channel's id */
804 const char *channel_id;
805 /*! Channel ID of caller */
806 const char *caller;
807 /*! Dial timeout */
809};
810/*!
811 * \brief Body parsing function for /channels/{channelId}/dial.
812 * \param body The JSON body from which to parse parameters.
813 * \param[out] args The args structure to parse into.
814 * \retval zero on success
815 * \retval non-zero on failure
816 */
818 struct ast_json *body,
820
821/*!
822 * \brief Dial a created channel.
823 *
824 * \param headers HTTP headers
825 * \param args Swagger parameters
826 * \param[out] response HTTP response
827 */
828void ast_ari_channels_dial(struct ast_variable *headers, struct ast_ari_channels_dial_args *args, struct ast_ari_response *response);
829/*! Argument struct for ast_ari_channels_rtpstatistics() */
831 /*! Channel's id */
832 const char *channel_id;
833};
834/*!
835 * \brief RTP stats on a channel.
836 *
837 * \param headers HTTP headers
838 * \param args Swagger parameters
839 * \param[out] response HTTP response
840 */
842/*! Argument struct for ast_ari_channels_external_media() */
844 /*! The unique id to assign the channel on creation. */
845 const char *channel_id;
846 /*! Stasis Application to place channel into */
847 const char *app;
848 /*! 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" } } */
850 /*! Hostname/ip:port or websocket_client connection ID of external host. May be empty for a websocket server connection. */
851 const char *external_host;
852 /*! Payload encapsulation protocol. Must be 'none' for the websocket transport. */
853 const char *encapsulation;
854 /*! Transport protocol */
855 const char *transport;
856 /*! Connection type (client/server). 'server' is only valid for the websocket transport. */
857 const char *connection_type;
858 /*! Format to encode audio in */
859 const char *format;
860 /*! External media direction */
861 const char *direction;
862 /*! An arbitrary data field */
863 const char *data;
864};
865/*!
866 * \brief Body parsing function for /channels/externalMedia.
867 * \param body The JSON body from which to parse parameters.
868 * \param[out] args The args structure to parse into.
869 * \retval zero on success
870 * \retval non-zero on failure
871 */
873 struct ast_json *body,
875
876/*!
877 * \brief Start an External Media session.
878 *
879 * Create a channel to an External Media source/sink. The combination of transport and encapsulation will select one of chan_rtp(udp/rtp), chan_audiosocket(tcp/audiosocket) or chan_websocket(websocket/none) channel drivers.
880 *
881 * \param headers HTTP headers
882 * \param args Swagger parameters
883 * \param[out] response HTTP response
884 */
886/*! Argument struct for ast_ari_channels_transfer_progress() */
888 /*! Channel's id */
889 const char *channel_id;
890 /*! The state of the progress */
891 const char *states;
892};
893/*!
894 * \brief Body parsing function for /channels/{channelId}/transfer_progress.
895 * \param body The JSON body from which to parse parameters.
896 * \param[out] args The args structure to parse into.
897 * \retval zero on success
898 * \retval non-zero on failure
899 */
901 struct ast_json *body,
903
904/*!
905 * \brief Inform the channel about the progress of the attended/blind transfer.
906 *
907 * \param headers HTTP headers
908 * \param args Swagger parameters
909 * \param[out] response HTTP response
910 */
912
913#endif /* _ASTERISK_RESOURCE_CHANNELS_H */
Asterisk RESTful API hooks.
int ast_ari_channels_move_parse_body(struct ast_json *body, struct ast_ari_channels_move_args *args)
Body parsing function for /channels/{channelId}/move.
int ast_ari_channels_send_dtmf_parse_body(struct ast_json *body, struct ast_ari_channels_send_dtmf_args *args)
Body parsing function for /channels/{channelId}/dtmf.
int ast_ari_channels_dial_parse_body(struct ast_json *body, struct ast_ari_channels_dial_args *args)
Body parsing function for /channels/{channelId}/dial.
int ast_ari_channels_unmute_parse_body(struct ast_json *body, struct ast_ari_channels_unmute_args *args)
Body parsing function for /channels/{channelId}/mute.
int ast_ari_channels_get_channel_var_parse_body(struct ast_json *body, struct ast_ari_channels_get_channel_var_args *args)
Body parsing function for /channels/{channelId}/variable.
void ast_ari_channels_mute(struct ast_variable *headers, struct ast_ari_channels_mute_args *args, struct ast_ari_response *response)
Mute a channel.
int ast_ari_channels_snoop_channel_with_id_parse_body(struct ast_json *body, struct ast_ari_channels_snoop_channel_with_id_args *args)
Body parsing function for /channels/{channelId}/snoop/{snoopId}.
int ast_ari_channels_mute_parse_body(struct ast_json *body, struct ast_ari_channels_mute_args *args)
Body parsing function for /channels/{channelId}/mute.
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)
Start snooping.
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)
Exit application; continue execution in the dialplan.
void ast_ari_channels_start_moh(struct ast_variable *headers, struct ast_ari_channels_start_moh_args *args, struct ast_ari_response *response)
Play music on hold to a channel.
int ast_ari_channels_redirect_parse_body(struct ast_json *body, struct ast_ari_channels_redirect_args *args)
Body parsing function for /channels/{channelId}/redirect.
int ast_ari_channels_record_parse_body(struct ast_json *body, struct ast_ari_channels_record_args *args)
Body parsing function for /channels/{channelId}/record.
int ast_ari_channels_transfer_progress_parse_body(struct ast_json *body, struct ast_ari_channels_transfer_progress_args *args)
Body parsing function for /channels/{channelId}/transfer_progress.
int ast_ari_channels_snoop_channel_parse_body(struct ast_json *body, struct ast_ari_channels_snoop_channel_args *args)
Body parsing function for /channels/{channelId}/snoop.
void ast_ari_channels_stop_moh(struct ast_variable *headers, struct ast_ari_channels_stop_moh_args *args, struct ast_ari_response *response)
Stop playing music on hold to a channel.
void ast_ari_channels_move(struct ast_variable *headers, struct ast_ari_channels_move_args *args, struct ast_ari_response *response)
Move the channel from one Stasis application to another.
void ast_ari_channels_send_dtmf(struct ast_variable *headers, struct ast_ari_channels_send_dtmf_args *args, struct ast_ari_response *response)
Send provided DTMF to a given channel.
void ast_ari_channels_unmute(struct ast_variable *headers, struct ast_ari_channels_unmute_args *args, struct ast_ari_response *response)
Unmute a channel.
void ast_ari_channels_dial(struct ast_variable *headers, struct ast_ari_channels_dial_args *args, struct ast_ari_response *response)
Dial a created channel.
void ast_ari_channels_create(struct ast_variable *headers, struct ast_ari_channels_create_args *args, struct ast_ari_response *response)
Create channel.
void ast_ari_channels_list(struct ast_variable *headers, struct ast_ari_channels_list_args *args, struct ast_ari_response *response)
List all active channels in Asterisk.
void ast_ari_channels_get(struct ast_variable *headers, struct ast_ari_channels_get_args *args, struct ast_ari_response *response)
Channel details.
void ast_ari_channels_snoop_channel(struct ast_variable *headers, struct ast_ari_channels_snoop_channel_args *args, struct ast_ari_response *response)
Start snooping.
void ast_ari_channels_transfer_progress(struct ast_variable *headers, struct ast_ari_channels_transfer_progress_args *args, struct ast_ari_response *response)
Inform the channel about the progress of the attended/blind transfer.
int ast_ari_channels_continue_in_dialplan_parse_body(struct ast_json *body, struct ast_ari_channels_continue_in_dialplan_args *args)
Body parsing function for /channels/{channelId}/continue.
void ast_ari_channels_ring(struct ast_variable *headers, struct ast_ari_channels_ring_args *args, struct ast_ari_response *response)
Indicate ringing to a channel.
void ast_ari_channels_play(struct ast_variable *headers, struct ast_ari_channels_play_args *args, struct ast_ari_response *response)
Start playback of media.
void ast_ari_channels_stop_silence(struct ast_variable *headers, struct ast_ari_channels_stop_silence_args *args, struct ast_ari_response *response)
Stop playing silence to a channel.
int ast_ari_channels_originate_with_id_parse_body(struct ast_json *body, struct ast_ari_channels_originate_with_id_args *args)
Body parsing function for /channels/{channelId}.
void ast_ari_channels_external_media(struct ast_variable *headers, struct ast_ari_channels_external_media_args *args, struct ast_ari_response *response)
Start an External Media session.
void ast_ari_channels_ring_stop(struct ast_variable *headers, struct ast_ari_channels_ring_stop_args *args, struct ast_ari_response *response)
Stop ringing indication on a channel if locally generated.
int ast_ari_channels_play_with_id_parse_body(struct ast_json *body, struct ast_ari_channels_play_with_id_args *args)
Body parsing function for /channels/{channelId}/play/{playbackId}.
void ast_ari_channels_progress(struct ast_variable *headers, struct ast_ari_channels_progress_args *args, struct ast_ari_response *response)
Indicate progress on a channel.
int ast_ari_channels_create_parse_body(struct ast_json *body, struct ast_ari_channels_create_args *args)
Body parsing function for /channels/create.
void ast_ari_channels_start_silence(struct ast_variable *headers, struct ast_ari_channels_start_silence_args *args, struct ast_ari_response *response)
Play silence to a channel.
int ast_ari_channels_external_media_parse_body(struct ast_json *body, struct ast_ari_channels_external_media_args *args)
Body parsing function for /channels/externalMedia.
void ast_ari_channels_unhold(struct ast_variable *headers, struct ast_ari_channels_unhold_args *args, struct ast_ari_response *response)
Remove a channel from hold.
void ast_ari_channels_originate(struct ast_variable *headers, struct ast_ari_channels_originate_args *args, struct ast_ari_response *response)
Create a new channel (originate).
int ast_ari_channels_play_parse_body(struct ast_json *body, struct ast_ari_channels_play_args *args)
Body parsing function for /channels/{channelId}/play.
void ast_ari_channels_redirect(struct ast_variable *headers, struct ast_ari_channels_redirect_args *args, struct ast_ari_response *response)
Redirect the channel to a different location.
int ast_ari_channels_set_channel_var_parse_body(struct ast_json *body, struct ast_ari_channels_set_channel_var_args *args)
Body parsing function for /channels/{channelId}/variable.
void ast_ari_channels_record(struct ast_variable *headers, struct ast_ari_channels_record_args *args, struct ast_ari_response *response)
Start a recording.
int ast_ari_channels_start_moh_parse_body(struct ast_json *body, struct ast_ari_channels_start_moh_args *args)
Body parsing function for /channels/{channelId}/moh.
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)
Set the value of a channel variable or function.
void ast_ari_channels_hold(struct ast_variable *headers, struct ast_ari_channels_hold_args *args, struct ast_ari_response *response)
Hold a channel.
void ast_ari_channels_answer(struct ast_variable *headers, struct ast_ari_channels_answer_args *args, struct ast_ari_response *response)
Answer a channel.
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)
Start playback of media and specify the playbackId.
void ast_ari_channels_rtpstatistics(struct ast_variable *headers, struct ast_ari_channels_rtpstatistics_args *args, struct ast_ari_response *response)
RTP stats on a channel.
int ast_ari_channels_originate_parse_body(struct ast_json *body, struct ast_ari_channels_originate_args *args)
Body parsing function for /channels.
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)
Get the value of a channel variable or function.
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)
Create a new channel (originate with id).
void ast_ari_channels_hangup(struct ast_variable *headers, struct ast_ari_channels_hangup_args *args, struct ast_ari_response *response)
Delete (i.e. hangup) a channel.
int ast_ari_channels_hangup_parse_body(struct ast_json *body, struct ast_ari_channels_hangup_args *args)
Body parsing function for /channels/{channelId}.
Abstract JSON element (object, array, string, int, ...).
Structure for variables, used for configurations and for channel variables.
const char * args