freetdm: added dtmf recording feature for debugging

This commit is contained in:
Moises Silva
2010-07-29 17:26:03 -04:00
parent 450ac1347e
commit 9f9c4541cd
4 changed files with 152 additions and 0 deletions

View File

@@ -340,6 +340,21 @@ 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
typedef struct {
FILE *file;
char buffer[DTMF_DEBUG_SIZE];
int windex;
int wrapped;
int closetimeout;
ftdm_mutex_t *mutex;
} ftdm_dtmf_debug_t;
#endif
/* 2^8 table size, one for each byte (sample) value */
#define FTDM_GAINS_TABLE_SIZE 256
struct ftdm_channel {
@@ -409,6 +424,9 @@ struct ftdm_channel {
float txgain;
int availability_rate;
void *user_private;
#ifdef FTDM_DEBUG_DTMF
ftdm_dtmf_debug_t dtmfdbg;
#endif
};
struct ftdm_span {