const char *prefix, *var;
+ if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) {
+ return SWITCH_STATUS_FALSE;
+ }
+
prefix = switch_channel_get_variable(channel, "sound_prefix");
if (!prefix) {
prefix = SWITCH_GLOBAL_dirs.sounds_dir;
}
- switch_core_session_get_read_impl(session, &read_impl);
-
- if (!(divisor = read_impl.actual_samples_per_second / 8000)) {
- divisor = 1;
- }
-
-
- if (!switch_channel_ready(channel)) {
+ if (!switch_channel_media_ready(channel)) {
return SWITCH_STATUS_FALSE;
}
- if (switch_channel_answer(channel) != SWITCH_STATUS_SUCCESS) {
- return SWITCH_STATUS_FALSE;
- }
+ switch_core_session_get_read_impl(session, &read_impl);
- if (!switch_channel_media_ready(channel)) {
- return SWITCH_STATUS_FALSE;
+ if (!(divisor = read_impl.actual_samples_per_second / 8000)) {
+ divisor = 1;
}
arg_recursion_check_start(args);