[core] Add SMBF_FIRST flag which forces media bug to front of the list. Add 'f' flag to switch_ivr_displace_session to add displace as first operation on the media stream. (#76)

This commit is contained in:
Chris Rienzo
2019-12-23 23:57:23 -05:00
committed by Andrey Volk
parent 6f0ad146d2
commit 9c3f9a9a50
4 changed files with 19 additions and 7 deletions
+2 -1
View File
@@ -1894,7 +1894,8 @@ typedef enum {
SMBF_SPY_VIDEO_STREAM = (1 << 22),
SMBF_SPY_VIDEO_STREAM_BLEG = (1 << 23),
SMBF_READ_VIDEO_PATCH = (1 << 24),
SMBF_READ_TEXT_STREAM = (1 << 25)
SMBF_READ_TEXT_STREAM = (1 << 25),
SMBF_FIRST = (1 << 26)
} switch_media_bug_flag_enum_t;
typedef uint32_t switch_media_bug_flag_t;
+3 -3
View File
@@ -1,6 +1,6 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2018, Anthony Minessale II <anthm@freeswitch.org>
* Copyright (C) 2005-2019, Anthony Minessale II <anthm@freeswitch.org>
*
* Version: MPL 1.1
*
@@ -699,7 +699,7 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
fst_requires(fst_core > 1); \
fst_requires_module("mod_dptools"); \
switch_channel_set_variable(fst_channel, "detect_speech_result", ""); \
fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mr") == SWITCH_STATUS_SUCCESS); \
fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mrf") == SWITCH_STATUS_SUCCESS); \
args = switch_core_session_sprintf(fst_session, "%s detect:%s %s", prompt_filename, recognizer, grammar); \
fst_requires(switch_core_session_execute_application(fst_session, "play_and_detect_speech", args) == SWITCH_STATUS_SUCCESS); \
fst_asr_result = switch_channel_get_variable(fst_channel, "detect_speech_result"); \
@@ -729,7 +729,7 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
char *args = NULL; \
fst_asr_result = NULL; \
fst_requires(fst_core > 1); \
fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mr") == SWITCH_STATUS_SUCCESS); \
fst_requires(switch_ivr_displace_session(fst_session, input_filename, 0, "mrf") == SWITCH_STATUS_SUCCESS); \
switch_status_t status = switch_ivr_play_and_detect_speech(fst_session, prompt_filename, recognizer, grammar, (char **)&fst_asr_result, 0, input_args); \
fst_check(fst_asr_result != NULL); \
}