added FTDM_SILENCE_VALUE macro
This commit is contained in:
parent
fae95433e2
commit
fccbba53c3
|
@ -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);
|
ftdm_mutex_unlock(ftdmchan->pre_buffer_mutex);
|
||||||
|
|
||||||
|
|
||||||
memset(data, 255, *datalen);
|
memset(data, FTDM_SILENCE_VALUE(ftdmchan), *datalen);
|
||||||
|
|
||||||
if (ftdmchan->skip_read_frames > 0) {
|
if (ftdmchan->skip_read_frames > 0) {
|
||||||
ftdmchan->skip_read_frames--;
|
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) {
|
if (ftdm_buffer_inuse(ftdmchan->pre_buffer) >= ftdmchan->pre_buffer_size) {
|
||||||
ftdm_buffer_read(ftdmchan->pre_buffer, data, *datalen);
|
ftdm_buffer_read(ftdmchan->pre_buffer, data, *datalen);
|
||||||
} else {
|
} else {
|
||||||
memset(data, 255, *datalen);
|
memset(data, FTDM_SILENCE_VALUE(ftdmchan), *datalen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ftdm_mutex_unlock(ftdmchan->pre_buffer_mutex);
|
ftdm_mutex_unlock(ftdmchan->pre_buffer_mutex);
|
||||||
|
|
|
@ -320,6 +320,8 @@ FTDM_STR2ENUM_P(ftdm_str2ftdm_calling_party_category, ftdm_calling_party_categor
|
||||||
/*! \brief Digit limit used in DNIS/ANI */
|
/*! \brief Digit limit used in DNIS/ANI */
|
||||||
#define FTDM_DIGITS_LIMIT 25
|
#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 */
|
/*! \brief Number abstraction */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char digits[FTDM_DIGITS_LIMIT];
|
char digits[FTDM_DIGITS_LIMIT];
|
||||||
|
|
Loading…
Reference in New Issue