ARI: Add method to Dial a created channel.

This adds a new ARI method that allows for you to dial a channel that
you previously created in ARI.

By combining this with the create method for channels, it allows for a
workflow where a channel can be created, manipulated, and then dialed.
The channel is under control of the ARI application during all stages of
the Dial and can even be manipulated based on channel state changes
observed within an ARI application.

The overarching goal for this is to eventually be able to add a dialed
channel to a Stasis bridge earlier than the "Up" state. However, at the
moment more work is needed in the Dial and Bridge APIs in order to
facilitate that.

ASTERISK-25889 #close

Change-Id: Ic6c399c791e66c4aa52454222fe4f8b02483a205
This commit is contained in:
Mark Michelson
2016-03-30 17:18:39 -05:00
committed by Joshua Colp
parent dd48d60c5b
commit abbb2edd4c
8 changed files with 371 additions and 104 deletions

View File

@@ -739,5 +739,33 @@ int ast_ari_channels_snoop_channel_with_id_parse_body(
* \param[out] response HTTP response
*/
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);
/*! Argument struct for ast_ari_channels_dial() */
struct ast_ari_channels_dial_args {
/*! Channel's id */
const char *channel_id;
/*! Channel ID of caller */
const char *caller;
/*! Dial timeout */
int timeout;
};
/*!
* \brief Body parsing function for /channels/{channelId}/dial.
* \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_dial_parse_body(
struct ast_json *body,
struct ast_ari_channels_dial_args *args);
/*!
* \brief Dial a created channel.
*
* \param headers HTTP headers
* \param args Swagger parameters
* \param[out] response HTTP response
*/
void ast_ari_channels_dial(struct ast_variable *headers, struct ast_ari_channels_dial_args *args, struct ast_ari_response *response);
#endif /* _ASTERISK_RESOURCE_CHANNELS_H */