Skip to content

Commit

Permalink
[core] Fix regression in play_and_collect_input and play_and_detect_s…
Browse files Browse the repository at this point in the history
…peech - read_frame_callback and user_data from input args was not preserved.
  • Loading branch information
crienzo authored and andywolk committed Oct 23, 2021
1 parent a617d58 commit cada5c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/switch_ivr_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -4904,6 +4904,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_and_detect_speech(switch_core_se
if (args) {
state.original_args = args;
myargs.dmachine = args->dmachine;
myargs.read_frame_callback = args->read_frame_callback;
myargs.user_data = args->user_data;
}

myargs.input_callback = play_and_detect_input_callback;
Expand Down
3 changes: 2 additions & 1 deletion src/switch_ivr_play_say.c
Original file line number Diff line number Diff line change
Expand Up @@ -3467,13 +3467,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_and_collect_input(switch_core_se
if (args) {
state.original_args = args;
myargs.dmachine = args->dmachine;
myargs.read_frame_callback = args->read_frame_callback;
myargs.user_data = args->user_data;
}

myargs.input_callback = switch_collect_input_callback;
myargs.buf = &state;
myargs.buflen = sizeof(state);


switch_set_flag(&state, SWITCH_COLLECT_INPUT_PROMPT);
status = switch_ivr_play_file(session, NULL, prompt, &myargs);
switch_clear_flag(&state, SWITCH_COLLECT_INPUT_PROMPT);
Expand Down

1 comment on commit cada5c3

@andywolk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.