diff options
author | Mark Michelson <mmichelson@digium.com> | 2016-03-30 17:01:28 -0500 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2016-04-05 18:14:05 -0500 |
commit | dd48d60c5ba239f76b054b1bb6c1e17c68537497 (patch) | |
tree | 9a378c75ebac49f85e22c45deef34de7b533a7b9 /res/ari/resource_channels.h | |
parent | ef4d3f132892a0ce12649bea2f325803e9ad7076 (diff) |
ARI: Add method to create a new channel.
This adds a new ARI method to the channels resource that allows for the
creation of a new channel. The channel is created and then placed into
the specified Stasis application.
This is different from the existing originate method that creates a
channel, dials it, and then places the answered channel into the
dialplan or a Stasis application. This method does not attempt to call
the channel at all. Dialing is left as a later step after channel
creation. This allows for pre-dialing channel manipulation if desired.
ASTERISK-25889
Change-Id: I3c96a0aba914b08e39f6256371a5bd4c92cbded8
Diffstat (limited to 'res/ari/resource_channels.h')
-rw-r--r-- | res/ari/resource_channels.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/res/ari/resource_channels.h b/res/ari/resource_channels.h index 4d3ad5f8b..bd34e0673 100644 --- a/res/ari/resource_channels.h +++ b/res/ari/resource_channels.h @@ -100,6 +100,40 @@ int ast_ari_channels_originate_parse_body( * \param[out] response HTTP response */ void ast_ari_channels_originate(struct ast_variable *headers, struct ast_ari_channels_originate_args *args, struct ast_ari_response *response); +/*! Argument struct for ast_ari_channels_create() */ +struct ast_ari_channels_create_args { + /*! Endpoint for channel communication */ + const char *endpoint; + /*! Stasis Application to place channel into */ + const char *app; + /*! The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'. */ + const char *app_args; + /*! The unique id to assign the channel on creation. */ + const char *channel_id; + /*! The unique id to assign the second channel when using local channels. */ + const char *other_channel_id; + /*! Unique ID of the calling channel */ + const char *originator; +}; +/*! + * \brief Body parsing function for /channels/create. + * \param body The JSON body from which to parse parameters. + * \param[out] args The args structure to parse into. + * \retval zero on success + * \retval non-zero on failure + */ +int ast_ari_channels_create_parse_body( + struct ast_json *body, + struct ast_ari_channels_create_args *args); + +/*! + * \brief Create channel. + * + * \param headers HTTP headers + * \param args Swagger parameters + * \param[out] response HTTP response + */ +void ast_ari_channels_create(struct ast_variable *headers, struct ast_ari_channels_create_args *args, struct ast_ari_response *response); /*! Argument struct for ast_ari_channels_get() */ struct ast_ari_channels_get_args { /*! Channel's id */ |