mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
freetdm: add channel commands to record and dump media
This commit is contained in:
@@ -431,9 +431,38 @@ typedef enum {
|
||||
FTDM_COMMAND_WINK,
|
||||
FTDM_COMMAND_ENABLE_PROGRESS_DETECT,
|
||||
FTDM_COMMAND_DISABLE_PROGRESS_DETECT,
|
||||
|
||||
/*!< Start tracing input and output from channel to the given file */
|
||||
FTDM_COMMAND_TRACE_INPUT,
|
||||
FTDM_COMMAND_TRACE_OUTPUT,
|
||||
|
||||
/*!< Stop both Input and Output trace, closing the files */
|
||||
FTDM_COMMAND_TRACE_END_ALL,
|
||||
|
||||
/*!< Enable DTMF debugging */
|
||||
FTDM_COMMAND_ENABLE_DEBUG_DTMF,
|
||||
|
||||
/*!< Disable DTMF debugging (if not disabled explicitly, it is disabled automatically when calls hangup) */
|
||||
FTDM_COMMAND_DISABLE_DEBUG_DTMF,
|
||||
|
||||
/*!< Start dumping all input to a circular buffer. The size of the circular buffer can be specified, default used otherwise */
|
||||
FTDM_COMMAND_ENABLE_INPUT_DUMP,
|
||||
|
||||
/*!< Stop dumping all input to a circular buffer. */
|
||||
FTDM_COMMAND_DISABLE_INPUT_DUMP,
|
||||
|
||||
/*!< Start dumping all output to a circular buffer. The size of the circular buffer can be specified, default used otherwise */
|
||||
FTDM_COMMAND_ENABLE_OUTPUT_DUMP,
|
||||
|
||||
/*!< Stop dumping all output to a circular buffer. */
|
||||
FTDM_COMMAND_DISABLE_OUTPUT_DUMP,
|
||||
|
||||
/*!< Dump the current input circular buffer to the specified FILE* structure */
|
||||
FTDM_COMMAND_DUMP_INPUT,
|
||||
|
||||
/*!< Dump the current output circular buffer to the specified FILE* structure */
|
||||
FTDM_COMMAND_DUMP_OUTPUT,
|
||||
|
||||
FTDM_COMMAND_ENABLE_CALLERID_DETECT,
|
||||
FTDM_COMMAND_DISABLE_CALLERID_DETECT,
|
||||
FTDM_COMMAND_ENABLE_ECHOCANCEL,
|
||||
|
@@ -342,21 +342,23 @@ typedef enum {
|
||||
FTDM_TYPE_CHANNEL
|
||||
} ftdm_data_type_t;
|
||||
|
||||
#ifdef FTDM_DEBUG_DTMF
|
||||
/* number of bytes for the circular buffer (5 seconds worth of audio) */
|
||||
#define DTMF_DEBUG_SIZE 8 * 5000
|
||||
/* number of 20ms cycles before timeout and close the debug dtmf file (5 seconds) */
|
||||
#define DTMF_DEBUG_TIMEOUT 250
|
||||
/* number of bytes for the IO dump circular buffer (5 seconds worth of audio by default) */
|
||||
#define FTDM_IO_DUMP_DEFAULT_BUFF_SIZE 8 * 5000
|
||||
typedef struct {
|
||||
FILE *file;
|
||||
char buffer[DTMF_DEBUG_SIZE];
|
||||
char *buffer;
|
||||
ftdm_size_t size;
|
||||
int windex;
|
||||
int wrapped;
|
||||
int closetimeout;
|
||||
} ftdm_io_dump_t;
|
||||
|
||||
/* number of interval cycles before timeout and close the debug dtmf file (5 seconds if interval is 20) */
|
||||
#define DTMF_DEBUG_TIMEOUT 250
|
||||
typedef struct {
|
||||
uint8_t enabled;
|
||||
FILE *file;
|
||||
int32_t closetimeout;
|
||||
ftdm_mutex_t *mutex;
|
||||
} ftdm_dtmf_debug_t;
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct {
|
||||
const char *file;
|
||||
@@ -471,9 +473,9 @@ struct ftdm_channel {
|
||||
void *user_private;
|
||||
ftdm_timer_id_t hangup_timer;
|
||||
ftdm_channel_iostats_t iostats;
|
||||
#ifdef FTDM_DEBUG_DTMF
|
||||
ftdm_dtmf_debug_t dtmfdbg;
|
||||
#endif
|
||||
ftdm_io_dump_t rxdump;
|
||||
ftdm_io_dump_t txdump;
|
||||
};
|
||||
|
||||
struct ftdm_span {
|
||||
|
@@ -58,6 +58,7 @@ typedef int ftdm_filehandle_t;
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FTDM_COMMAND_OBJ_SIZE *((ftdm_size_t *)obj)
|
||||
#define FTDM_COMMAND_OBJ_INT *((int *)obj)
|
||||
#define FTDM_COMMAND_OBJ_CHAR_P (char *)obj
|
||||
#define FTDM_COMMAND_OBJ_FLOAT *(float *)obj
|
||||
|
Reference in New Issue
Block a user