Giter VIP home page Giter VIP logo

spandsp's Introduction

spandsp's People

Contributors

andywolk avatar angelmadames avatar anthmfs avatar briankwest avatar coppice-git avatar crienzo avatar cypromis avatar dragos-oancea avatar frederictobiasc avatar geraldcombs avatar jlenk avatar michaelgg avatar mjerris avatar ncopa avatar peolsson avatar romsuhov avatar s3rj1k avatar sathieu avatar seven1240 avatar ssinyagin avatar swk avatar traviscross avatar wj1918 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spandsp's Issues

super_tone detector not working after commit d0dfd573

I've found that after commit d0dfd57 tone detector stopped working for me.
I've pinpointed the issue to be with the following piece of code in super_tone_rx.c/super_tone_chunk():

            for (j = 2;  j < s->desc->monitored_frequencies;  j++)
            {
                if (res[j] >= res[k1])
                {
                    k2 = k1;
                    k1 = j;
                }
                else if (res[j] >= res[k2])
                {
                    k1 =     // <----this line
                    k2 = j;
                }
                /*endif*/
            }}

If remove the problem line, the issue goes away. As per my understanding, k1 should point to a tone with more energy, k2 to the one with less energy. So the line, in question, is logically incorrect.

Also there's uncertanity about DETECTION_THRESHOLD declared in super_tone_rx.c for float point:

// note the extra SUPER_TONE_BINS multiplier
#define DETECTION_THRESHOLD         2104205.6f      /* -42dBm0 [((SUPER_TONE_BINS*SUPER_TONE_BINS*32768.0/1.4142)*10^((-42 - DBM0_MAX_SINE_POWER)/20.0))^2] */

while ademco_contactid.c declares it as:

#define DETECTION_THRESHOLD         49728296.6f     /* -42dBm0 [((GOERTZEL_SAMPLES_PER_BLOCK*32768.0/1.4142)*10^((-42 - DBM0_MAX_SINE_POWER)/20.0))^2] */

For me, the formula from ademco_contactid.c works fine for tone detection, while one from super_tone_rx.c is not working.
@coppice-git , what's the right formula?

On debian 11 configure.ac requires autoconf version 2.71 but latest version on current debian 11 is 2.69

cd /usr/src/spandsp/
./autogen.sh
configure.ac:21: error: Autoconf version 2.71 or higher is required

dpkg -l | grep autoconf
ii  autoconf                              2.69-14  

edit configure.ac
change AC_PREREQ([2.71])) to 2.69 version
save file
compile and install

./autogen.sh
./configure
make
make install

Then, rerun install script if you are compiling spandsp on fusionpbx install.
cd /usr/src/fusionpbx-install.sh/debian && ./install.sh

update last git today and now cannot send faxes...

HDLC carrier up and down if I send a fax from 2 freeswitch.
no answer from the leg B if send to a fax machine after a page sent.
no special errors in the logs.
I updated spandsp, sofia-sip and freeswitch.
everything compiled fine.

centOS 7.9 : openssl/ssl.h: No such file or directory

When installing spansp, an 【 In file included from fax.c:67:0:
spandsp/ssl_fax.h:35:25: fatal error: openssl/ssl.h: No such file or directory 】message appears, but openssl is already installed. Is there anything I need to check?

[root@10-81-28-50 spandsp]# openssl version
OpenSSL 3.0.1 14 Dec 2021 (Library: OpenSSL 3.0.1 14 Dec 2021)

[root@10-81-28-50 spandsp]# whereis openssl
openssl: /usr/lib64/openssl /usr/local/openssl /usr/local/openssl/bin/openssl

Install Freesswitch on Ubuntu 20.04.5

Hello

I am installing freeswitch on an ubuntu 20.04.5 server but when I run make to build freeswitch it gives me the following error

I have tried to install it in centOS 7 and it gives me the same error.

Could that be happening?

image

missing files

at least following includes are referenced, but missing:

  • spandsp/v32bis.h
  • spandsp/v34.h
  • spandsp/private/v32bis.h
  • spandsp/private/v34.h

Build failure with MMX on i686 / pentium4

MMX fails to build on i686 / pentium4:

gsm0610_rpe.c: In function 'gsm0610_rpe_encoding':
gsm0610_rpe.c:132:5: error: invalid 'asm': invalid constraints for operand
     __asm__ __volatile__(
     ^~~~~~~

It seems that the build failure is raised by the following instruction:

" leal %[gsm_H],%%eax;\n"

Full build log can be found here:
http://autobuild.buildroot.org/results/3e9/3e986c3109c392afe47fc98446a2563ac9776cf6/build-end.log

Compilation error: The return type of function dtmf_rx_fillin() is sometimes void, sometimes int.

Compiling rtpengine aaff8863 fails with:

make[3]: Leaving directory '/git/voip/rtpengine/daemon'                                                                                 
Failed build with ../lib/dtmf_rx_fillin-01.h
Trying build with ../lib/dtmf_rx_fillin-02.h                                                                                            
make[3]: Entering directory '/git/voip/rtpengine/daemon'
cc -g -Wall -Wextra -Wno-sign-compare -Wno-unused-parameter -Wstrict-prototypes -pthread -fno-strict-aliasing -std=c99 -I/usr/local/include/glib-2.0 -I/usr/local/lib64/glib-2.0/include -I/usr/local/include -pthread -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib64/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -pthread -I/usr/local/include/json-glib-1.0 -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib64/glib-2.0/include -I/usr/local/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/local/include -I/usr/local/include -DWITH_IPTABLES_OPTION -I. -I../kernel-module/ -I../lib/ -I../include/ -D_GNU_SOURCE -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include/opus -DWITH_TRANSCODING -I/usr/local/include -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DHAVE_BCG729 -I/usr/local/include -DRTPENGINE_VERSION="\"git-master-aaff8863\""  -DHAVE_LIBSYSTEMD  -rdynamic  dtmf_rx_fillin-test.c  -lm -ldl -L/usr/local/lib64 -lglib-2.0 -L/usr/local/lib64 -pthread -lgthread-2.0 -lglib-2.0 -L/usr/local/lib -lz -L/usr/local/lib -lpcre -L/usr/local/lib64 -lcrypto -L/usr/local/lib64 -lssl -lcrypto -L/usr/local/lib -levent_pthreads -levent -lpcap -L/usr/local/lib -lxmlrpc_client -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc_util -L/usr/local/lib -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc_util -L/usr/local/lib -lxmlrpc_util -lhiredis -L/usr/local/lib64 -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -L/ -L/usr/local/lib -lwebsockets -lcap -L/usr/local/lib -lip4tc -lip6tc -L/usr/local/lib -lavcodec -L/usr/local/lib -lavformat -L/usr/local/lib -lavutil -L/usr/local/lib -lswresample -L/usr/local/lib -lavfilter -L/usr/local/lib -lspandsp -L/usr/local/lib -lopus -L/usr/local/lib -lmysqlclient -lpthread -lm -lssl -lcrypto -ldl -L/usr/local/lib64 -lbcg729 -L/lib64 -lsystemd -o dtmf_rx_fillin-test
In file included from dtmf_rx_fillin-test.c:1:
dtmf_rx_fillin.h:12:13: error: conflicting types for ‘dtmf_rx_fillin’; have ‘void(dtmf_rx_state_t *, int)’ {aka ‘void(struct dtmf_rx_state_s *, int)’}
   12 | INLINE void dtmf_rx_fillin(dtmf_rx_state_t *dsp, int n) {
      |             ^~~~~~~~~~~~~~
In file included from dtmf_rx_fillin.h:9:
/usr/local/include/spandsp/dtmf.h:185:19: note: previous declaration of ‘dtmf_rx_fillin’ with type ‘int(dtmf_rx_state_t *, int)’ {aka ‘int(struct dtmf_rx_state_s *, int)’}
  185 | SPAN_DECLARE(int) dtmf_rx_fillin(dtmf_rx_state_t *s, int samples);
      |                   ^~~~~~~~~~~~~~
make[3]: *** [<builtin>: dtmf_rx_fillin-test] Error 1
make[3]: Leaving directory '/git/voip/rtpengine/daemon'
Failed build with ../lib/dtmf_rx_fillin-02.h
make[2]: *** [../lib/common.Makefile:50: dtmf_rx_fillin.h] Error 1
make[2]: Leaving directory '/git/voip/rtpengine/daemon'
make[1]: *** [../lib/common.Makefile:4: all] Error 2
make[1]: Leaving directory '/git/voip/rtpengine/daemon'
make: *** [Makefile:22: all] Error 2

spandsp/dtmf.h:185 is https://github.com/freeswitch/spandsp/blob/master/src/spandsp/dtmf.h#L185.

The return type of function dtmf_rx_fillin() is sometimes void (spandsp sources), sometimes int (in lib/dtmf_rx_fillin-02.h).

Questions regarding this spandsp "fork"

Hi all,

I maintain the FreeSWITCH package for OpenWrt and the FreeSWITCH update 1.10.4 causes me some consternation regarding the spandsp dependency.

I saw that there was a commit made shortly before the release that lowered the spandsp version requirement from 1.99 to 0.0.6, apparently to be able to compile against the spandsp version used in Debian. But I have to wonder if this would really work (on Debian), because OpenWrt uses the same spandsp version 0.0.6 and the few patches that Debian adds on top don't seem to be related to the build failure I see when trying to compile FreeSWITCH against the OpenWrt spandsp 0.0.6 (I'll paste the log below in case anybody is curious).

So for all I know spandsp 0.0.6 is not compatible with FreeSWITCH 1.10.4 and one needs this spandsp fork (1.99).

Which leads me to the part which gives me consternation :)

I cannot compile FreeSWITCH without spandsp, because libfreeswitch.so seems to have a hard dependency on it (on version 1.99, because as mentioned building against 0.0.6 fails). But the fork uses the same library name as the "original" version 0.0.6. So I'd like to know your view on how things should go from here. Do you consider this fork with version 1.99 to be a "drop-in" replacement for the "original" version 0.0.6? Is 1.99 ABI/API compatible with 0.0.6? The SONAME is the same, which suggests that it should be ABI/API compatible?

In OpenWrt we have not only FreeSWITCH that depends on spandsp. We also package Asterisk, yate, rtpengine and baresip and they all have dependencies on spandsp. Will they work without changes with this fork of spandsp, with spandsp 1.99?

If this is not the case I will probably put some efforts into trying to rename the library of this fork to something different, so that the "original" spandsp can coexist with this "fork", in order for the other applications that depend on spandsp to keep working as expected.

I would really appreciate your feedback on this matter.

Thanks and kind regards,
Seb

OpenWrt-libtool: compile:  ccache_cc -DHAVE_CONFIG_H -I. -I../../../../src/include -I../../../../libs/esl/src/include -I../../../../libs/xmlrpc-c -I. -I/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include -I/home/sk/tmp/openwrt/staging_dir/toolchain-mips_24kc_gcc-10.1.0_musl/usr/include -I/home/sk/tmp/openwrt/staging_dir/toolchain-mips_24kc_gcc-10.1.0_musl/include/fortify -I/home/sk/tmp/openwrt/staging_dir/toolchain-mips_24kc_gcc-10.1.0_musl/include -I/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libiconv-stub/include -I/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libintl-stub/include -I/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/uuid -I/home/sk/tmp/openwrt/build_dir/target-mips_24kc_musl/freeswitch-1.10.4.-release/src/include -I/home/sk/tmp/openwrt/build_dir/target-mips_24kc_musl/freeswitch-1.10.4.-release/src/include -I/home/sk/tmp/openwrt/build_dir/target-mips_24kc_musl/freeswitch-1.10.4.-release/libs/libteletone/src -fPIC -ffast-math -Werror -Wno-unused-result -Wno-misleading-indentation -Wno-error=format-truncation -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DCJSON_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -DHAVE_OPENSSL -Wdeclaration-after-statement -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -ffile-prefix-map=/home/sk/tmp/openwrt/build_dir/target-mips_24kc_musl/freeswitch-1.10.4.-release=freeswitch-1.10.4.-release -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libiconv-stub/include -I/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/lib/libintl-stub/include -c mod_spandsp_fax.c  -fPIC -DPIC -o .libs/mod_spandsp_la-mod_spandsp_fax.o
mod_spandsp_fax.c: In function 'phase_d_handler':
mod_spandsp_fax.c:422:86: error: 't30_stats_t' has no member named 'image_x_resolution'; did you mean 'x_resolution'?
  422 |  fax_file_image_resolution = switch_core_session_sprintf(session, "%ix%i", t30_stats.image_x_resolution, t30_stats.image_y_resolution);
      |                                                                                      ^~~~~~~~~~~~~~~~~~
      |                                                                                      x_resolution
mod_spandsp_fax.c:422:116: error: 't30_stats_t' has no member named 'image_y_resolution'; did you mean 'y_resolution'?
  422 |  fax_file_image_resolution = switch_core_session_sprintf(session, "%ix%i", t30_stats.image_x_resolution, t30_stats.image_y_resolution);
      |                                                                                                                    ^~~~~~~~~~~~~~~~~~
      |                                                                                                                    y_resolution
mod_spandsp_fax.c:432:85: error: 't30_stats_t' has no member named 'image_width'
  432 |  fax_file_image_pixel_size = switch_core_session_sprintf(session, "%ix%i", t30_stats.image_width, t30_stats.image_length);
      |                                                                                     ^
mod_spandsp_fax.c:432:108: error: 't30_stats_t' has no member named 'image_length'
  432 |  fax_file_image_pixel_size = switch_core_session_sprintf(session, "%ix%i", t30_stats.image_width, t30_stats.image_length);
      |                                                                                                            ^
mod_spandsp_fax.c:452:69: error: 't30_stats_t' has no member named 'compression'
  452 |  fax_encoding = switch_core_session_sprintf(session, "%d", t30_stats.compression);
      |                                                                     ^
In file included from ../../../../src/include/switch.h:127,
                 from mod_spandsp.h:35,
                 from mod_spandsp_fax.c:35:
mod_spandsp_fax.c:457:60: error: implicit declaration of function 't4_compression_to_str' [-Werror=implicit-function-declaration]
  457 |  switch_channel_set_variable(channel, "fax_encoding_name", t4_compression_to_str(t30_stats.compression));
      |                                                            ^~~~~~~~~~~~~~~~~~~~~
../../../../src/include/switch_channel.h:297:113: note: in definition of macro 'switch_channel_set_variable'
  297 | #define switch_channel_set_variable(_channel, _var, _val) switch_channel_set_variable_var_check(_channel, _var, _val, SWITCH_TRUE)
      |                                                                                                                 ^~~~
mod_spandsp_fax.c:457:91: error: 't30_stats_t' has no member named 'compression'
  457 |  switch_channel_set_variable(channel, "fax_encoding_name", t4_compression_to_str(t30_stats.compression));
      |                                                                                           ^
../../../../src/include/switch_channel.h:297:113: note: in definition of macro 'switch_channel_set_variable'
  297 | #define switch_channel_set_variable(_channel, _var, _val) switch_channel_set_variable_var_check(_channel, _var, _val, SWITCH_TRUE)
      |                                                                                                                 ^~~~
mod_spandsp_fax.c:476:113: error: implicit declaration of function 't4_image_type_to_str'; did you mean 't38_data_type_to_str'? [-Werror=implicit-function-declaration]
  476 |  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Image type = %s (%s in the file)\n", t4_image_type_to_str(t30_stats.type), t4_image_type_to_str(t30_stats.image_type));
      |                                                                                                                 ^~~~~~~~~~~~~~~~~~~~
      |                                                                                                                 t38_data_type_to_str
mod_spandsp_fax.c:476:143: error: 't30_stats_t' has no member named 'type'
  476 |  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Image type = %s (%s in the file)\n", t4_image_type_to_str(t30_stats.type), t4_image_type_to_str(t30_stats.image_type));
      |                                                                                                                                               ^
mod_spandsp_fax.c:476:182: error: 't30_stats_t' has no member named 'image_type'; did you mean 'image_size'?
  476 |  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Image type = %s (%s in the file)\n", t4_image_type_to_str(t30_stats.type), t4_image_type_to_str(t30_stats.image_type));
      |                                                                                                                                                                                      ^~~~~~~~~~
      |                                                                                                                                                                                      image_size
mod_spandsp_fax.c:477:181: error: 't30_stats_t' has no member named 'image_width'
  477 |  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Image size = %d x %d pixels (%d x %d pixels in the file)\n", t30_stats.width, t30_stats.length, t30_stats.image_width, t30_stats.image_length);
      |                                                                                                                                                                                     ^
mod_spandsp_fax.c:477:204: error: 't30_stats_t' has no member named 'image_length'
  477 |  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Image size = %d x %d pixels (%d x %d pixels in the file)\n", t30_stats.width, t30_stats.length, t30_stats.image_width, t30_stats.image_length);
      |                                                                                                                                                                                                            ^
mod_spandsp_fax.c:478:195: error: 't30_stats_t' has no member named 'image_x_resolution'; did you mean 'x_resolution'?
  478 |  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Image resolution = %d/m x %d/m (%d/m x %d/m in the file)\n", t30_stats.x_resolution, t30_stats.y_resolution, t30_stats.image_x_resolution, t30_stats.image_y_resolution);
      |                                                                                                                                                                                                   ^~~~~~~~~~~~~~~~~~
      |                                                                                                                                                                                                   x_resolution
mod_spandsp_fax.c:478:225: error: 't30_stats_t' has no member named 'image_y_resolution'; did you mean 'y_resolution'?
  478 |  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Image resolution = %d/m x %d/m (%d/m x %d/m in the file)\n", t30_stats.x_resolution, t30_stats.y_resolution, t30_stats.image_x_resolution, t30_stats.image_y_resolution);
      |                                                                                                                                                                                                                                 ^~~~~~~~~~~~~~~~~~
      |                                                                                                                                                                                                                                 y_resolution
mod_spandsp_fax.c:479:133: error: 't30_stats_t' has no member named 'compression'
  479 |  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Compression = %s (%d)\n", t4_compression_to_str(t30_stats.compression), t30_stats.compression);
      |                                                                                                                                     ^
mod_spandsp_fax.c:479:157: error: 't30_stats_t' has no member named 'compression'
  479 |  switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Compression = %s (%d)\n", t4_compression_to_str(t30_stats.compression), t30_stats.compression);
      |                                                                                                                                                             ^
mod_spandsp_fax.c:503:114: error: 't30_stats_t' has no member named 'compression'
  503 |   switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "fax-encoding-name", t4_compression_to_str(t30_stats.compression));
      |                                                                                                                  ^
mod_spandsp_fax.c: In function 'spanfax_init':
mod_spandsp_fax.c:775:60: error: passing argument 2 of 'span_log_set_message_handler' from incompatible pointer type [-Werror=incompatible-pointer-types]
  775 |   span_log_set_message_handler(fax_get_logging_state(fax), mod_spandsp_log_message, pvt->session);
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                            |
      |                                                            void (*)(void *, int,  const char *)
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:92: note: expected 'message_handler_func_t' {aka 'void (*)(int,  const char *)'} but argument is of type 'void (*)(void *, int,  const char *)'
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                                                                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~
mod_spandsp_fax.c:775:3: error: too many arguments to function 'span_log_set_message_handler'
  775 |   span_log_set_message_handler(fax_get_logging_state(fax), mod_spandsp_log_message, pvt->session);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:20: note: declared here
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:776:60: error: passing argument 2 of 'span_log_set_message_handler' from incompatible pointer type [-Werror=incompatible-pointer-types]
  776 |   span_log_set_message_handler(t30_get_logging_state(t30), mod_spandsp_log_message, pvt->session);
      |                                                            ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                            |
      |                                                            void (*)(void *, int,  const char *)
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:92: note: expected 'message_handler_func_t' {aka 'void (*)(int,  const char *)'} but argument is of type 'void (*)(void *, int,  const char *)'
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                                                                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~
mod_spandsp_fax.c:776:3: error: too many arguments to function 'span_log_set_message_handler'
  776 |   span_log_set_message_handler(t30_get_logging_state(t30), mod_spandsp_log_message, pvt->session);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:20: note: declared here
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:830:70: error: passing argument 2 of 'span_log_set_message_handler' from incompatible pointer type [-Werror=incompatible-pointer-types]
  830 |    span_log_set_message_handler(t38_terminal_get_logging_state(t38), mod_spandsp_log_message, pvt->session);
      |                                                                      ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                                      |
      |                                                                      void (*)(void *, int,  const char *)
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:92: note: expected 'message_handler_func_t' {aka 'void (*)(int,  const char *)'} but argument is of type 'void (*)(void *, int,  const char *)'
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                                                                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~
mod_spandsp_fax.c:830:4: error: too many arguments to function 'span_log_set_message_handler'
  830 |    span_log_set_message_handler(t38_terminal_get_logging_state(t38), mod_spandsp_log_message, pvt->session);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:20: note: declared here
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:831:61: error: passing argument 2 of 'span_log_set_message_handler' from incompatible pointer type [-Werror=incompatible-pointer-types]
  831 |    span_log_set_message_handler(t30_get_logging_state(t30), mod_spandsp_log_message, pvt->session);
      |                                                             ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                             |
      |                                                             void (*)(void *, int,  const char *)
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:92: note: expected 'message_handler_func_t' {aka 'void (*)(int,  const char *)'} but argument is of type 'void (*)(void *, int,  const char *)'
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                                                                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~
mod_spandsp_fax.c:831:4: error: too many arguments to function 'span_log_set_message_handler'
  831 |    span_log_set_message_handler(t30_get_logging_state(t30), mod_spandsp_log_message, pvt->session);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:20: note: declared here
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:880:87: error: passing argument 2 of 'span_log_set_message_handler' from incompatible pointer type [-Werror=incompatible-pointer-types]
  880 |   span_log_set_message_handler(t38_gateway_get_logging_state(pvt->t38_gateway_state), mod_spandsp_log_message, pvt->session);
      |                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                                                       |
      |                                                                                       void (*)(void *, int,  const char *)
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:92: note: expected 'message_handler_func_t' {aka 'void (*)(int,  const char *)'} but argument is of type 'void (*)(void *, int,  const char *)'
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                                                                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~
mod_spandsp_fax.c:880:3: error: too many arguments to function 'span_log_set_message_handler'
  880 |   span_log_set_message_handler(t38_gateway_get_logging_state(pvt->t38_gateway_state), mod_spandsp_log_message, pvt->session);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:20: note: declared here
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:881:75: error: passing argument 2 of 'span_log_set_message_handler' from incompatible pointer type [-Werror=incompatible-pointer-types]
  881 |   span_log_set_message_handler(t38_core_get_logging_state(pvt->t38_core), mod_spandsp_log_message, pvt->session);
      |                                                                           ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                                           |
      |                                                                           void (*)(void *, int,  const char *)
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:92: note: expected 'message_handler_func_t' {aka 'void (*)(int,  const char *)'} but argument is of type 'void (*)(void *, int,  const char *)'
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                                                                     ~~~~~~~~~~~~~~~~~~~~~~~^~~~
mod_spandsp_fax.c:881:3: error: too many arguments to function 'span_log_set_message_handler'
  881 |   span_log_set_message_handler(t38_core_get_logging_state(pvt->t38_core), mod_spandsp_log_message, pvt->session);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:47,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/logging.h:120:20: note: declared here
  120 | SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:906:31: error: passing argument 2 of 't30_set_phase_e_handler' from incompatible pointer type [-Werror=incompatible-pointer-types]
  906 |  t30_set_phase_e_handler(t30, phase_e_handler, pvt);
      |                               ^~~~~~~~~~~~~~~
      |                               |
      |                               void (*)(void *, int)
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:110,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/t30_api.h:524:83: note: expected 'void (*)(t30_state_t *, void *, int)' {aka 'void (*)(struct t30_state_s *, void *, int)'} but argument is of type 'void (*)(void *, int)'
  524 | SPAN_DECLARE(void) t30_set_phase_e_handler(t30_state_t *s, t30_phase_e_handler_t *handler, void *user_data);
      |                                                            ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
mod_spandsp_fax.c:907:31: error: passing argument 2 of 't30_set_phase_d_handler' from incompatible pointer type [-Werror=incompatible-pointer-types]
  907 |  t30_set_phase_d_handler(t30, phase_d_handler, pvt);
      |                               ^~~~~~~~~~~~~~~
      |                               |
      |                               int (*)(void *, int)
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:110,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/t30_api.h:517:83: note: expected 'int (*)(t30_state_t *, void *, int)' {aka 'int (*)(struct t30_state_s *, void *, int)'} but argument is of type 'int (*)(void *, int)'
  517 | SPAN_DECLARE(void) t30_set_phase_d_handler(t30_state_t *s, t30_phase_d_handler_t *handler, void *user_data);
      |                                                            ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
mod_spandsp_fax.c:908:31: error: passing argument 2 of 't30_set_phase_b_handler' from incompatible pointer type [-Werror=incompatible-pointer-types]
  908 |  t30_set_phase_b_handler(t30, phase_b_handler, pvt);
      |                               ^~~~~~~~~~~~~~~
      |                               |
      |                               int (*)(void *, int)
In file included from /home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp.h:110,
                 from mod_spandsp.h:50,
                 from mod_spandsp_fax.c:35:
/home/sk/tmp/openwrt/staging_dir/target-mips_24kc_musl/usr/include/spandsp/t30_api.h:510:83: note: expected 'int (*)(t30_state_t *, void *, int)' {aka 'int (*)(struct t30_state_s *, void *, int)'} but argument is of type 'int (*)(void *, int)'
  510 | SPAN_DECLARE(void) t30_set_phase_b_handler(t30_state_t *s, t30_phase_b_handler_t *handler, void *user_data);
      |                                                            ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
mod_spandsp_fax.c:911:11: error: 'T4_SUPPORT_LENGTH_US_LETTER' undeclared (first use in this function)
  911 |           T4_SUPPORT_LENGTH_US_LETTER
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:911:11: note: each undeclared identifier is reported only once for each function it appears in
mod_spandsp_fax.c:912:11: error: 'T4_SUPPORT_LENGTH_US_LEGAL' undeclared (first use in this function)
  912 |         | T4_SUPPORT_LENGTH_US_LEGAL
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:913:11: error: 'T4_SUPPORT_LENGTH_UNLIMITED' undeclared (first use in this function)
  913 |         | T4_SUPPORT_LENGTH_UNLIMITED
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:914:11: error: 'T4_SUPPORT_WIDTH_215MM' undeclared (first use in this function)
  914 |         | T4_SUPPORT_WIDTH_215MM
      |           ^~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:915:11: error: 'T4_SUPPORT_WIDTH_255MM' undeclared (first use in this function)
  915 |         | T4_SUPPORT_WIDTH_255MM
      |           ^~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:916:11: error: 'T4_SUPPORT_WIDTH_303MM' undeclared (first use in this function)
  916 |         | T4_SUPPORT_WIDTH_303MM);
      |           ^~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:917:2: error: implicit declaration of function 't30_set_supported_bilevel_resolutions'; did you mean 't30_set_supported_resolutions'? [-Werror=implicit-function-declaration]
  917 |  t30_set_supported_bilevel_resolutions(t30,
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |  t30_set_supported_resolutions
mod_spandsp_fax.c:918:13: error: 'T4_RESOLUTION_R8_STANDARD' undeclared (first use in this function); did you mean 'T4_Y_RESOLUTION_STANDARD'?
  918 |             T4_RESOLUTION_R8_STANDARD
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~
      |             T4_Y_RESOLUTION_STANDARD
mod_spandsp_fax.c:919:13: error: 'T4_RESOLUTION_R8_FINE' undeclared (first use in this function); did you mean 'T4_Y_RESOLUTION_FINE'?
  919 |           | T4_RESOLUTION_R8_FINE
      |             ^~~~~~~~~~~~~~~~~~~~~
      |             T4_Y_RESOLUTION_FINE
mod_spandsp_fax.c:920:13: error: 'T4_RESOLUTION_R8_SUPERFINE' undeclared (first use in this function); did you mean 'T4_Y_RESOLUTION_SUPERFINE'?
  920 |           | T4_RESOLUTION_R8_SUPERFINE
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |             T4_Y_RESOLUTION_SUPERFINE
mod_spandsp_fax.c:921:13: error: 'T4_RESOLUTION_R16_SUPERFINE' undeclared (first use in this function); did you mean 'T4_Y_RESOLUTION_SUPERFINE'?
  921 |           | T4_RESOLUTION_R16_SUPERFINE
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |             T4_Y_RESOLUTION_SUPERFINE
mod_spandsp_fax.c:922:43: error: 'T4_RESOLUTION_200_100' undeclared (first use in this function); did you mean 'T4_Y_RESOLUTION_1200'?
  922 |                                         | T4_RESOLUTION_200_100
      |                                           ^~~~~~~~~~~~~~~~~~~~~
      |                                           T4_Y_RESOLUTION_1200
mod_spandsp_fax.c:923:43: error: 'T4_RESOLUTION_200_200' undeclared (first use in this function); did you mean 'T4_Y_RESOLUTION_1200'?
  923 |                                         | T4_RESOLUTION_200_200
      |                                           ^~~~~~~~~~~~~~~~~~~~~
      |                                           T4_Y_RESOLUTION_1200
mod_spandsp_fax.c:924:43: error: 'T4_RESOLUTION_200_400' undeclared (first use in this function); did you mean 'T4_Y_RESOLUTION_1200'?
  924 |                                         | T4_RESOLUTION_200_400
      |                                           ^~~~~~~~~~~~~~~~~~~~~
      |                                           T4_Y_RESOLUTION_1200
mod_spandsp_fax.c:925:43: error: 'T4_RESOLUTION_400_400' undeclared (first use in this function); did you mean 'T4_Y_RESOLUTION_1200'?
  925 |                                         | T4_RESOLUTION_400_400);
      |                                           ^~~~~~~~~~~~~~~~~~~~~
      |                                           T4_Y_RESOLUTION_1200
mod_spandsp_fax.c:926:17: error: 'T4_COMPRESSION_T4_1D' undeclared (first use in this function); did you mean 'T4_COMPRESSION_ITU_T6'?
  926 |  compressions = T4_COMPRESSION_T4_1D
      |                 ^~~~~~~~~~~~~~~~~~~~
      |                 T4_COMPRESSION_ITU_T6
mod_spandsp_fax.c:927:8: error: 'T4_COMPRESSION_T4_2D' undeclared (first use in this function); did you mean 'T4_COMPRESSION_ITU_T6'?
  927 |      | T4_COMPRESSION_T4_2D
      |        ^~~~~~~~~~~~~~~~~~~~
      |        T4_COMPRESSION_ITU_T6
mod_spandsp_fax.c:928:8: error: 'T4_COMPRESSION_T6' undeclared (first use in this function); did you mean 'T4_COMPRESSION_ITU_T6'?
  928 |      | T4_COMPRESSION_T6
      |        ^~~~~~~~~~~~~~~~~
      |        T4_COMPRESSION_ITU_T6
mod_spandsp_fax.c:929:8: error: 'T4_COMPRESSION_T85' undeclared (first use in this function); did you mean 'COMPRESSION_T85'?
  929 |      | T4_COMPRESSION_T85
      |        ^~~~~~~~~~~~~~~~~~
      |        COMPRESSION_T85
mod_spandsp_fax.c:930:8: error: 'T4_COMPRESSION_T85_L0' undeclared (first use in this function); did you mean 'T4_COMPRESSION_ITU_T85_L0'?
  930 |      | T4_COMPRESSION_T85_L0;
      |        ^~~~~~~~~~~~~~~~~~~~~
      |        T4_COMPRESSION_ITU_T85_L0
mod_spandsp_fax.c:932:3: error: implicit declaration of function 't30_set_supported_colour_resolutions'; did you mean 't30_set_supported_resolutions'? [-Werror=implicit-function-declaration]
  932 |   t30_set_supported_colour_resolutions(t30, T4_RESOLUTION_100_100
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |   t30_set_supported_resolutions
mod_spandsp_fax.c:932:45: error: 'T4_RESOLUTION_100_100' undeclared (first use in this function); did you mean 'T4_Y_RESOLUTION_1200'?
  932 |   t30_set_supported_colour_resolutions(t30, T4_RESOLUTION_100_100
      |                                             ^~~~~~~~~~~~~~~~~~~~~
      |                                             T4_Y_RESOLUTION_1200
mod_spandsp_fax.c:934:15: error: 'T4_RESOLUTION_300_300' undeclared (first use in this function); did you mean 'T4_Y_RESOLUTION_300'?
  934 |             | T4_RESOLUTION_300_300
      |               ^~~~~~~~~~~~~~~~~~~~~
      |               T4_Y_RESOLUTION_300
mod_spandsp_fax.c:936:20: error: 'T4_COMPRESSION_COLOUR' undeclared (first use in this function); did you mean 'T4_COMPRESSION_NONE'?
  936 |   compressions |= (T4_COMPRESSION_COLOUR | T4_COMPRESSION_T42_T81);
      |                    ^~~~~~~~~~~~~~~~~~~~~
      |                    T4_COMPRESSION_NONE
mod_spandsp_fax.c:936:44: error: 'T4_COMPRESSION_T42_T81' undeclared (first use in this function); did you mean 'T4_COMPRESSION_ITU_T85'?
  936 |   compressions |= (T4_COMPRESSION_COLOUR | T4_COMPRESSION_T42_T81);
      |                                            ^~~~~~~~~~~~~~~~~~~~~~
      |                                            T4_COMPRESSION_ITU_T85
mod_spandsp_fax.c:941:19: error: 'T4_COMPRESSION_RESCALING' undeclared (first use in this function); did you mean 'T4_COMPRESSION_NONE'?
  941 |   compressions |= T4_COMPRESSION_RESCALING;
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~
      |                   T4_COMPRESSION_NONE
mod_spandsp_fax.c:943:19: error: 'T4_COMPRESSION_COLOUR_TO_BILEVEL' undeclared (first use in this function)
  943 |   compressions |= T4_COMPRESSION_COLOUR_TO_BILEVEL;
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mod_spandsp_fax.c:945:19: error: 'T4_COMPRESSION_GRAY_TO_BILEVEL' undeclared (first use in this function)
  945 |   compressions |= T4_COMPRESSION_GRAY_TO_BILEVEL;
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[7]: *** [Makefile:736: mod_spandsp_la-mod_spandsp_fax.lo] Error 1
make[7]: Leaving directory '/home/sk/tmp/openwrt/build_dir/target-mips_24kc_musl/freeswitch-1.10.4.-release/src/mod/applications/mod_spandsp'
make[6]: *** [Makefile:707: mod_spandsp-all] Error 1

HDLC Output Issue

When I send Signaling channels to HDLC library, it returns HDLC Frame is Ok but the s->buffer which should have the HDLC frame gives segmentation fault whenever I try to access it in the frame_handler function.

Warnings: Values cast to wrong type?

This didn't kill the build, but wanted to bring up these casting issues for tracking and resolution.

17rx.c: In function ‘v17_rx’:
v17rx.c:1339:68: warning: passing argument 2 of ‘vec_circular_dot_prodf’ from incompatible pointer type [-Wincompatible-pointer-types]
 1339 |         v = vec_circular_dot_prodf(s->rrc_filter, rx_pulseshaper_re[step], V17_RX_FILTER_STEPS, s->rrc_filter_step);
      |                                                   ~~~~~~~~~~~~~~~~~^~~~~~
      |                                                                    |
      |                                                                    const int16_t * {aka const short int *}
In file included from v17rx.c:57:
spandsp/vector_float.h:184:73: note: expected ‘const float *’ but argument is of type ‘const int16_t *’ {aka ‘const short int *’}
  184 | SPAN_DECLARE(float) vec_circular_dot_prodf(const float x[], const float y[], int n, int pos);
      |                                                             ~~~~~~~~~~~~^~~
v17rx.c:1379:72: warning: passing argument 2 of ‘vec_circular_dot_prodf’ from incompatible pointer type [-Wincompatible-pointer-types]
 1379 |             v = vec_circular_dot_prodf(s->rrc_filter, rx_pulseshaper_im[step], V17_RX_FILTER_STEPS, s->rrc_filter_step);
      |                                                       ~~~~~~~~~~~~~~~~~^~~~~~
      |                                                                        |
      |                                                                        const int16_t * {aka const short int *}
In file included from v17rx.c:57:
spandsp/vector_float.h:184:73: note: expected ‘const float *’ but argument is of type ‘const int16_t *’ {aka ‘const short int *’}
  184 | SPAN_DECLARE(float) vec_circular_dot_prodf(const float x[], const float y[], int n, int pos);
      |                                                             ~~~~~~~~~~~~^~~

Problematic GPL-2 license for some src/ sources

Hi!

While doing a license review on FreeSWITCH (signalwire/freeswitch#2092), I noticed that spandsp contains the following GPL-2 licensed files which end up directly included into the built shared library or end up generating output derived from their source code:

src/image_translate.c
src/make_at_dictionary.c
src/make_cielab_luts.c
src/make_math_fixed_tables.c
src/make_modem_filter.c
src/make_t43_gray_code_tables.c

By itself this is not a big problem for libspandsp itself, even though that means the resulting library is covered by the GPL-2 instead of LGPL-2.1. The problem for FreeSWITCH is that the MPL-1.1 (its primary license) is incompatible with the GPL-2, which means linking this library into freeswitch would be a violation of the licenses.

To be able to relicense these files, any author that has touched in a significant way (excluding removals, or very simple mechanical changes or additions) would need to be contacted and approve such license change.

From git history it looks like, for:

  • src/image_translate.c, only @coppice-git has relevant changes there,
  • src/make_at_dictionary.c, @coppice-git, @mjerris and @wj1918 have relevant changes,
  • src/make_cielab_luts.c, only @coppice-git has relevant changes,
  • src/make_math_fixed_tables.c, only @coppice-git has relevant changes,
  • src/make_modem_filter.c, part of the history is not visible from git as the code got imported in bulk, so it's not clear what other authors this might involve, but for the code from git it looks like it's mostly @coppice-git and two minor changes from @jlenk and @mjerris which might not even be copyrightable.
  • src/make_t43_gray_code_tables.c, pretty much all changes by @coppice-git (one minor change by @jlenk which does not look copyrightable),

V.34 Question

Can I send or receive a fax using V.34 with spandsp 3.0.0?

I think there are source code fragments related to V.34... I'm not sure where the source code is for starting fax transmission or reception with V.34.

/usr/include/openssl/rsa.h:96:51: error: expected ')' before '__extension__' int (*rsa_mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/libxml2 -DNDEBUG -msse2 -Wunused-but-set-variable -std=gnu99 -ffast-math -Wall -Wunused-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -DHAVE_VISIBILITY=1 -MT fax.lo -MD -MP -MF .deps/fax.Tpo -c fax.c -fPIC -DPIC -o .libs/fax.o
In file included from /usr/include/tgmath.h:28,
from fax.c:38:
/usr/include/openssl/rsa.h:96:51: error: expected ')' before 'extension'
int (*rsa_mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
^
In file included from /usr/include/openssl/x509.h:96,
from /usr/include/openssl/ssl.h:156,
from spandsp/ssl_fax.h:35,
from fax.c:67:
/usr/include/openssl/rsa.h:96:54: error: expected ';', ',' or ')' before 'RSA'
int (*rsa_mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
^~~
make[2]: *** [fax.lo] Error 1
make[2]: Leaving directory /root/spandsp/src' make[1]: *** [all] Error 2 make[1]: Leaving directory /root/spandsp/src'
make: *** [all-recursive] Error 1

my system :
[root@localhost spandsp]# uname -a
Linux localhost.localdomain 3.10.0-1160.99.1.el7.x86_64 #1 SMP Wed Sep 13 14:19:20 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost spandsp]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@localhost spandsp]#

Not working anymore on Debian 12

On Debian 12
One of tha last commits (Numerous cleanups: d9681c3) makes it not working anymore.

with that Version Freeswitch is not building anymore with the error that libspandsp > 3.0 can't be found.

i had to add:
cd /usr/src/libs/spandsp && git checkout 0d2e6ac

to my build to make it work again.

Color faxing and setjmp seg faults and exit(EXIT_FAILURE);

When compiling FreeSWITCH 1.10.10 on Windows x64 and enabling color faxing by defining JPEG_SUPPORT in libtiff the buffer used for setjmp/longjmp in t42_itulab_jpeg_to_srgb() is not aligned properly and the call to setjmp results in seg fault. If I 'hack' around this alignment issues and give setjmp a properly aligned buffer if the jpeg decompression fails and the jpeg error handler is called it exits to the OS via and exit(EXIT_FAILURE) in libjpeg's error_exit() function. This seems to because the initialization of the decompressor error manager is incorrect in the way it sets up it's callbacks which get overridden by the defaults when jpeg_std_error() is called. These issues are the same in t42_srgb_to_itulab_jpeg().

Any guidance is appreciated

Segfault on writing tiff

Hi,

I've encountered a segfault when trying to use spandsp to receive a T.30 on FreeSwitch.
SpanDSP version: 0d2e6ac (from the FreeSwitch Debian 11 repo).
I've checked master and i don't think this part was changed since that commit.

Backtrace: fs_spandsp_backtrace.log

Could you please take a look?

Best regards,
Petr

CentOS 7: Missing spandsp >= 3.0

Did the following:

  1. cloned
  2. executed yum-prepare.sh
  3. executed bootstrap.sh
  4. make
  5. make install
  6. ldconfig

However, back in FreeSwitch, during configure, I am still getting:

checking for spandsp >= 3.0... configure: error: no usable spandsp; please install spandsp3 devel package or equivalent

V.17 fixed point issues

Hi!

I've found the following issues while testing V.17 14400 TCF with fax_decode tool when compiled with fixed point support:

  1. v17rx.c is missing SPANDSP_USE_FIXED_POINTx
  2. int32 overflow happens for s->training_error, long training threshold (line 961) and training succeeded threshold (line 1139).

Suggested fix with TCF sample is attached.
v17_fixedp.zip

Compilation failing with --disable-builtin-tiff flag

Compilation fails with this output:

gcc -o make_v34_convolutional_coders ../src/make_v34_convolutional_coders.c -DHAVE_CONFIG_H -I../src -lm
./make_v34_convolutional_coders >v34_convolutional_coders.h
gcc -o make_v34_probe_signals ../src/make_v34_probe_signals.c ../src/g711.c ../src/alloc.c -DHAVE_CONFIG_H -I../src -lm
In file included from ../src/make_v34_probe_signals.c:28:
../src/spandsp.h:48:10: fatal error: tiffio.h: No such file or directory
   48 | #include <tiffio.h>
      |          ^~~~~~~~~~
compilation terminated.
make[4]: *** [Makefile:1602: make_v34_probe_signals] Error 1

The issue is with make_v34_probe_signals.c that includes "spandsp.h" which, in turn, demands tiffio.h.
A trial solution is to replace spandsp.h with the following includes:

#include <inttypes.h>
#include <stdio.h>

// #include "spandsp.h"

#include <stdlib.h>
#include <math.h>
#include "spandsp/telephony.h"
#include "spandsp/bit_operations.h"
#include "spandsp/g711.h"

Also there's an issue in meteor-engine.c:979 with printf format missing a string parameter:

gcc -o make_v34_tx_pre_emphasis_filters ../src/make_v34_tx_pre_emphasis_filters.c ../tools/meteor-engine.c -DHAVE_CONFIG_H -I../src -I../tools -lm
../tools/meteor-engine.c: In function ‘vet_data’:
../tools/meteor-engine.c:979:20: warning: too many arguments for format [-Wformat-extra-args]
  979 |             printf("Pushing band edges right\n", (s->which_way == rr)  ?  "right"  :  "left");
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

T.38 gw: V.17 call failing if far-end fails to train (FTT)

Hi!

When t38_gateway on sender side receives FTT, the subsequent TCF is sent to far-end as v17-14400-short-training not as v17-14400-long-training. Also we should switch to V.21 since as per Figure 5-2a/T.30, (TSI)DCS should be repeated as well.

Spandsp log and suggested fix is attached.
ftt.zip

Reason for removing FSK_FRAME_MODE_8N1_FRAMES?

This is more of an information request than a bug, per se.

In this commit from 2012, FSK_FRAME_MODE_8N1_FRAMES was removed:
4265af6#diff-f39a1bf3eb4f90837f55490c3be3d02e605bb22dde779084f0d5f45a8dfc5970

FSK_FRAME_MODE_7E1_FRAMES has the same value as this (10), but semantically it means something very different.

What is the replacement for this macro? Not sure I follow this change, given that 8N1 is the most common modem setting, and the remaining settings are quite obscure. I am trying to fix code that doesn't compile because it uses the removed FSK_FRAME_MODE_8N1_FRAMES macro, and it isn't clear what the replacement should be, since 8N1 is simply gone.

`plc_fillin` can overflow the input buffer

When calling plc_fillin with plc_state_t *s and s->missing_samples == 0, the function attempts to write pitch_overlap bytes to the input buffer, regardless of its length. This causes crashes in a GStreamer application using the spandsp plugin, because it might call plc_fillin with very small buffers (eg with my test case 2-byte long).

Can the documentation of plc_fillin be updated to specify the minimum size of its input buffers, or even better the function be fixed to support any-sized buffers?

Thanks!

Sourceforge unreliable

Hi,

Just for your information: I encountered issues building spandsp because sourceforge has difficulties to provide the stylesheets from the docbook-project, for instance http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk-common.xsl :

An error has been encountered in accessing this page.

1. Server: docbook.sourceforge.net
2. URL path: /release/xsl/current/xhtml/chunk-common.xsl
3. Error notes: Server unable to read htaccess file, denying access to be safe
4. Error type: 403
5. Request method: GET
6. Request query string: NONE
7. Time: 2021-03-31 13:15:28 UTC (1617196528)

Reporting this problem: The problem you have encountered is with a project web site hosted by SourceForge.net. This issue should be reported to the SourceForge.net-hosted project (not to SourceForge.net).

If this is a severe or recurring/persistent problem, please do one of the following, and provide the error text (numbered 1 through 7, above):

    Contact the project via their designated support resources.
    Contact the project administrators of this project via email (see the upper right-hand corner of the Project Summary page for their usernames) at [email protected]

If you are a maintainer of this web content, please refer to the Site Documentation regarding web services for further assistance.

NOTE: As of 2008-10-23 directory index display has been disabled by default. This option may be re-enabled by the project by placing a file with the name ".htaccess" with this line:

Options +Indexes

compilation error

from the last git:
.libs/data_modems.o
In file included from data_modems.c:99:
spandsp/private/v17rx.h:131:5: error: unknown type name 'godard_ted_state_t'
131 | godard_ted_state_t godard;
| ^~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:1103: data_modems.lo] Error 1
make[2]: Leaving directory '/home/src/spandsp/src'
make[1]: *** [Makefile:882: all] Error 2
make[1]: Leaving directory '/home/src/spandsp/src'
make: *** [Makefile:512: all-recursive] Error 1

any idea?
thanks

Feature Request: Add support for Bell 212A modulation

We are trying to make some old Nortel Millenium payphones work with the Asterisk softmodem, which uses SpanDSP. It would be great to get support for Bell 212A which is used on them so we don't need a hardware modem for using them.

FreeSWITCH Crash (most likely in spandsp's t30.c)

Hi, one of our FreeSWITCH machines recently deadlocked or livelocked. No connections to the Event Socket port 8021 were accepted anymore and after a superficial analysis we are suspecting a bug in spandsp because the last line in the log indicates that a fax ECM frame was received of 3 bytes in length, which in turn caused a call to a memcpy with len == -1.

Here are the last few log entries:

2022-01-17 16:42:06.698682 [DEBUG] mod_spandsp_fax.c:295 FLOW FAX Set rx type 7
2022-01-17 16:42:06.698682 [DEBUG] mod_spandsp_fax.c:295 FLOW FAX Set tx type 0
2022-01-17 16:42:06.698682 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 Start T2
2022-01-17 16:42:06.718682 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Carrier down (-1) in state F_DOC_ECM
2022-01-17 16:42:06.718682 [WARNING] mod_spandsp_fax.c:295 WARNING T.30 ECM carrier not found
2022-01-17 16:42:06.718682 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 Status changing to Carrier lost during fax receive
2022-01-17 16:42:07.478681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Carrier up (-2) in state F_DOC_ECM
2022-01-17 16:42:07.478681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Carrier up (-2) in state F_DOC_ECM
2022-01-17 16:42:07.618681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Training failed (-5) in state F_DOC_ECM
2022-01-17 16:42:07.678681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Carrier down (-1) in state F_DOC_ECM
2022-01-17 16:42:07.678681 [WARNING] mod_spandsp_fax.c:295 WARNING T.30 ECM carrier not found
2022-01-17 16:42:07.678681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Carrier up (-2) in state F_DOC_ECM
2022-01-17 16:42:07.678681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Carrier down (-1) in state F_DOC_ECM
2022-01-17 16:42:07.678681 [WARNING] mod_spandsp_fax.c:295 WARNING T.30 ECM carrier not found
2022-01-17 16:42:07.678681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Carrier up (-2) in state F_DOC_ECM
2022-01-17 16:42:07.818681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Training in progress (-3) in state F_DOC_ECM
2022-01-17 16:42:07.838681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Training succeeded (-4) in state F_DOC_ECM
2022-01-17 16:42:07.838681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Abort (-8) in state F_DOC_ECM
2022-01-17 16:42:07.838681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Framing OK (-6) in state F_DOC_ECM
2022-01-17 16:42:07.838681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 Start T1A
2022-01-17 16:42:07.858681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 Bad HDLC CRC received
2022-01-17 16:42:07.858681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 Bad HDLC CRC received
2022-01-17 16:42:07.878681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 Bad HDLC CRC received
2022-01-17 16:42:07.878681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Abort (-8) in state F_DOC_ECM
2022-01-17 16:42:07.898681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Abort (-8) in state F_DOC_ECM
2022-01-17 16:42:07.978681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 Bad HDLC CRC received
2022-01-17 16:42:07.978681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 HDLC signal status is Abort (-8) in state F_DOC_ECM
2022-01-17 16:42:08.038681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 Stop T1A (278400 remaining)
2022-01-17 16:42:08.038681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 Rx:  FCD without final frame tag
2022-01-17 16:42:08.038681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 Rx:  ff 03 06
2022-01-17 16:42:08.038681 [DEBUG] mod_spandsp_fax.c:295 FLOW T.30 Storing ECM frame 97, length -1

The code in t30.c I suspect caused the problem:

spandsp/src/t30.c

Lines 3589 to 3590 in 284fe91

span_log(&s->logging, SPAN_LOG_FLOW, "Storing ECM frame %d, length %d\n", frame_no, len - 4);
memcpy(&s->ecm_data[frame_no][0], &msg[4], len - 4);

And the full spandsp related log:

spandsp-error.log

FreeSWITCH version was most likely version 1.10.6.. We are not 100% sure, because we have updated it to 1.10.7 right before reinstating the server again.

dpkg-buildpackage -us -uc does not work after d9681c374

One of the changes made in d9681c3 was to add this line to configure.ac:

AX_CHECK_REAL_FILE([${prefix}/lib64], libdir='${exec_prefix}/lib64')

Unfortunately, this SHOULD be ${prefix}/lib64/${host} in both cases. While it doesn't matter that much to the OS itself, all the libspandsp installers are hard-coded to be /usr/lib (which is a symlink to /usr/lib64, so that doesn't matter) but also require something to match a glob of /usr/lib/*/libspandsp

For an example, see https://github.com/freeswitch/spandsp/blob/master/debian/libspandsp3.install

This is fixed by this patch, which simply adds ${host} to both sides. xrobau/freeswitch-ubuntubuilder@7924f4a#diff-1acd998070a18f72fce00e939f0d05162806ad9af641eb0821df6c78a58b6f41

However, the end result is that it does nothing. Overriding libdir is NOT something that it should be doing, so a better idea is to remove that line totally.

Cannot Make

ademco_contactid.c:452:51: error: initializer element is not a compile-time constant static const float detection_threshold = goertzel_threshold_dbm0(GOERTZEL_SAMPLES_PER_BLOCK, -42.0f); ./spandsp/tone_detect.h:66:49: note: expanded from macro 'goertzel_threshold_dbm0' #define goertzel_threshold_dbm0(len,thresh) (float) ((len*len*32768.0*32768.0/2.0)*pow(10.0, (thresh - DBM0_MAX_SINE_POWER)/10.0)) ademco_contactid.c:453:77: error: initializer element is not a compile-time constant static const float tone_to_total_energy = GOERTZEL_SAMPLES_PER_BLOCK*db_to_power_ratio(-0.85f);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.