mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 04:31:50 +00:00
re-implement sla barge using eavesdrop backend
This commit is contained in:
@@ -171,6 +171,8 @@ struct switch_core_session {
|
||||
uint32_t soft_lock;
|
||||
switch_ivr_dmachine_t *dmachine[2];
|
||||
plc_state_t *plc;
|
||||
uint8_t recur_buffer[SWITCH_RECOMMENDED_BUFFER_SIZE];
|
||||
switch_size_t recur_buffer_len;
|
||||
};
|
||||
|
||||
struct switch_media_bug {
|
||||
@@ -199,6 +201,7 @@ struct switch_media_bug {
|
||||
uint32_t record_pre_buffer_count;
|
||||
uint32_t record_pre_buffer_max;
|
||||
switch_frame_t *ping_frame;
|
||||
switch_frame_t *read_demux_frame;
|
||||
struct switch_media_bug *next;
|
||||
};
|
||||
|
||||
|
||||
@@ -137,6 +137,11 @@ SWITCH_DECLARE(void) switch_core_session_disable_heartbeat(switch_core_session_t
|
||||
|
||||
#define switch_core_session_get_name(_s) switch_channel_get_name(switch_core_session_get_channel(_s))
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_pop(switch_core_session_t *orig_session, const char *function, switch_media_bug_t **pop);
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_exec_all(switch_core_session_t *orig_session,
|
||||
const char *function, switch_media_bug_exec_cb_t cb, void *user_data);
|
||||
|
||||
/*!
|
||||
\brief Add a media bug to the session
|
||||
\param session the session to add the bug to
|
||||
@@ -193,7 +198,7 @@ SWITCH_DECLARE(void) switch_core_media_bug_set_write_replace_frame(_In_ switch_m
|
||||
\param bug the bug to get the data from
|
||||
*/
|
||||
SWITCH_DECLARE(switch_frame_t *) switch_core_media_bug_get_read_replace_frame(_In_ switch_media_bug_t *bug);
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_media_bug_set_read_demux_frame(_In_ switch_media_bug_t *bug, _In_ switch_frame_t *frame);
|
||||
/*!
|
||||
\brief Obtain the session from a media bug
|
||||
\param bug the bug to get the data from
|
||||
@@ -225,6 +230,7 @@ SWITCH_DECLARE(uint32_t) switch_core_cpu_count(void);
|
||||
\param bug bug to remove
|
||||
\return SWITCH_STATUS_SUCCESS if the operation was a success
|
||||
*/
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove(_In_ switch_core_session_t *session, _Inout_ switch_media_bug_t **bug);
|
||||
SWITCH_DECLARE(uint32_t) switch_core_media_bug_prune(switch_core_session_t *session);
|
||||
|
||||
@@ -247,7 +253,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_close(_Inout_ switch_media
|
||||
\param session the session to remove the bugs from
|
||||
\return SWITCH_STATUS_SUCCESS if the operation was a success
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all(_In_ switch_core_session_t *session);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all_function(_In_ switch_core_session_t *session, const char *function);
|
||||
|
||||
#define switch_core_media_bug_remove_all(_s) switch_core_media_bug_remove_all_function(_s, NULL)
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_enumerate(switch_core_session_t *session, switch_stream_handle_t *stream);
|
||||
SWITCH_DECLARE(switch_status_t) switch_core_media_bug_transfer_recordings(switch_core_session_t *orig_session, switch_core_session_t *new_session);
|
||||
|
||||
@@ -269,6 +269,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_start_input_timers(swit
|
||||
*/
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, char *file, uint32_t limit, switch_file_handle_t *fh);
|
||||
|
||||
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_pop_eavesdropper(switch_core_session_t *session, switch_core_session_t **sessionp);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_exec_all(switch_core_session_t *session, const char *app, const char *arg);
|
||||
SWITCH_DECLARE(switch_status_t) switch_ivr_eavesdrop_update_display(switch_core_session_t *session, const char *name, const char *number);
|
||||
|
||||
/*!
|
||||
\brief Eavesdrop on a another session
|
||||
\param session our session
|
||||
|
||||
@@ -170,7 +170,7 @@ SWITCH_DECLARE(void) switch_change_sln_volume_granular(int16_t *data, uint32_t s
|
||||
///\}
|
||||
|
||||
SWITCH_DECLARE(uint32_t) switch_merge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples);
|
||||
|
||||
SWITCH_DECLARE(uint32_t) switch_unmerge_sln(int16_t *data, uint32_t samples, int16_t *other_data, uint32_t other_samples);
|
||||
SWITCH_DECLARE(void) switch_mux_channels(int16_t *data, switch_size_t samples, uint32_t channels);
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
|
||||
@@ -288,7 +288,8 @@ typedef enum {
|
||||
ED_NONE = 0,
|
||||
ED_MUX_READ = (1 << 0),
|
||||
ED_MUX_WRITE = (1 << 1),
|
||||
ED_DTMF = (1 << 2)
|
||||
ED_DTMF = (1 << 2),
|
||||
ED_COPY_DISPLAY = (1 << 3)
|
||||
} switch_eavesdrop_flag_enum_t;
|
||||
typedef uint32_t switch_eavesdrop_flag_t;
|
||||
|
||||
@@ -1434,7 +1435,8 @@ typedef enum {
|
||||
SMBF_THREAD_LOCK = (1 << 7),
|
||||
SMBF_PRUNE = (1 << 8),
|
||||
SMBF_NO_PAUSE = (1 << 9),
|
||||
SMBF_STEREO_SWAP = (1 << 10)
|
||||
SMBF_STEREO_SWAP = (1 << 10),
|
||||
SMBF_LOCK = (1 << 11)
|
||||
} switch_media_bug_flag_enum_t;
|
||||
typedef uint32_t switch_media_bug_flag_t;
|
||||
|
||||
@@ -1821,6 +1823,8 @@ struct switch_console_callback_match {
|
||||
};
|
||||
typedef struct switch_console_callback_match switch_console_callback_match_t;
|
||||
|
||||
typedef void (*switch_media_bug_exec_cb_t)(switch_media_bug_t *bug, void *user_data);
|
||||
|
||||
typedef void (*switch_cap_callback_t) (const char *var, const char *val, void *user_data);
|
||||
typedef switch_status_t (*switch_console_complete_callback_t) (const char *, const char *, switch_console_callback_match_t **matches);
|
||||
typedef switch_bool_t (*switch_media_bug_callback_t) (switch_media_bug_t *, void *, switch_abc_type_t);
|
||||
|
||||
Reference in New Issue
Block a user