[Freeswitch-users] BUG FIX: "Buffer size sanity check failed!" drops FAX receiving unneeded

Markus Mueller freeswitch at priv.de
Mon Apr 4 13:07:38 MSD 2011


Hello FreeSwitch users and programmers,

I found a problem on receiving faxes and want to share a working patch 
for this. The problem is that on receiving a fax, it is unneeded aborted 
by a sanity check. Sanity checks are fine, but a unneeded abort instead 
of a warning is in productive versions not the best solution.

The message apearing is:

2011-04-04 10:44:52.060860 [CRIT] switch_core_codec.c:660 Buffer size 
sanity check failed!

which is normaly aborting in receiving the fax. Simply decreasing this 
fault to a warning let the server receive the fax without any problems. 
After the patch the message apears up to five times per fax before the 
fax is beeing accepted. I am using libpri with the three HFC ISDN Cards 
and the DAHDI from Debian Squeeze 6.0. For more informations about my 
hardware just write me an email.

Regards,
Markus Mueller
http://projekte.priv.de/

root at sip:/usr/local/src/freeswitch/src# diff -U 4 switch_core_codec.c*
--- switch_core_codec.c 2011-03-14 10:49:17.000000000 +0100
+++ switch_core_codec.c.org     2011-03-14 10:47:02.000000000 +0100
@@ -657,9 +657,9 @@
                 uint32_t frames = encoded_data_len / 
codec->implementation->encoded_bytes_per_packet;

                 if (frames && 
codec->implementation->decoded_bytes_per_packet * frames > 
*decoded_data_len) {
                         switch_log_printf(SWITCH_CHANNEL_LOG, 
SWITCH_LOG_CRIT, "Buffer size sanity check failed!\n");
-                       // return SWITCH_STATUS_GENERR;
+                       return SWITCH_STATUS_GENERR;
                 }
         }

         if (codec->mutex) switch_mutex_lock(codec->mutex);
root at sip:/usr/local/src/freeswitch/src#




More information about the FreeSWITCH-users mailing list