freetdm: add initial changes for FreeTDM channel history feature

This commit is contained in:
Moises Silva
2010-09-22 14:59:06 -04:00
parent 4999723687
commit ed01944c15
4 changed files with 85 additions and 2 deletions

View File

@@ -1277,7 +1277,13 @@ FT_DECLARE(const char *) ftdm_channel_get_state_str(const ftdm_channel_t *channe
/*! \brief For display debugging purposes you can display this string which describes the last channel internal state */
FT_DECLARE(const char *) ftdm_channel_get_last_state_str(const ftdm_channel_t *channel);
/*! \brief For display debugging purposes you can display this string which describes the last channel internal state */
/*! \brief For display debugging purposes you can display this string which describes the history of the channel
* \param The channel
* \return History string for the channel. You must free the string with ftdm_free
*/
FT_DECLARE(char *) ftdm_channel_get_history_str(const ftdm_channel_t *channel);
/*! \brief Initialize channel state for an outgoing call */
FT_DECLARE(ftdm_status_t) ftdm_channel_init(ftdm_channel_t *ftdmchan);
/*! \brief Initialize the library */

View File

@@ -356,6 +356,15 @@ typedef struct {
} ftdm_dtmf_debug_t;
#endif
typedef struct {
const char *file;
const char *func;
int line;
ftdm_channel_state_t state;
ftdm_channel_state_t last_state;
ftdm_time_t time;
} ftdm_channel_history_entry_t;
/* 2^8 table size, one for each byte (sample) value */
#define FTDM_GAINS_TABLE_SIZE 256
struct ftdm_channel {
@@ -381,6 +390,8 @@ struct ftdm_channel {
ftdm_channel_state_t state;
ftdm_channel_state_t last_state;
ftdm_channel_state_t init_state;
ftdm_channel_history_entry_t history[10];
uint8_t hindex;
ftdm_mutex_t *mutex;
teletone_dtmf_detect_state_t dtmf_detect;
uint32_t buffer_delay;