res_ari_channels: Add ring operation, dtmf operation, hangup reasons, and tweak early media.

The ring operation sends ringing to the specified channel it is invoked on.
The dtmf operation can be used to send DTMF digits to the specified channel
of a specific length with a wait time in between. Finally hangup reasons
allow you to specify why a channel is being hung up (busy, congestion).

Early media behavior has also been tweaked slightly. When playing media to a channel
it will no longer automatically answer. If it has not been answered a progress indication
is sent instead.

(closes issue ASTERISK-22701)
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/2916/
........

Merged revisions 402358 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2013-11-01 14:38:21 +00:00
parent 98dea21bc1
commit 7678fd040e
7 changed files with 473 additions and 3 deletions

View File

@@ -96,6 +96,8 @@ void ast_ari_get_channel(struct ast_variable *headers, struct ast_get_channel_ar
struct ast_delete_channel_args {
/*! \brief Channel's id */
const char *channel_id;
/*! \brief Reason for hanging up the channel */
const char *reason;
};
/*!
* \brief Delete (i.e. hangup) a channel.
@@ -137,6 +139,42 @@ struct ast_answer_channel_args {
* \param[out] response HTTP response
*/
void ast_ari_answer_channel(struct ast_variable *headers, struct ast_answer_channel_args *args, struct ast_ari_response *response);
/*! \brief Argument struct for ast_ari_ring_channel() */
struct ast_ring_channel_args {
/*! \brief Channel's id */
const char *channel_id;
};
/*!
* \brief Indicate ringing to a channel.
*
* \param headers HTTP headers
* \param args Swagger parameters
* \param[out] response HTTP response
*/
void ast_ari_ring_channel(struct ast_variable *headers, struct ast_ring_channel_args *args, struct ast_ari_response *response);
/*! \brief Argument struct for ast_ari_send_dtmfchannel() */
struct ast_send_dtmfchannel_args {
/*! \brief Channel's id */
const char *channel_id;
/*! \brief DTMF To send. */
const char *dtmf;
/*! \brief Amount of time to wait before DTMF digits (specified in milliseconds) start. */
int before;
/*! \brief Amount of time in between DTMF digits (specified in milliseconds). */
int between;
/*! \brief Length of each DTMF digit (specified in milliseconds). */
int duration;
/*! \brief Amount of time to wait after DTMF digits (specified in milliseconds) end. */
int after;
};
/*!
* \brief Send provided DTMF to a given channel.
*
* \param headers HTTP headers
* \param args Swagger parameters
* \param[out] response HTTP response
*/
void ast_ari_send_dtmfchannel(struct ast_variable *headers, struct ast_send_dtmfchannel_args *args, struct ast_ari_response *response);
/*! \brief Argument struct for ast_ari_mute_channel() */
struct ast_mute_channel_args {
/*! \brief Channel's id */