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
This commit is contained in:
Mark Michelson
2016-03-30 17:01:28 -05:00
committed by Joshua Colp
parent ef4d3f1328
commit dd48d60c5b
5 changed files with 349 additions and 2 deletions

View File

@@ -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 */