ari/pjsip: Make it possible to control transfers through ARI

Introduce a ChannelTransfer event and the ability to notify progress to
ARI. Implement emitting this event from the PJSIP channel instead of
handling the transfer in Asterisk when configured.

Introduce a dialplan function to the PJSIP channel to switch between the
"core" and "ari-only" behavior.

UserNote: Call transfers on the PJSIP channel can now be controlled by
ARI. This can be enabled by using the PJSIP_TRANSFER_HANDLING(ari-only)
dialplan function.

(cherry picked from commit 71eb8a262f)
This commit is contained in:
Holger Hans Peter Freyther
2024-06-15 16:01:58 +08:00
committed by Asterisk Development Team
parent 007e281313
commit 0e8bde6bde
18 changed files with 1462 additions and 6 deletions

View File

@@ -870,5 +870,31 @@ int ast_ari_channels_external_media_parse_body(
* \param[out] response HTTP response
*/
void ast_ari_channels_external_media(struct ast_variable *headers, struct ast_ari_channels_external_media_args *args, struct ast_ari_response *response);
/*! Argument struct for ast_ari_channels_transfer_progress() */
struct ast_ari_channels_transfer_progress_args {
/*! Channel's id */
const char *channel_id;
/*! The state of the progress */
const char *states;
};
/*!
* \brief Body parsing function for /channels/{channelId}/transfer_progress.
* \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_transfer_progress_parse_body(
struct ast_json *body,
struct ast_ari_channels_transfer_progress_args *args);
/*!
* \brief Inform the channel about the progress of the attended/blind transfer.
*
* \param headers HTTP headers
* \param args Swagger parameters
* \param[out] response HTTP response
*/
void ast_ari_channels_transfer_progress(struct ast_variable *headers, struct ast_ari_channels_transfer_progress_args *args, struct ast_ari_response *response);
#endif /* _ASTERISK_RESOURCE_CHANNELS_H */