added FTDM_SILENCE_VALUE macro

This commit is contained in:
Moises Silva 2011-05-18 19:00:42 -04:00
parent fae95433e2
commit fccbba53c3
2 changed files with 4 additions and 2 deletions

View File

@ -3923,7 +3923,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_read(ftdm_channel_t *ftdmchan, void *data
ftdm_mutex_unlock(ftdmchan->pre_buffer_mutex);
memset(data, 255, *datalen);
memset(data, FTDM_SILENCE_VALUE(ftdmchan), *datalen);
if (ftdmchan->skip_read_frames > 0) {
ftdmchan->skip_read_frames--;
@ -3935,7 +3935,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_read(ftdm_channel_t *ftdmchan, void *data
if (ftdm_buffer_inuse(ftdmchan->pre_buffer) >= ftdmchan->pre_buffer_size) {
ftdm_buffer_read(ftdmchan->pre_buffer, data, *datalen);
} else {
memset(data, 255, *datalen);
memset(data, FTDM_SILENCE_VALUE(ftdmchan), *datalen);
}
}
ftdm_mutex_unlock(ftdmchan->pre_buffer_mutex);

View File

@ -320,6 +320,8 @@ FTDM_STR2ENUM_P(ftdm_str2ftdm_calling_party_category, ftdm_calling_party_categor
/*! \brief Digit limit used in DNIS/ANI */
#define FTDM_DIGITS_LIMIT 25
#define FTDM_SILENCE_VALUE(fchan) (fchan)->native_codec == FTDM_CODEC_ULAW ? 255 : (fchan)->native_codec == FTDM_CODEC_ALAW ? 0xD5 : 0x00
/*! \brief Number abstraction */
typedef struct {
char digits[FTDM_DIGITS_LIMIT];