freetdm: improve some isdn logging
try to fool-proof the size of the read D channel buffer by not hard-coding it in 2 places
This commit is contained in:
parent
1d581a09cb
commit
eb7d52aaa9
|
@ -391,7 +391,7 @@ static void *ftdm_sangoma_isdn_io_run(ftdm_thread_t *me, void *obj)
|
||||||
case FTDM_SUCCESS:
|
case FTDM_SUCCESS:
|
||||||
/* Check if there are any channels that have data available */
|
/* Check if there are any channels that have data available */
|
||||||
for (citer = ftdm_span_get_chan_iterator(span, chaniter); citer; citer = ftdm_iterator_next(citer)) {
|
for (citer = ftdm_span_get_chan_iterator(span, chaniter); citer; citer = ftdm_iterator_next(citer)) {
|
||||||
len = 1000;
|
len = sizeof(data);
|
||||||
ftdmchan = ftdm_iterator_current(citer);
|
ftdmchan = ftdm_iterator_current(citer);
|
||||||
if (FTDM_IS_VOICE_CHANNEL(ftdmchan)) {
|
if (FTDM_IS_VOICE_CHANNEL(ftdmchan)) {
|
||||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_RX_DISABLED)) {
|
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_RX_DISABLED)) {
|
||||||
|
|
|
@ -483,7 +483,8 @@ void sngisdn_snd_data(ftdm_channel_t *dchan, uint8_t *data, ftdm_size_t len)
|
||||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) dchan->span->signal_data;
|
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) dchan->span->signal_data;
|
||||||
|
|
||||||
if (len > sizeof(l1_frame.data)) {
|
if (len > sizeof(l1_frame.data)) {
|
||||||
ftdm_assert(FTDM_FALSE, "Received frame exceeding max size\n");
|
ftdm_log_chan(dchan, FTDM_LOG_ERROR, "Received frame of %"FTDM_SIZE_FMT" bytes, exceeding max size of %"FTDM_SIZE_FMT" bytes\n",
|
||||||
|
len, sizeof(l1_frame.data));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue