Skip to content

Commit

Permalink
ari/stasis: Indicate progress before playback on a bridge
Browse files Browse the repository at this point in the history
Make it possible to start a playback and the calling party
to receive audio on a bridge before the call is connected.

Model the implementation after play_on_channel and deliver a
AST_CONTROL_PROGRESS before starting the playback.

For a PJSIP channel this will result in sending a SIP 183
Session Progress.
  • Loading branch information
zecke authored and asterisk-org-access-app[bot] committed Oct 9, 2023
1 parent 889b0aa commit b996069
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions res/ari/resource_bridges.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,12 @@ static void ari_bridges_play_new(const char **args_media,
struct bridge_channel_control_thread_data *thread_data;
pthread_t threadid;

struct ast_frame prog = {
.frametype = AST_FRAME_CONTROL,
.subclass.integer = AST_CONTROL_PROGRESS,
};


if (!(play_channel = prepare_bridge_media_channel("Announcer"))) {
ast_ari_response_error(
response, 500, "Internal Error", "Could not create playback channel");
Expand Down Expand Up @@ -472,6 +478,8 @@ static void ari_bridges_play_new(const char **args_media,
return;
}

ast_bridge_queue_everyone_else(bridge, NULL, &prog);

/* Give play_channel and control reference to the thread data */
thread_data = ast_malloc(sizeof(*thread_data) + strlen(bridge->uniqueid) + 1);
if (!thread_data) {
Expand Down

0 comments on commit b996069

Please sign in to comment.