Freeswitch-svn
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
February 2009
- 20 participants
- 764 discussions
20 Feb '09
Author: rupa
Date: Fri Feb 20 14:28:18 2009
New Revision: 12196
Log:
actually honor profile when used as a app
Modified:
freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c
Modified: freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c Fri Feb 20 14:28:18 2009
@@ -763,10 +763,6 @@
switch_core_new_memory_pool(&pool);
}
routes.pool = pool;
- if (!(routes.profile = locate_profile(lcr_profile))) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown profile: %s\n", lcr_profile);
- goto end;
- }
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
dest = argv[0];
@@ -774,8 +770,12 @@
lcr_profile = argv[1];
}
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "LCR Lookup on %s\n", dest);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "LCR Lookup on %s using profile %s\n", dest, lcr_profile);
routes.lookup_number = dest;
+ if (!(routes.profile = locate_profile(lcr_profile))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unknown profile: %s\n", lcr_profile);
+ goto end;
+ }
if (lcr_do_lookup(&routes, dest) == SWITCH_STATUS_SUCCESS) {
for (cur_route = routes.head; cur_route; cur_route = cur_route->next) {
switch_snprintf(vbuf, sizeof(vbuf), "lcr_route_%d", cnt++);
1
0
[commit] r12195 - in freeswitch/trunk: . libs/spandsp/src libs/spandsp/src/msvc
by FreeSWITCH SVN 20 Feb '09
by FreeSWITCH SVN 20 Feb '09
20 Feb '09
Author: mikej
Date: Fri Feb 20 14:19:58 2009
New Revision: 12195
Log:
rename spandsp project files so we can add 2005 projects too.
Added:
freeswitch/trunk/libs/spandsp/src/libspandsp.2008.sln
- copied, changed from r12186, /freeswitch/trunk/libs/spandsp/src/libspandsp.sln
freeswitch/trunk/libs/spandsp/src/libspandsp.2008.vcproj
- copied unchanged from r12188, /freeswitch/trunk/libs/spandsp/src/libspandsp.vcproj
freeswitch/trunk/libs/spandsp/src/libtiff.2008.vcproj
- copied unchanged from r12185, /freeswitch/trunk/libs/spandsp/src/libtiff.vcproj
freeswitch/trunk/libs/spandsp/src/msvc/make_at_dictionary.2008.vcproj
- copied unchanged from r12186, /freeswitch/trunk/libs/spandsp/src/msvc/make_at_dictionary.vcproj
freeswitch/trunk/libs/spandsp/src/msvc/make_modem_filter.2008.vcproj
- copied unchanged from r12186, /freeswitch/trunk/libs/spandsp/src/msvc/make_modem_filter.vcproj
Removed:
freeswitch/trunk/libs/spandsp/src/libspandsp.sln
freeswitch/trunk/libs/spandsp/src/libspandsp.vcproj
freeswitch/trunk/libs/spandsp/src/libtiff.vcproj
freeswitch/trunk/libs/spandsp/src/msvc/make_at_dictionary.vcproj
freeswitch/trunk/libs/spandsp/src/msvc/make_modem_filter.vcproj
Modified:
freeswitch/trunk/Freeswitch.2008.express.sln
freeswitch/trunk/Freeswitch.2008.sln
freeswitch/trunk/libs/spandsp/src/Makefile.am
Modified: freeswitch/trunk/Freeswitch.2008.express.sln
==============================================================================
--- freeswitch/trunk/Freeswitch.2008.express.sln (original)
+++ freeswitch/trunk/Freeswitch.2008.express.sln Fri Feb 20 14:19:58 2009
@@ -573,12 +573,12 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download TIFF", "libs\win32\Download TIFF.2008.vcproj", "{2B8A45C9-FEB4-4734-AB37-8DB9DB899917}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libs\spandsp\src\libspandsp.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libs\spandsp\src\libspandsp.2008.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}"
ProjectSection(ProjectDependencies) = postProject
{401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libs\spandsp\src\libtiff.vcproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libs\spandsp\src\libtiff.2008.vcproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}"
ProjectSection(ProjectDependencies) = postProject
{2B8A45C9-FEB4-4734-AB37-8DB9DB899917} = {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}
EndProjectSection
Modified: freeswitch/trunk/Freeswitch.2008.sln
==============================================================================
--- freeswitch/trunk/Freeswitch.2008.sln (original)
+++ freeswitch/trunk/Freeswitch.2008.sln Fri Feb 20 14:19:58 2009
@@ -951,12 +951,12 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download TIFF", "libs\win32\Download TIFF.2008.vcproj", "{2B8A45C9-FEB4-4734-AB37-8DB9DB899917}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libs\spandsp\src\libtiff.vcproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libs\spandsp\src\libtiff.2008.vcproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}"
ProjectSection(ProjectDependencies) = postProject
{2B8A45C9-FEB4-4734-AB37-8DB9DB899917} = {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libs\spandsp\src\libspandsp.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libs\spandsp\src\libspandsp.2008.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}"
ProjectSection(ProjectDependencies) = postProject
{401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}
EndProjectSection
Modified: freeswitch/trunk/libs/spandsp/src/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/Makefile.am (original)
+++ freeswitch/trunk/libs/spandsp/src/Makefile.am Fri Feb 20 14:19:58 2009
@@ -1,461 +1,462 @@
-##
-## SpanDSP - a series of DSP components for telephony
-##
-## Makefile.am - Process this file with automake to produce Makefile.in
-##
-## This program is free software; you can redistribute it and/or modify
-## it under the terms of the GNU Lesser General Public License version 2.1,
-## as published by the Free Software Foundation.
-##
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this program; if not, write to the Free Software
-## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-##
-## $Id: Makefile.am,v 1.124 2009/02/14 15:21:14 steveu Exp $
-
-AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
-AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
-
-MAINTAINERCLEANFILES = Makefile.in
-
-EXTRA_DIST = floating_fudge.h \
- spandsp/version.h.in \
- libspandsp.dsp \
- libspandsp.sln \
- libspandsp.vcproj \
- msvc/config.h \
- msvc/getopt.c \
- msvc/gettimeofday.c \
- msvc/inttypes.h \
- msvc/tgmath.h \
- msvc/unistd.h \
- msvc/spandsp.h \
- msvc/sys/time.h \
- msvc/make_at_dictionary.vcproj \
- msvc/make_headers.bat \
- msvc/make_modem_filter.vcproj \
- msvc/msvcproj.head \
- msvc/msvcproj.foot \
- msvc/vc8proj.head \
- msvc/vc8proj.foot \
- spandsp/private/README
-INCLUDES = -I$(top_builddir)
-
-lib_LTLIBRARIES = libspandsp.la
-
-libspandsp_la_SOURCES = adsi.c \
- async.c \
- at_interpreter.c \
- awgn.c \
- bell_r2_mf.c \
- bert.c \
- bit_operations.c \
- bitstream.c \
- complex_filters.c \
- complex_vector_float.c \
- complex_vector_int.c \
- crc.c \
- dds_float.c \
- dds_int.c \
- dtmf.c \
- echo.c \
- fax.c \
- fax_modems.c \
- fsk.c \
- g711.c \
- g722.c \
- g726.c \
- gsm0610_decode.c \
- gsm0610_encode.c \
- gsm0610_long_term.c \
- gsm0610_lpc.c \
- gsm0610_preprocess.c \
- gsm0610_rpe.c \
- gsm0610_short_term.c \
- hdlc.c \
- ima_adpcm.c \
- logging.c \
- lpc10_analyse.c \
- lpc10_decode.c \
- lpc10_encode.c \
- lpc10_placev.c \
- lpc10_voicing.c \
- modem_echo.c \
- modem_connect_tones.c \
- noise.c \
- oki_adpcm.c \
- playout.c \
- plc.c \
- power_meter.c \
- queue.c \
- schedule.c \
- sig_tone.c \
- silence_gen.c \
- super_tone_rx.c \
- super_tone_tx.c \
- t4.c \
- t30.c \
- t30_api.c \
- t30_logging.c \
- t31.c \
- t35.c \
- t38_core.c \
- t38_gateway.c \
- t38_non_ecm_buffer.c \
- t38_terminal.c \
- testcpuid.c \
- time_scale.c \
- tone_detect.c \
- tone_generate.c \
- v17rx.c \
- v17tx.c \
- v22bis_rx.c \
- v22bis_tx.c \
- v27ter_rx.c \
- v27ter_tx.c \
- v29rx.c \
- v29tx.c \
- v42.c \
- v42bis.c \
- v8.c \
- vector_float.c \
- vector_int.c
-
-libspandsp_la_LDFLAGS = -version-info @SPANDSP_LT_CURRENT@:@SPANDSP_LT_REVISION@:@SPANDSP_LT_AGE@ $(COMP_VENDOR_FLAGS)
-
-nobase_include_HEADERS = spandsp/adsi.h \
- spandsp/async.h \
- spandsp/arctan2.h \
- spandsp/at_interpreter.h \
- spandsp/awgn.h \
- spandsp/bell_r2_mf.h \
- spandsp/bert.h \
- spandsp/biquad.h \
- spandsp/bit_operations.h \
- spandsp/bitstream.h \
- spandsp/crc.h \
- spandsp/complex.h \
- spandsp/complex_filters.h \
- spandsp/complex_vector_float.h \
- spandsp/complex_vector_int.h \
- spandsp/dc_restore.h \
- spandsp/dds.h \
- spandsp/dtmf.h \
- spandsp/echo.h \
- spandsp/fast_convert.h \
- spandsp/fax.h \
- spandsp/fax_modems.h \
- spandsp/fir.h \
- spandsp/fsk.h \
- spandsp/g168models.h \
- spandsp/g711.h \
- spandsp/g722.h \
- spandsp/g726.h \
- spandsp/gsm0610.h \
- spandsp/hdlc.h \
- spandsp/ima_adpcm.h \
- spandsp/logging.h \
- spandsp/lpc10.h \
- spandsp/modem_echo.h \
- spandsp/modem_connect_tones.h \
- spandsp/noise.h \
- spandsp/oki_adpcm.h \
- spandsp/playout.h \
- spandsp/plc.h \
- spandsp/power_meter.h \
- spandsp/queue.h \
- spandsp/saturated.h \
- spandsp/schedule.h \
- spandsp/sig_tone.h \
- spandsp/silence_gen.h \
- spandsp/super_tone_rx.h \
- spandsp/super_tone_tx.h \
- spandsp/t4.h \
- spandsp/t30.h \
- spandsp/t30_api.h \
- spandsp/t30_fcf.h \
- spandsp/t30_logging.h \
- spandsp/t31.h \
- spandsp/t35.h \
- spandsp/t38_core.h \
- spandsp/t38_gateway.h \
- spandsp/t38_non_ecm_buffer.h \
- spandsp/t38_terminal.h \
- spandsp/telephony.h \
- spandsp/time_scale.h \
- spandsp/timing.h \
- spandsp/tone_detect.h \
- spandsp/tone_generate.h \
- spandsp/v17rx.h \
- spandsp/v17tx.h \
- spandsp/v22bis.h \
- spandsp/v27ter_rx.h \
- spandsp/v27ter_tx.h \
- spandsp/v29rx.h \
- spandsp/v29tx.h \
- spandsp/v42.h \
- spandsp/v42bis.h \
- spandsp/v8.h \
- spandsp/vector_float.h \
- spandsp/vector_int.h \
- spandsp/version.h \
- spandsp/private/adsi.h \
- spandsp/private/async.h \
- spandsp/private/at_interpreter.h \
- spandsp/private/awgn.h \
- spandsp/private/bell_r2_mf.h \
- spandsp/private/bert.h \
- spandsp/private/bitstream.h \
- spandsp/private/dtmf.h \
- spandsp/private/fax.h \
- spandsp/private/fax_modems.h \
- spandsp/private/fsk.h \
- spandsp/private/g711.h \
- spandsp/private/g722.h \
- spandsp/private/g726.h \
- spandsp/private/gsm0610.h \
- spandsp/private/hdlc.h \
- spandsp/private/ima_adpcm.h \
- spandsp/private/logging.h \
- spandsp/private/lpc10.h \
- spandsp/private/modem_connect_tones.h \
- spandsp/private/noise.h \
- spandsp/private/oki_adpcm.h \
- spandsp/private/queue.h \
- spandsp/private/schedule.h \
- spandsp/private/sig_tone.h \
- spandsp/private/super_tone_rx.h \
- spandsp/private/super_tone_tx.h \
- spandsp/private/t30.h \
- spandsp/private/t31.h \
- spandsp/private/t38_core.h \
- spandsp/private/t38_gateway.h \
- spandsp/private/t38_non_ecm_buffer.h \
- spandsp/private/t38_terminal.h \
- spandsp/private/t4.h \
- spandsp/private/time_scale.h \
- spandsp/private/tone_detect.h \
- spandsp/private/tone_generate.h \
- spandsp/private/v17rx.h \
- spandsp/private/v17tx.h \
- spandsp/private/v22bis.h \
- spandsp/private/v27ter_rx.h \
- spandsp/private/v27ter_tx.h \
- spandsp/private/v29rx.h \
- spandsp/private/v29tx.h \
- spandsp/private/v42.h \
- spandsp/private/v42bis.h \
- spandsp/private/v8.h \
- spandsp/expose.h
-
-nodist_include_HEADERS = spandsp.h
-
-noinst_HEADERS = faxfont.h \
- filter_tools.h \
- gsm0610_local.h \
- lpc10_encdecs.h \
- t30_local.h \
- t4_states.h \
- v17rx_constellation_maps.h \
- v17tx_constellation_maps.h \
- v29tx_constellation_maps.h
-
-noinst_PROGRAMS = make_at_dictionary \
- make_modem_filter
-
-make_modem_filter_SOURCES = make_modem_filter.c \
- filter_tools.c
-
-# We need to run make_at_dictionary, so it generates the
-# at_interpreter_dictionary.h file
-
-at_interpreter.$(OBJEXT): at_interpreter_dictionary.h
-
-at_interpreter.lo: at_interpreter_dictionary.h
-
-at_interpreter_dictionary.h: make_at_dictionary$(EXEEXT)
- ./make_at_dictionary$(EXEEXT) >at_interpreter_dictionary.h
-
-v17rx.$(OBJEXT): v17rx_fixed_rrc.h v17rx_floating_rrc.h
-
-v17rx.lo: v17rx_fixed_rrc.h v17rx_floating_rrc.h
-
-v17rx_fixed_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.17 -i -r >v17rx_fixed_rrc.h
-
-v17rx_floating_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.17 -r >v17rx_floating_rrc.h
-
-v17tx.$(OBJEXT): v17tx_fixed_rrc.h v17tx_floating_rrc.h
-
-v17tx.lo: v17tx_fixed_rrc.h v17tx_floating_rrc.h
-
-v17tx_fixed_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.17 -i -t >v17tx_fixed_rrc.h
-
-v17tx_floating_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.17 -t >v17tx_floating_rrc.h
-
-v22bis_rx.$(OBJEXT): v22bis_rx_1200_fixed_rrc.h \
- v22bis_rx_2400_fixed_rrc.h \
- v22bis_rx_1200_floating_rrc.h \
- v22bis_rx_2400_floating_rrc.h
-
-v22bis_rx.lo: v22bis_rx_1200_fixed_rrc.h \
- v22bis_rx_2400_fixed_rrc.h \
- v22bis_rx_1200_floating_rrc.h \
- v22bis_rx_2400_floating_rrc.h
-
-v22bis_rx_1200_fixed_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.22bis1200 -i -r >v22bis_rx_1200_fixed_rrc.h
-
-v22bis_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.22bis2400 -i -r >v22bis_rx_2400_fixed_rrc.h
-
-v22bis_rx_1200_floating_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.22bis1200 -r >v22bis_rx_1200_floating_rrc.h
-
-v22bis_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.22bis2400 -r >v22bis_rx_2400_floating_rrc.h
-
-v22bis_tx.$(OBJEXT): v22bis_tx_fixed_rrc.h v22bis_tx_floating_rrc.h
-
-v22bis_tx.lo: v22bis_tx_fixed_rrc.h v22bis_tx_floating_rrc.h
-
-v22bis_tx_fixed_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.22bis -i -t >v22bis_tx_fixed_rrc.h
-
-v22bis_tx_floating_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.22bis -t >v22bis_tx_floating_rrc.h
-
-v27ter_rx_.$(OBJEXT): v27ter_rx_2400_fixed_rrc.h \
- v27ter_rx_4800_fixed_rrc.h \
- v27ter_rx_2400_floating_rrc.h \
- v27ter_rx_4800_floating_rrc.h
-
-v27ter_rx.lo: v27ter_rx_2400_fixed_rrc.h \
- v27ter_rx_4800_fixed_rrc.h \
- v27ter_rx_2400_floating_rrc.h \
- v27ter_rx_4800_floating_rrc.h
-
-v27ter_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -r >v27ter_rx_2400_fixed_rrc.h
-
-v27ter_rx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -r >v27ter_rx_4800_fixed_rrc.h
-
-v27ter_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.27ter2400 -r >v27ter_rx_2400_floating_rrc.h
-
-v27ter_rx_4800_floating_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.27ter4800 -r >v27ter_rx_4800_floating_rrc.h
-
-v27ter_tx_.$(OBJEXT): v27ter_tx_2400_fixed_rrc.h \
- v27ter_tx_4800_fixed_rrc.h \
- v27ter_tx_2400_floating_rrc.h \
- v27ter_tx_4800_floating_rrc.h
-
-v27ter_tx.lo: v27ter_tx_2400_fixed_rrc.h \
- v27ter_tx_4800_fixed_rrc.h \
- v27ter_tx_2400_floating_rrc.h \
- v27ter_tx_4800_floating_rrc.h
-
-v27ter_tx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -t >v27ter_tx_2400_fixed_rrc.h
-
-v27ter_tx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -t >v27ter_tx_4800_fixed_rrc.h
-
-v27ter_tx_2400_floating_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.27ter2400 -t >v27ter_tx_2400_floating_rrc.h
-
-v27ter_tx_4800_floating_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.27ter4800 -t >v27ter_tx_4800_floating_rrc.h
-
-v29rx.$(OBJEXT): v29rx_fixed_rrc.h v29rx_floating_rrc.h
-
-v29rx.lo: v29rx_fixed_rrc.h v29rx_floating_rrc.h
-
-v29rx_fixed_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.29 -i -r >v29rx_fixed_rrc.h
-
-v29rx_floating_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.29 -r >v29rx_floating_rrc.h
-
-v29tx.$(OBJEXT): v29tx_fixed_rrc.h v29tx_floating_rrc.h
-
-v29tx.lo: v29tx_fixed_rrc.h v29tx_floating_rrc.h
-
-v29tx_fixed_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.29 -i -t >v29tx_fixed_rrc.h
-
-v29tx_floating_rrc.h: make_modem_filter$(EXEEXT)
- ./make_modem_filter$(EXEEXT) -m V.29 -t >v29tx_floating_rrc.h
-
-DSP = libspandsp.dsp
-VCPROJ = libspandsp.vcproj
-
-WIN32SOURCES = $(libspandsp_la_SOURCES) .\\msvc\\gettimeofday.c
-WIN32HEADERS = $(nobase_include_HEADERS) spandsp.h
-
-DSPOUT = | awk '{printf("%s\r\n", $$0)}' >> $(DSP)
-VCPROJOUT = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ)
-
-$(DSP): msvc/msvcproj.head msvc/msvcproj.foot Makefile.am
- echo "creating $(DSP)"
- @(cp $(srcdir)/msvc/msvcproj.head $(DSP); \
- echo "# Begin Group \"Source Files\"" $(DSPOUT); \
- for file in $(WIN32SOURCES); do \
- echo "# Begin Source File" $(DSPOUT); \
- echo "" $(DSPOUT); \
- echo "SOURCE=.\\"$$file $(DSPOUT); \
- echo "# End Source File" $(DSPOUT); \
- done; \
- echo "# End Group" $(DSPOUT); \
- echo "# Begin Group \"Header Files\"" $(DSPOUT); \
- for file in $(WIN32HEADERS); do \
- echo "# Begin Source File" $(DSPOUT); \
- echo "" $(DSPOUT); \
- echo "SOURCE=.\\"$$file $(DSPOUT); \
- echo "# End Source File" $(DSPOUT); \
- done; \
- echo "# End Group" $(DSPOUT); \
- cat $(srcdir)/msvc/msvcproj.foot $(DSPOUT) )
-
-$(VCPROJ): msvc/vc8proj.head msvc/vc8proj.foot Makefile.am
- echo "creating $(VCPROJ)"
- @(cp $(srcdir)/msvc/vc8proj.head $(VCPROJ); \
- for file in $(WIN32SOURCES); do \
- echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT); \
- done; \
- echo "</Filter><Filter Name=\"Header Files\">" $(VCPROJOUT); \
- for file in $(WIN32HEADERS); do \
- echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT); \
- done; \
- cat $(srcdir)/msvc/vc8proj.foot $(VCPROJOUT) )
-
-$(srcdir)/msvc/spandsp.h: spandsp.h.in
- echo "creating $(srcdir)/msvc/spandsp.h"
- @cp $(srcdir)/spandsp.h.in $(srcdir)/msvc/spandsp.h
- @sed -i -e "s/\@SPANDSP_USE_FIXED_POINT\@/#undef SPANDSP_USE_FIXED_POINT/" $(srcdir)/msvc/spandsp.h
- @sed -i -e "s/\@SPANDSP_MISALIGNED_ACCESS_FAILS\@/#undef SPANDSP_MISALIGNED_ACCESS_FAILS/" $(srcdir)/msvc/spandsp.h
- @sed -i -e "s/\@SPANDSP_USE_EXPORT_CAPABILITY\@/#define SPANDSP_USE_EXPORT_CAPABILITY 1/" $(srcdir)/msvc/spandsp.h
- @sed -i -e "s/\@INSERT_INTTYPES_HEADER\@/#include <inttypes.h>/" $(srcdir)/msvc/spandsp.h
- @sed -i -e "s/\@INSERT_MATH_HEADER\@/#include <math.h>/" $(srcdir)/msvc/spandsp.h
-
-spandsp/version.h:
- NOWDATE=`date --utc +"%Y%m%d"` ; \
- NOWTIME=`date --utc +"%H%M%S"` ; \
- sed 's/$$SPANDSP_RELEASE_DATE/'$$NOWDATE'/;s/$$SPANDSP_RELEASE_TIME/'$$NOWTIME'/' \
- <spandsp/version.h.in >spandsp/version.h
-
-dist-hook:
- NOWDATE=`date --utc +"%Y%m%d"` ; \
- NOWTIME=`date --utc +"%H%M%S"` ; \
- sed 's/$$SPANDSP_RELEASE_DATE/'$$NOWDATE'/;s/$$SPANDSP_RELEASE_TIME/'$$NOWTIME'/' \
- <spandsp/version.h.in >spandsp/version.h
+##
+## SpanDSP - a series of DSP components for telephony
+##
+## Makefile.am - Process this file with automake to produce Makefile.in
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU Lesser General Public License version 2.1,
+## as published by the Free Software Foundation.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU Lesser General Public License for more details.
+##
+## You should have received a copy of the GNU Lesser General Public
+## License along with this program; if not, write to the Free Software
+## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+##
+## $Id: Makefile.am,v 1.124 2009/02/14 15:21:14 steveu Exp $
+
+AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
+AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
+
+MAINTAINERCLEANFILES = Makefile.in
+
+EXTRA_DIST = floating_fudge.h \
+ spandsp/version.h.in \
+ libspandsp.dsp \
+ libspandsp.2008.sln \
+ libspandsp.2008.vcproj \
+ libtiff.2008.vcproj \
+ msvc/config.h \
+ msvc/getopt.c \
+ msvc/gettimeofday.c \
+ msvc/inttypes.h \
+ msvc/tgmath.h \
+ msvc/unistd.h \
+ msvc/spandsp.h \
+ msvc/sys/time.h \
+ msvc/make_at_dictionary.2008.vcproj \
+ msvc/make_headers.bat \
+ msvc/make_modem_filter.2008.vcproj \
+ msvc/msvcproj.head \
+ msvc/msvcproj.foot \
+ msvc/vc8proj.head \
+ msvc/vc8proj.foot \
+ spandsp/private/README
+INCLUDES = -I$(top_builddir)
+
+lib_LTLIBRARIES = libspandsp.la
+
+libspandsp_la_SOURCES = adsi.c \
+ async.c \
+ at_interpreter.c \
+ awgn.c \
+ bell_r2_mf.c \
+ bert.c \
+ bit_operations.c \
+ bitstream.c \
+ complex_filters.c \
+ complex_vector_float.c \
+ complex_vector_int.c \
+ crc.c \
+ dds_float.c \
+ dds_int.c \
+ dtmf.c \
+ echo.c \
+ fax.c \
+ fax_modems.c \
+ fsk.c \
+ g711.c \
+ g722.c \
+ g726.c \
+ gsm0610_decode.c \
+ gsm0610_encode.c \
+ gsm0610_long_term.c \
+ gsm0610_lpc.c \
+ gsm0610_preprocess.c \
+ gsm0610_rpe.c \
+ gsm0610_short_term.c \
+ hdlc.c \
+ ima_adpcm.c \
+ logging.c \
+ lpc10_analyse.c \
+ lpc10_decode.c \
+ lpc10_encode.c \
+ lpc10_placev.c \
+ lpc10_voicing.c \
+ modem_echo.c \
+ modem_connect_tones.c \
+ noise.c \
+ oki_adpcm.c \
+ playout.c \
+ plc.c \
+ power_meter.c \
+ queue.c \
+ schedule.c \
+ sig_tone.c \
+ silence_gen.c \
+ super_tone_rx.c \
+ super_tone_tx.c \
+ t4.c \
+ t30.c \
+ t30_api.c \
+ t30_logging.c \
+ t31.c \
+ t35.c \
+ t38_core.c \
+ t38_gateway.c \
+ t38_non_ecm_buffer.c \
+ t38_terminal.c \
+ testcpuid.c \
+ time_scale.c \
+ tone_detect.c \
+ tone_generate.c \
+ v17rx.c \
+ v17tx.c \
+ v22bis_rx.c \
+ v22bis_tx.c \
+ v27ter_rx.c \
+ v27ter_tx.c \
+ v29rx.c \
+ v29tx.c \
+ v42.c \
+ v42bis.c \
+ v8.c \
+ vector_float.c \
+ vector_int.c
+
+libspandsp_la_LDFLAGS = -version-info @SPANDSP_LT_CURRENT@:@SPANDSP_LT_REVISION@:@SPANDSP_LT_AGE@ $(COMP_VENDOR_FLAGS)
+
+nobase_include_HEADERS = spandsp/adsi.h \
+ spandsp/async.h \
+ spandsp/arctan2.h \
+ spandsp/at_interpreter.h \
+ spandsp/awgn.h \
+ spandsp/bell_r2_mf.h \
+ spandsp/bert.h \
+ spandsp/biquad.h \
+ spandsp/bit_operations.h \
+ spandsp/bitstream.h \
+ spandsp/crc.h \
+ spandsp/complex.h \
+ spandsp/complex_filters.h \
+ spandsp/complex_vector_float.h \
+ spandsp/complex_vector_int.h \
+ spandsp/dc_restore.h \
+ spandsp/dds.h \
+ spandsp/dtmf.h \
+ spandsp/echo.h \
+ spandsp/fast_convert.h \
+ spandsp/fax.h \
+ spandsp/fax_modems.h \
+ spandsp/fir.h \
+ spandsp/fsk.h \
+ spandsp/g168models.h \
+ spandsp/g711.h \
+ spandsp/g722.h \
+ spandsp/g726.h \
+ spandsp/gsm0610.h \
+ spandsp/hdlc.h \
+ spandsp/ima_adpcm.h \
+ spandsp/logging.h \
+ spandsp/lpc10.h \
+ spandsp/modem_echo.h \
+ spandsp/modem_connect_tones.h \
+ spandsp/noise.h \
+ spandsp/oki_adpcm.h \
+ spandsp/playout.h \
+ spandsp/plc.h \
+ spandsp/power_meter.h \
+ spandsp/queue.h \
+ spandsp/saturated.h \
+ spandsp/schedule.h \
+ spandsp/sig_tone.h \
+ spandsp/silence_gen.h \
+ spandsp/super_tone_rx.h \
+ spandsp/super_tone_tx.h \
+ spandsp/t4.h \
+ spandsp/t30.h \
+ spandsp/t30_api.h \
+ spandsp/t30_fcf.h \
+ spandsp/t30_logging.h \
+ spandsp/t31.h \
+ spandsp/t35.h \
+ spandsp/t38_core.h \
+ spandsp/t38_gateway.h \
+ spandsp/t38_non_ecm_buffer.h \
+ spandsp/t38_terminal.h \
+ spandsp/telephony.h \
+ spandsp/time_scale.h \
+ spandsp/timing.h \
+ spandsp/tone_detect.h \
+ spandsp/tone_generate.h \
+ spandsp/v17rx.h \
+ spandsp/v17tx.h \
+ spandsp/v22bis.h \
+ spandsp/v27ter_rx.h \
+ spandsp/v27ter_tx.h \
+ spandsp/v29rx.h \
+ spandsp/v29tx.h \
+ spandsp/v42.h \
+ spandsp/v42bis.h \
+ spandsp/v8.h \
+ spandsp/vector_float.h \
+ spandsp/vector_int.h \
+ spandsp/version.h \
+ spandsp/private/adsi.h \
+ spandsp/private/async.h \
+ spandsp/private/at_interpreter.h \
+ spandsp/private/awgn.h \
+ spandsp/private/bell_r2_mf.h \
+ spandsp/private/bert.h \
+ spandsp/private/bitstream.h \
+ spandsp/private/dtmf.h \
+ spandsp/private/fax.h \
+ spandsp/private/fax_modems.h \
+ spandsp/private/fsk.h \
+ spandsp/private/g711.h \
+ spandsp/private/g722.h \
+ spandsp/private/g726.h \
+ spandsp/private/gsm0610.h \
+ spandsp/private/hdlc.h \
+ spandsp/private/ima_adpcm.h \
+ spandsp/private/logging.h \
+ spandsp/private/lpc10.h \
+ spandsp/private/modem_connect_tones.h \
+ spandsp/private/noise.h \
+ spandsp/private/oki_adpcm.h \
+ spandsp/private/queue.h \
+ spandsp/private/schedule.h \
+ spandsp/private/sig_tone.h \
+ spandsp/private/super_tone_rx.h \
+ spandsp/private/super_tone_tx.h \
+ spandsp/private/t30.h \
+ spandsp/private/t31.h \
+ spandsp/private/t38_core.h \
+ spandsp/private/t38_gateway.h \
+ spandsp/private/t38_non_ecm_buffer.h \
+ spandsp/private/t38_terminal.h \
+ spandsp/private/t4.h \
+ spandsp/private/time_scale.h \
+ spandsp/private/tone_detect.h \
+ spandsp/private/tone_generate.h \
+ spandsp/private/v17rx.h \
+ spandsp/private/v17tx.h \
+ spandsp/private/v22bis.h \
+ spandsp/private/v27ter_rx.h \
+ spandsp/private/v27ter_tx.h \
+ spandsp/private/v29rx.h \
+ spandsp/private/v29tx.h \
+ spandsp/private/v42.h \
+ spandsp/private/v42bis.h \
+ spandsp/private/v8.h \
+ spandsp/expose.h
+
+nodist_include_HEADERS = spandsp.h
+
+noinst_HEADERS = faxfont.h \
+ filter_tools.h \
+ gsm0610_local.h \
+ lpc10_encdecs.h \
+ t30_local.h \
+ t4_states.h \
+ v17rx_constellation_maps.h \
+ v17tx_constellation_maps.h \
+ v29tx_constellation_maps.h
+
+noinst_PROGRAMS = make_at_dictionary \
+ make_modem_filter
+
+make_modem_filter_SOURCES = make_modem_filter.c \
+ filter_tools.c
+
+# We need to run make_at_dictionary, so it generates the
+# at_interpreter_dictionary.h file
+
+at_interpreter.$(OBJEXT): at_interpreter_dictionary.h
+
+at_interpreter.lo: at_interpreter_dictionary.h
+
+at_interpreter_dictionary.h: make_at_dictionary$(EXEEXT)
+ ./make_at_dictionary$(EXEEXT) >at_interpreter_dictionary.h
+
+v17rx.$(OBJEXT): v17rx_fixed_rrc.h v17rx_floating_rrc.h
+
+v17rx.lo: v17rx_fixed_rrc.h v17rx_floating_rrc.h
+
+v17rx_fixed_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.17 -i -r >v17rx_fixed_rrc.h
+
+v17rx_floating_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.17 -r >v17rx_floating_rrc.h
+
+v17tx.$(OBJEXT): v17tx_fixed_rrc.h v17tx_floating_rrc.h
+
+v17tx.lo: v17tx_fixed_rrc.h v17tx_floating_rrc.h
+
+v17tx_fixed_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.17 -i -t >v17tx_fixed_rrc.h
+
+v17tx_floating_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.17 -t >v17tx_floating_rrc.h
+
+v22bis_rx.$(OBJEXT): v22bis_rx_1200_fixed_rrc.h \
+ v22bis_rx_2400_fixed_rrc.h \
+ v22bis_rx_1200_floating_rrc.h \
+ v22bis_rx_2400_floating_rrc.h
+
+v22bis_rx.lo: v22bis_rx_1200_fixed_rrc.h \
+ v22bis_rx_2400_fixed_rrc.h \
+ v22bis_rx_1200_floating_rrc.h \
+ v22bis_rx_2400_floating_rrc.h
+
+v22bis_rx_1200_fixed_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.22bis1200 -i -r >v22bis_rx_1200_fixed_rrc.h
+
+v22bis_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.22bis2400 -i -r >v22bis_rx_2400_fixed_rrc.h
+
+v22bis_rx_1200_floating_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.22bis1200 -r >v22bis_rx_1200_floating_rrc.h
+
+v22bis_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.22bis2400 -r >v22bis_rx_2400_floating_rrc.h
+
+v22bis_tx.$(OBJEXT): v22bis_tx_fixed_rrc.h v22bis_tx_floating_rrc.h
+
+v22bis_tx.lo: v22bis_tx_fixed_rrc.h v22bis_tx_floating_rrc.h
+
+v22bis_tx_fixed_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.22bis -i -t >v22bis_tx_fixed_rrc.h
+
+v22bis_tx_floating_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.22bis -t >v22bis_tx_floating_rrc.h
+
+v27ter_rx_.$(OBJEXT): v27ter_rx_2400_fixed_rrc.h \
+ v27ter_rx_4800_fixed_rrc.h \
+ v27ter_rx_2400_floating_rrc.h \
+ v27ter_rx_4800_floating_rrc.h
+
+v27ter_rx.lo: v27ter_rx_2400_fixed_rrc.h \
+ v27ter_rx_4800_fixed_rrc.h \
+ v27ter_rx_2400_floating_rrc.h \
+ v27ter_rx_4800_floating_rrc.h
+
+v27ter_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -r >v27ter_rx_2400_fixed_rrc.h
+
+v27ter_rx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -r >v27ter_rx_4800_fixed_rrc.h
+
+v27ter_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.27ter2400 -r >v27ter_rx_2400_floating_rrc.h
+
+v27ter_rx_4800_floating_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.27ter4800 -r >v27ter_rx_4800_floating_rrc.h
+
+v27ter_tx_.$(OBJEXT): v27ter_tx_2400_fixed_rrc.h \
+ v27ter_tx_4800_fixed_rrc.h \
+ v27ter_tx_2400_floating_rrc.h \
+ v27ter_tx_4800_floating_rrc.h
+
+v27ter_tx.lo: v27ter_tx_2400_fixed_rrc.h \
+ v27ter_tx_4800_fixed_rrc.h \
+ v27ter_tx_2400_floating_rrc.h \
+ v27ter_tx_4800_floating_rrc.h
+
+v27ter_tx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -t >v27ter_tx_2400_fixed_rrc.h
+
+v27ter_tx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -t >v27ter_tx_4800_fixed_rrc.h
+
+v27ter_tx_2400_floating_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.27ter2400 -t >v27ter_tx_2400_floating_rrc.h
+
+v27ter_tx_4800_floating_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.27ter4800 -t >v27ter_tx_4800_floating_rrc.h
+
+v29rx.$(OBJEXT): v29rx_fixed_rrc.h v29rx_floating_rrc.h
+
+v29rx.lo: v29rx_fixed_rrc.h v29rx_floating_rrc.h
+
+v29rx_fixed_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.29 -i -r >v29rx_fixed_rrc.h
+
+v29rx_floating_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.29 -r >v29rx_floating_rrc.h
+
+v29tx.$(OBJEXT): v29tx_fixed_rrc.h v29tx_floating_rrc.h
+
+v29tx.lo: v29tx_fixed_rrc.h v29tx_floating_rrc.h
+
+v29tx_fixed_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.29 -i -t >v29tx_fixed_rrc.h
+
+v29tx_floating_rrc.h: make_modem_filter$(EXEEXT)
+ ./make_modem_filter$(EXEEXT) -m V.29 -t >v29tx_floating_rrc.h
+
+DSP = libspandsp.dsp
+VCPROJ8 = libspandsp.2008.vcproj
+
+WIN32SOURCES = $(libspandsp_la_SOURCES) .\\msvc\\gettimeofday.c
+WIN32HEADERS = $(nobase_include_HEADERS) spandsp.h
+
+DSPOUT = | awk '{printf("%s\r\n", $$0)}' >> $(DSP)
+VCPROJOUT8 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ8)
+
+$(DSP): msvc/msvcproj.head msvc/msvcproj.foot Makefile.am
+ echo "creating $(DSP)"
+ @(cp $(srcdir)/msvc/msvcproj.head $(DSP); \
+ echo "# Begin Group \"Source Files\"" $(DSPOUT); \
+ for file in $(WIN32SOURCES); do \
+ echo "# Begin Source File" $(DSPOUT); \
+ echo "" $(DSPOUT); \
+ echo "SOURCE=.\\"$$file $(DSPOUT); \
+ echo "# End Source File" $(DSPOUT); \
+ done; \
+ echo "# End Group" $(DSPOUT); \
+ echo "# Begin Group \"Header Files\"" $(DSPOUT); \
+ for file in $(WIN32HEADERS); do \
+ echo "# Begin Source File" $(DSPOUT); \
+ echo "" $(DSPOUT); \
+ echo "SOURCE=.\\"$$file $(DSPOUT); \
+ echo "# End Source File" $(DSPOUT); \
+ done; \
+ echo "# End Group" $(DSPOUT); \
+ cat $(srcdir)/msvc/msvcproj.foot $(DSPOUT) )
+
+$(VCPROJ8): msvc/vc8proj.head msvc/vc8proj.foot Makefile.am
+ echo "creating $(VCPROJ8)"
+ @(cp $(srcdir)/msvc/vc8proj.head $(VCPROJ8); \
+ for file in $(WIN32SOURCES); do \
+ echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT8); \
+ done; \
+ echo "</Filter><Filter Name=\"Header Files\">" $(VCPROJOUT8); \
+ for file in $(WIN32HEADERS); do \
+ echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT8); \
+ done; \
+ cat $(srcdir)/msvc/vc8proj.foot $(VCPROJOUT8) )
+
+$(srcdir)/msvc/spandsp.h: spandsp.h.in
+ echo "creating $(srcdir)/msvc/spandsp.h"
+ @cp $(srcdir)/spandsp.h.in $(srcdir)/msvc/spandsp.h
+ @sed -i -e "s/\@SPANDSP_USE_FIXED_POINT\@/#undef SPANDSP_USE_FIXED_POINT/" $(srcdir)/msvc/spandsp.h
+ @sed -i -e "s/\@SPANDSP_MISALIGNED_ACCESS_FAILS\@/#undef SPANDSP_MISALIGNED_ACCESS_FAILS/" $(srcdir)/msvc/spandsp.h
+ @sed -i -e "s/\@SPANDSP_USE_EXPORT_CAPABILITY\@/#define SPANDSP_USE_EXPORT_CAPABILITY 1/" $(srcdir)/msvc/spandsp.h
+ @sed -i -e "s/\@INSERT_INTTYPES_HEADER\@/#include <inttypes.h>/" $(srcdir)/msvc/spandsp.h
+ @sed -i -e "s/\@INSERT_MATH_HEADER\@/#include <math.h>/" $(srcdir)/msvc/spandsp.h
+
+spandsp/version.h:
+ NOWDATE=`date --utc +"%Y%m%d"` ; \
+ NOWTIME=`date --utc +"%H%M%S"` ; \
+ sed 's/$$SPANDSP_RELEASE_DATE/'$$NOWDATE'/;s/$$SPANDSP_RELEASE_TIME/'$$NOWTIME'/' \
+ <spandsp/version.h.in >spandsp/version.h
+
+dist-hook:
+ NOWDATE=`date --utc +"%Y%m%d"` ; \
+ NOWTIME=`date --utc +"%H%M%S"` ; \
+ sed 's/$$SPANDSP_RELEASE_DATE/'$$NOWDATE'/;s/$$SPANDSP_RELEASE_TIME/'$$NOWTIME'/' \
+ <spandsp/version.h.in >spandsp/version.h
Copied: freeswitch/trunk/libs/spandsp/src/libspandsp.2008.sln (from r12186, /freeswitch/trunk/libs/spandsp/src/libspandsp.sln)
==============================================================================
--- /freeswitch/trunk/libs/spandsp/src/libspandsp.sln (original)
+++ freeswitch/trunk/libs/spandsp/src/libspandsp.2008.sln Fri Feb 20 14:19:58 2009
@@ -1,16 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "msvc\make_at_dictionary.vcproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "msvc\make_at_dictionary.2008.vcproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "msvc\make_modem_filter.vcproj", "{329A6FA0-0FCC-4435-A950-E670AEFA9838}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "msvc\make_modem_filter.2008.vcproj", "{329A6FA0-0FCC-4435-A950-E670AEFA9838}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libspandsp.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libspandsp.2008.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}"
ProjectSection(ProjectDependencies) = postProject
{401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libtiff.vcproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libtiff.2008.vcproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1
0
20 Feb '09
Author: rupa
Date: Fri Feb 20 14:17:55 2009
New Revision: 12194
Log:
don't reuse the module loader's memory pool for our own
Modified:
freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c
Modified: freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c Fri Feb 20 14:17:55 2009
@@ -978,8 +978,7 @@
return SWITCH_STATUS_FALSE;
#endif
- globals.pool = pool;
-
+ switch_core_new_memory_pool(&globals.pool);
if (lcr_load_config() != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to load lcr config file\n");
1
0
Author: anthm
Date: Fri Feb 20 13:51:34 2009
New Revision: 12193
Log:
reduce the yields
Modified:
freeswitch/trunk/src/switch_ivr_originate.c
Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c (original)
+++ freeswitch/trunk/src/switch_ivr_originate.c Fri Feb 20 13:51:34 2009
@@ -1562,7 +1562,7 @@
goto notready;
}
- switch_yield(100000);
+ switch_cond_next();
}
check_per_channel_timeouts(&oglobals, originate_status, and_argc, start);
@@ -1821,7 +1821,7 @@
}
} else {
- switch_yield(100000);
+ switch_cond_next();
}
}
1
0
[commit] r12192 - freeswitch/trunk/src/mod/event_handlers/mod_erlang_event
by FreeSWITCH SVN 20 Feb '09
by FreeSWITCH SVN 20 Feb '09
20 Feb '09
Author: andrew
Date: Fri Feb 20 12:52:29 2009
New Revision: 12192
Log:
Use switch_strlen_zero_buf instead of switch_strlen_zero; Handle module init failures better
Modified:
freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/handle_msg.c
freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c
Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/handle_msg.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/handle_msg.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/handle_msg.c Fri Feb 20 12:52:29 2009
@@ -426,7 +426,7 @@
}
else {
switch_core_session_t *session;
- if (!switch_strlen_zero(uuid) && (session = switch_core_session_locate(uuid))) {
+ if (!switch_strlen_zero_buf(uuid) && (session = switch_core_session_locate(uuid))) {
switch_event_t *event;
if (switch_event_create(&event, SWITCH_EVENT_SEND_MESSAGE) == SWITCH_STATUS_SUCCESS) {
@@ -538,7 +538,7 @@
ei_x_encode_atom(rbuf, "badarg");
} else {
switch_core_session_t *session;
- if (!switch_strlen_zero(uuid_str) && (session = switch_core_session_locate(uuid_str))) {
+ if (!switch_strlen_zero_buf(uuid_str) && (session = switch_core_session_locate(uuid_str))) {
/* create a new session list element and attach it to this listener */
if ((arity==2 && attach_call_to_pid(listener, &msg->from, session)) ||
(arity==3 && attach_call_to_registered_process(listener, reg_name, session))) {
Modified: freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_erlang_event/mod_erlang_event.c Fri Feb 20 12:52:29 2009
@@ -1365,10 +1365,10 @@
rv = inet_pton(AF_INET, prefs.ip, &server_addr.sin_addr.s_addr);
if (rv == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not parse invalid ip address: %s\n", prefs.ip);
- return SWITCH_STATUS_GENERR;
+ goto init_failed;
} else if (rv == -1) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error when parsing ip address %s : %s\n", prefs.ip, strerror(errno));
- return SWITCH_STATUS_GENERR;
+ goto init_failed;
}
/* set the address family and port */
@@ -1406,22 +1406,20 @@
if (SWITCH_STATUS_SUCCESS!=initialise_ei(&ec)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to init ei connection\n");
- close_socket(&listen_list.sockfd);
- return SWITCH_STATUS_GENERR;
+ goto init_failed;
}
/* return value is -1 for error, a descriptor pointing to epmd otherwise */
if ((epmdfd = ei_publish(&ec, prefs.port)) == -1) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to publish port to empd, trying to start empd manually\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to publish port to empd, trying to start empd via system()\n");
if (system("epmd -daemon")) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to start empd manually\n");
- close_socket(&listen_list.sockfd);
- return SWITCH_STATUS_GENERR;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to start empd manually! Is epmd in $PATH? If not, start it yourself or run an erl shell with -sname or -name\n");
+ goto init_failed;
}
+ switch_yield(100000);
if ((epmdfd = ei_publish(&ec, prefs.port)) == -1) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to publish port to empd AGAIN\n");
- close_socket(&listen_list.sockfd);
- return SWITCH_STATUS_GENERR;
+ goto init_failed;
}
}
@@ -1470,6 +1468,7 @@
ei_unpublish(&ec);
close(epmdfd);
+init_failed:
close_socket(&listen_list.sockfd);
if (pool) {
switch_core_destroy_memory_pool(&pool);
@@ -1491,7 +1490,8 @@
listener_t *l;
int sanity = 0;
- prefs.done = 1;
+ if (prefs.done == 0) /* main thread might already have exited */
+ prefs.done = 1;
switch_log_unbind_logger(socket_logger);
1
0
Author: anthm
Date: Fri Feb 20 12:31:08 2009
New Revision: 12191
Log:
add separate mutex for state related methods
Modified:
freeswitch/trunk/src/switch_channel.c
Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c (original)
+++ freeswitch/trunk/src/switch_channel.c Fri Feb 20 12:31:08 2009
@@ -112,6 +112,7 @@
switch_queue_t *dtmf_queue;
switch_mutex_t *dtmf_mutex;
switch_mutex_t *flag_mutex;
+ switch_mutex_t *state_mutex;
switch_mutex_t *profile_mutex;
switch_core_session_t *session;
switch_channel_state_t state;
@@ -224,6 +225,7 @@
switch_mutex_init(&(*channel)->dtmf_mutex, SWITCH_MUTEX_NESTED, pool);
switch_mutex_init(&(*channel)->flag_mutex, SWITCH_MUTEX_NESTED, pool);
+ switch_mutex_init(&(*channel)->state_mutex, SWITCH_MUTEX_NESTED, pool);
switch_mutex_init(&(*channel)->profile_mutex, SWITCH_MUTEX_NESTED, pool);
(*channel)->hangup_cause = SWITCH_CAUSE_NONE;
(*channel)->name = "";
@@ -845,9 +847,9 @@
switch_channel_state_t state;
switch_assert(channel != NULL);
- switch_mutex_lock(channel->flag_mutex);
+ switch_mutex_lock(channel->state_mutex);
state = channel->state;
- switch_mutex_unlock(channel->flag_mutex);
+ switch_mutex_unlock(channel->state_mutex);
return state;
}
@@ -857,9 +859,9 @@
switch_channel_state_t state;
switch_assert(channel != NULL);
- switch_mutex_lock(channel->flag_mutex);
+ switch_mutex_lock(channel->state_mutex);
state = channel->running_state;
- switch_mutex_unlock(channel->flag_mutex);
+ switch_mutex_unlock(channel->state_mutex);
return state;
}
@@ -926,7 +928,7 @@
const char *file, const char *func, int line)
{
int x;
- switch_mutex_lock(channel->flag_mutex);
+ switch_mutex_lock(channel->state_mutex);
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG, "(%s) Running State Change %s\n", channel->name, state_names[state]);
channel->running_state = state;
@@ -972,7 +974,7 @@
}
}
- switch_mutex_unlock(channel->flag_mutex);
+ switch_mutex_unlock(channel->state_mutex);
return SWITCH_STATUS_SUCCESS;
}
@@ -985,7 +987,7 @@
switch_assert(channel != NULL);
switch_assert(state <= CS_DONE);
- switch_mutex_lock(channel->flag_mutex);
+ switch_mutex_lock(channel->state_mutex);
last_state = channel->state;
switch_assert(last_state <= CS_DONE);
@@ -1165,9 +1167,9 @@
if (ok) {
switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, func, line, NULL, SWITCH_LOG_DEBUG, "(%s) State Change %s -> %s\n",
channel->name, state_names[last_state], state_names[state]);
- switch_mutex_lock(channel->flag_mutex);
+ switch_mutex_lock(channel->state_mutex);
channel->state = state;
- switch_mutex_unlock(channel->flag_mutex);
+ switch_mutex_unlock(channel->state_mutex);
if (state == CS_HANGUP && !channel->hangup_cause) {
channel->hangup_cause = SWITCH_CAUSE_NORMAL_CLEARING;
@@ -1185,7 +1187,7 @@
}
done:
- switch_mutex_unlock(channel->flag_mutex);
+ switch_mutex_unlock(channel->state_mutex);
return channel->state;
}
@@ -1444,7 +1446,7 @@
int x, index;
switch_assert(channel != NULL);
- switch_mutex_lock(channel->flag_mutex);
+ switch_mutex_lock(channel->state_mutex);
for (x = 0; x < SWITCH_MAX_STATE_HANDLERS; x++) {
if (channel->state_handlers[x] == state_handler) {
index = x;
@@ -1461,7 +1463,7 @@
channel->state_handlers[index] = state_handler;
end:
- switch_mutex_unlock(channel->flag_mutex);
+ switch_mutex_unlock(channel->state_mutex);
return index;
}
@@ -1475,9 +1477,9 @@
return NULL;
}
- switch_mutex_lock(channel->flag_mutex);
+ switch_mutex_lock(channel->state_mutex);
h = channel->state_handlers[index];
- switch_mutex_unlock(channel->flag_mutex);
+ switch_mutex_unlock(channel->state_mutex);
return h;
}
@@ -1489,7 +1491,7 @@
switch_assert(channel != NULL);
- switch_mutex_lock(channel->flag_mutex);
+ switch_mutex_lock(channel->state_mutex);
channel->state_handler_index = 0;
if (state_handler) {
@@ -1509,7 +1511,7 @@
}
}
- switch_mutex_unlock(channel->flag_mutex);
+ switch_mutex_unlock(channel->state_mutex);
}
SWITCH_DECLARE(void) switch_channel_set_caller_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension)
@@ -1541,7 +1543,7 @@
const char *file, const char *func, int line, switch_call_cause_t hangup_cause)
{
switch_assert(channel != NULL);
- switch_mutex_lock(channel->flag_mutex);
+ switch_mutex_lock(channel->state_mutex);
if (channel->caller_profile && channel->caller_profile->times && !channel->caller_profile->times->hungup) {
switch_mutex_lock(channel->profile_mutex);
@@ -1576,7 +1578,7 @@
}
- switch_mutex_unlock(channel->flag_mutex);
+ switch_mutex_unlock(channel->state_mutex);
return channel->state;
}
1
0
[commit] r12190 - in freeswitch/trunk/libs/spandsp: src src/spandsp src/spandsp/private test-data/etsi/fax test-data/itu/fax tests
by FreeSWITCH SVN 20 Feb '09
by FreeSWITCH SVN 20 Feb '09
20 Feb '09
Author: mikej
Date: Fri Feb 20 12:30:05 2009
New Revision: 12190
Log:
update to snapshot spandsp-20090220
Added:
freeswitch/trunk/libs/spandsp/tests/fax_utils.c
Modified:
freeswitch/trunk/libs/spandsp/src/spandsp/private/t4.h
freeswitch/trunk/libs/spandsp/src/spandsp/t30.h
freeswitch/trunk/libs/spandsp/src/spandsp/t4.h
freeswitch/trunk/libs/spandsp/src/spandsp/version.h
freeswitch/trunk/libs/spandsp/src/t30.c
freeswitch/trunk/libs/spandsp/src/t4.c
freeswitch/trunk/libs/spandsp/test-data/etsi/fax/Makefile.am
freeswitch/trunk/libs/spandsp/test-data/etsi/fax/generate_etsi_300_242_pages.c
freeswitch/trunk/libs/spandsp/test-data/itu/fax/Makefile.am
freeswitch/trunk/libs/spandsp/tests/Makefile.am
freeswitch/trunk/libs/spandsp/tests/fax_tests.c
freeswitch/trunk/libs/spandsp/tests/t31_tests.c
freeswitch/trunk/libs/spandsp/tests/t38_gateway_tests.c
freeswitch/trunk/libs/spandsp/tests/t38_gateway_to_terminal_tests.c
freeswitch/trunk/libs/spandsp/tests/t38_terminal_tests.c
freeswitch/trunk/libs/spandsp/tests/t38_terminal_to_gateway_tests.c
freeswitch/trunk/libs/spandsp/tests/t4_tests.c
freeswitch/trunk/libs/spandsp/tests/tsb85_tests.c
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/private/t4.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/private/t4.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/private/t4.h Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t4.h,v 1.3 2009/02/16 09:57:22 steveu Exp $
+ * $Id: t4.h,v 1.4 2009/02/20 12:34:20 steveu Exp $
*/
#if !defined(_SPANDSP_PRIVATE_T4_H_)
@@ -107,7 +107,7 @@
int stop_page;
/*! \brief The number of pages transferred to date. */
- int pages_transferred;
+ int current_page;
/*! \brief The number of pages in the current image file. */
int pages_in_file;
/*! \brief Column-to-column (X) resolution in pixels per metre. */
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/t30.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/t30.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/t30.h Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t30.h,v 1.123 2009/02/04 13:18:53 steveu Exp $
+ * $Id: t30.h,v 1.124 2009/02/20 12:34:20 steveu Exp $
*/
/*! \file */
@@ -515,8 +515,10 @@
int bit_rate;
/*! \brief TRUE if error correcting mode is used. */
int error_correcting_mode;
- /*! \brief The number of pages transferred so far. */
- int pages_transferred;
+ /*! \brief The number of pages sent so far. */
+ int pages_tx;
+ /*! \brief The number of pages received so far. */
+ int pages_rx;
/*! \brief The number of pages in the file (<0 if not known). */
int pages_in_file;
/*! \brief The horizontal column-to-column resolution of the page, in pixels per metre */
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/t4.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/t4.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/t4.h Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t4.h,v 1.57 2009/02/10 13:06:47 steveu Exp $
+ * $Id: t4.h,v 1.58 2009/02/20 12:34:20 steveu Exp $
*/
/*! \file */
@@ -323,11 +323,14 @@
\return zero for success, -1 for failure. */
SPAN_DECLARE(int) t4_tx_restart_page(t4_state_t *s);
-/*! \brief Check for the existance of the next page. This information can
- be needed before it is determined that the current page is finished with.
- \param s The T.4 context.
- \return zero for next page found, -1 for failure. */
-SPAN_DECLARE(int) t4_tx_more_pages(t4_state_t *s);
+/*! \brief Check for the existance of the next page, and whether its format is like the
+ current one. This information can be needed before it is determined that the current
+ page is finished with.
+ \param s The T.4 context.
+ \return 0 for next page found with the same format as the current page.
+ 1 for next page found with different format from the current page.
+ -1 for no page found, or file failure. */
+SPAN_DECLARE(int) t4_tx_next_page_has_different_format(t4_state_t *s);
/*! \brief Complete the sending of a page.
\param s The T.4 context.
@@ -435,6 +438,11 @@
\return The number of pages, or -1 if there is an error. */
SPAN_DECLARE(int) t4_tx_get_pages_in_file(t4_state_t *s);
+/*! \brief Get the currnet page number in the file.
+ \param s The T.4 context.
+ \return The page number, or -1 if there is an error. */
+SPAN_DECLARE(int) t4_tx_get_current_page_in_file(t4_state_t *s);
+
/*! Get the current image transfer statistics.
\brief Get the current transfer statistics.
\param s The T.4 context.
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/version.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/version.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/version.h Fri Feb 20 12:30:05 2009
@@ -30,8 +30,8 @@
/* The date and time of the version are in UTC form. */
-#define SPANDSP_RELEASE_DATE 20090216
-#define SPANDSP_RELEASE_TIME 100031
+#define SPANDSP_RELEASE_DATE 20090220
+#define SPANDSP_RELEASE_TIME 124309
#endif
/*- End of file ------------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/src/t30.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/t30.c (original)
+++ freeswitch/trunk/libs/spandsp/src/t30.c Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t30.c,v 1.285 2009/02/10 13:06:46 steveu Exp $
+ * $Id: t30.c,v 1.286 2009/02/20 12:34:20 steveu Exp $
*/
/*! \file */
@@ -469,7 +469,9 @@
span_log(&s->logging, SPAN_LOG_FLOW, "Image resolution = %d/m x %d/m\n", stats.x_resolution, stats.y_resolution);
span_log(&s->logging, SPAN_LOG_FLOW, "Bad rows = %d\n", stats.bad_rows);
span_log(&s->logging, SPAN_LOG_FLOW, "Longest bad row run = %d\n", stats.longest_bad_row_run);
- if (stats.bad_rows == 0)
+ /* Don't treat a page as perfect because it has zero bad rows out of zero total rows. A zero row
+ page has got to be some kind of total page failure. */
+ if (stats.bad_rows == 0 && stats.length != 0)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Page quality is perfect\n");
quality = T30_COPY_QUALITY_PERFECT;
@@ -587,10 +589,21 @@
static uint8_t check_next_tx_step(t30_state_t *s)
{
+ int res;
int more;
- if (t4_tx_more_pages(&(s->t4)) == 0)
+ res = t4_tx_next_page_has_different_format(&(s->t4));
+ if (res == 0)
+ {
+ span_log(&s->logging, SPAN_LOG_FLOW, "More pages to come with the same format\n");
return (s->local_interrupt_pending) ? T30_PRI_MPS : T30_MPS;
+ }
+ if (res > 0)
+ {
+ span_log(&s->logging, SPAN_LOG_FLOW, "More pages to come with a different format\n");
+ s->tx_start_page = t4_tx_get_current_page_in_file(&(s->t4)) + 1;
+ return (s->local_interrupt_pending) ? T30_PRI_EOM : T30_EOM;
+ }
/* Call a user handler, if one is set, to check if another document is to be sent.
If so, we send an EOM, rather than an EOP. Then we will renegotiate, and the new
document will begin. */
@@ -5778,7 +5791,8 @@
t->error_correcting_mode = s->error_correcting_mode;
t->error_correcting_mode_retries = s->error_correcting_mode_retries;
t4_get_transfer_statistics(&s->t4, &stats);
- t->pages_transferred = stats.pages_transferred;
+ t->pages_tx = s->ecm_tx_page;
+ t->pages_rx = s->ecm_rx_page;
t->pages_in_file = stats.pages_in_file;
t->width = stats.width;
t->length = stats.length;
@@ -5833,6 +5847,7 @@
s->far_end_detected = FALSE;
s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T0);
release_resources(s);
+ /* The ECM page number is only reset at call establishment */
s->ecm_rx_page = 0;
s->ecm_tx_page = 0;
return 0;
Modified: freeswitch/trunk/libs/spandsp/src/t4.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/t4.c (original)
+++ freeswitch/trunk/libs/spandsp/src/t4.c Fri Feb 20 12:30:05 2009
@@ -24,7 +24,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t4.c,v 1.125 2009/02/16 09:57:22 steveu Exp $
+ * $Id: t4.c,v 1.126 2009/02/20 12:34:20 steveu Exp $
*/
/*
@@ -239,8 +239,8 @@
/* Set the total pages to 1. For any one page document we will get this
right. For multi-page documents we will need to come back and fill in
the right answer when we know it. */
- TIFFSetField(t->tiff_file, TIFFTAG_PAGENUMBER, s->pages_transferred++, 1);
- s->pages_in_file = s->pages_transferred;
+ TIFFSetField(t->tiff_file, TIFFTAG_PAGENUMBER, s->current_page++, 1);
+ s->pages_in_file = s->current_page;
if (t->output_compression == COMPRESSION_CCITT_T4)
{
if (s->bad_rows)
@@ -301,8 +301,6 @@
{ -1.00f, -1, -1}
};
uint16_t res_unit;
- uint16_t photo_metric;
- uint16_t fill_order;
uint32_t parm;
float x_resolution;
float y_resolution;
@@ -327,16 +325,14 @@
TIFFGetField(t->tiff_file, TIFFTAG_YRESOLUTION, &y_resolution);
res_unit = RESUNIT_INCH;
TIFFGetField(t->tiff_file, TIFFTAG_RESOLUTIONUNIT, &res_unit);
- photo_metric = PHOTOMETRIC_MINISWHITE;
- TIFFGetField(t->tiff_file, TIFFTAG_PHOTOMETRIC, &photo_metric);
- if (photo_metric != PHOTOMETRIC_MINISWHITE)
+ t->photo_metric = PHOTOMETRIC_MINISWHITE;
+ TIFFGetField(t->tiff_file, TIFFTAG_PHOTOMETRIC, &t->photo_metric);
+ if (t->photo_metric != PHOTOMETRIC_MINISWHITE)
span_log(&s->logging, SPAN_LOG_FLOW, "%s: Photometric needs swapping.\n", s->file);
- t->photo_metric = photo_metric;
- fill_order = FILLORDER_LSB2MSB;
- TIFFGetField(t->tiff_file, TIFFTAG_FILLORDER, &fill_order);
- if (fill_order != FILLORDER_LSB2MSB)
+ t->fill_order = FILLORDER_LSB2MSB;
+ TIFFGetField(t->tiff_file, TIFFTAG_FILLORDER, &t->fill_order);
+ if (t->fill_order != FILLORDER_LSB2MSB)
span_log(&s->logging, SPAN_LOG_FLOW, "%s: Fill order needs swapping.\n", s->file);
- t->fill_order = fill_order;
/* Allow a little range for the X resolution in centimeters. The spec doesn't pin down the
precise value. The other value should be exact. */
@@ -367,6 +363,92 @@
}
/*- End of function --------------------------------------------------------*/
+static int test_tiff_directory_info(t4_state_t *s)
+{
+ static const struct
+ {
+ float resolution;
+ int code;
+ } x_res_table[] =
+ {
+ { 102.0f/CM_PER_INCH, T4_X_RESOLUTION_R4},
+ { 204.0f/CM_PER_INCH, T4_X_RESOLUTION_R8},
+ { 300.0f/CM_PER_INCH, T4_X_RESOLUTION_300},
+ { 408.0f/CM_PER_INCH, T4_X_RESOLUTION_R16},
+ { 600.0f/CM_PER_INCH, T4_X_RESOLUTION_600},
+ { 800.0f/CM_PER_INCH, T4_X_RESOLUTION_800},
+ {1200.0f/CM_PER_INCH, T4_X_RESOLUTION_1200},
+ { -1.00f, -1}
+ };
+ static const struct
+ {
+ float resolution;
+ int code;
+ int max_rows_to_next_1d_row;
+ } y_res_table[] =
+ {
+ { 38.50f, T4_Y_RESOLUTION_STANDARD, 2},
+ { 77.00f, T4_Y_RESOLUTION_FINE, 4},
+ { 300.0f/CM_PER_INCH, T4_Y_RESOLUTION_300, 6},
+ { 154.00f, T4_Y_RESOLUTION_SUPERFINE, 8},
+ { 600.0f/CM_PER_INCH, T4_Y_RESOLUTION_600, 12},
+ { 800.0f/CM_PER_INCH, T4_Y_RESOLUTION_800, 16},
+ {1200.0f/CM_PER_INCH, T4_Y_RESOLUTION_1200, 24},
+ { -1.00f, -1, -1}
+ };
+ uint16_t res_unit;
+ uint32_t parm;
+ float x_resolution;
+ float y_resolution;
+ int i;
+ t4_tiff_state_t *t;
+
+ t = &s->tiff;
+ parm = 0;
+ TIFFGetField(t->tiff_file, TIFFTAG_BITSPERSAMPLE, &parm);
+ if (parm != 1)
+ return -1;
+ parm = 0;
+ TIFFGetField(t->tiff_file, TIFFTAG_IMAGEWIDTH, &parm);
+ if (s->image_width != parm)
+ {
+printf("Width changed\n");
+ return 1;
+ }
+ x_resolution = 0.0f;
+ TIFFGetField(t->tiff_file, TIFFTAG_XRESOLUTION, &x_resolution);
+ y_resolution = 0.0f;
+ TIFFGetField(t->tiff_file, TIFFTAG_YRESOLUTION, &y_resolution);
+ res_unit = RESUNIT_INCH;
+ TIFFGetField(t->tiff_file, TIFFTAG_RESOLUTIONUNIT, &res_unit);
+
+ /* Allow a little range for the X resolution in centimeters. The spec doesn't pin down the
+ precise value. The other value should be exact. */
+ /* Treat everything we can't match as R8. Most FAXes are this resolution anyway. */
+ for (i = 0; x_res_table[i].code > 0; i++)
+ {
+ if (test_resolution(res_unit, x_resolution, x_res_table[i].resolution))
+ break;
+ }
+ if (s->x_resolution != x_res_table[i].code)
+ {
+printf("X-res changed\n");
+ return 1;
+ }
+ for (i = 0; y_res_table[i].code > 0; i++)
+ {
+ if (test_resolution(res_unit, y_resolution, y_res_table[i].resolution))
+ break;
+ }
+ if (s->y_resolution != y_res_table[i].code)
+ {
+printf("Y-res changed\n");
+ return 1;
+ }
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
static int get_tiff_total_pages(t4_state_t *s)
{
int max;
@@ -378,7 +460,7 @@
while (TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) max))
max++;
/* Back to the previous page */
- if (!TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) s->pages_transferred))
+ if (!TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) s->current_page))
return -1;
return max;
}
@@ -460,15 +542,15 @@
t = &s->tiff;
/* Perform any operations needed to tidy up a written TIFF file before
closure. */
- if (s->pages_transferred > 1)
+ if (s->current_page > 1)
{
/* We need to edit the TIFF directories. Until now we did not know
the total page count, so the TIFF file currently says one. Now we
need to set the correct total page count associated with each page. */
- for (i = 0; i < s->pages_transferred; i++)
+ for (i = 0; i < s->current_page; i++)
{
TIFFSetDirectory(t->tiff_file, (tdir_t) i);
- TIFFSetField(t->tiff_file, TIFFTAG_PAGENUMBER, i, s->pages_transferred);
+ TIFFSetField(t->tiff_file, TIFFTAG_PAGENUMBER, i, s->current_page);
TIFFWriteDirectory(t->tiff_file);
}
}
@@ -478,7 +560,7 @@
{
/* Try not to leave a file behind, if we didn't receive any pages to
put in it. */
- if (s->pages_transferred == 0)
+ if (s->current_page == 0)
remove(s->file);
free((char *) s->file);
}
@@ -501,6 +583,12 @@
}
/*- End of function --------------------------------------------------------*/
+static int test_tiff_directory_info(t4_state_t *s)
+{
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
static int open_tiff_input_file(t4_state_t *s, const char *file)
{
return 0;
@@ -1326,7 +1414,7 @@
value to ensure it will be seen as changing when the real value is used. */
s->bytes_per_row = 0;
- s->pages_transferred = 0;
+ s->current_page = 0;
s->pages_in_file = 0;
s->start_page = 0;
s->stop_page = INT_MAX;
@@ -1866,9 +1954,12 @@
if (open_tiff_input_file(s, file) < 0)
return NULL;
s->file = strdup(file);
+ s->current_page =
s->start_page = (start_page >= 0) ? start_page : 0;
s->stop_page = (stop_page >= 0) ? stop_page : INT_MAX;
+ if (!TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) s->current_page))
+ return -1;
if (get_tiff_directory_info(s))
{
close_tiff_input_file(s);
@@ -1877,7 +1968,6 @@
s->rows_to_next_1d_row = s->max_rows_to_next_1d_row - 1;
- s->pages_transferred = s->start_page;
s->pages_in_file = -1;
run_space = (s->image_width + 4)*sizeof(uint32_t);
@@ -1937,7 +2027,7 @@
tm.tm_min,
s->header_info,
s->tiff.local_ident,
- s->pages_transferred + 1);
+ s->current_page + 1);
}
/*- End of function --------------------------------------------------------*/
@@ -1950,24 +2040,24 @@
int row_bufptr;
int run_space;
int len;
- int this_image_width;
+ int old_image_width;
char *t;
char header[132 + 1];
uint8_t *bufptr8;
uint32_t *bufptr;
- span_log(&s->logging, SPAN_LOG_FLOW, "Start tx page %d\n", s->pages_transferred);
- if (s->pages_transferred > s->stop_page)
+ span_log(&s->logging, SPAN_LOG_FLOW, "Start tx page %d\n", s->current_page);
+ if (s->current_page > s->stop_page)
return -1;
if (s->tiff.tiff_file == NULL)
return -1;
- this_image_width = 0;
+ old_image_width = s->image_width;
if (s->row_read_handler == NULL)
{
#if defined(HAVE_LIBTIFF)
- if (!TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) s->pages_transferred))
+ if (!TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) s->current_page))
return -1;
- TIFFGetField(s->tiff.tiff_file, TIFFTAG_IMAGEWIDTH, &this_image_width);
+ get_tiff_directory_info(s);
#endif
}
s->image_size = 0;
@@ -1977,10 +2067,9 @@
s->rows_to_next_1d_row = s->max_rows_to_next_1d_row - 1;
/* Allow for pages being of different width. */
- run_space = (this_image_width + 4)*sizeof(uint32_t);
- if (this_image_width != s->image_width)
+ run_space = (s->image_width + 4)*sizeof(uint32_t);
+ if (old_image_width != s->image_width)
{
- s->image_width = this_image_width;
s->bytes_per_row = (s->image_width + 7)/8;
if ((bufptr = (uint32_t *) realloc(s->cur_runs, run_space)) == NULL)
@@ -2073,13 +2162,13 @@
}
if (s->line_encoding == T4_COMPRESSION_ITU_T6)
{
- /* Attach an EOFB (end of facsimile block) to the end of the page */
+ /* Attach an EOFB (end of facsimile block == 2 x EOLs) to the end of the page */
for (i = 0; i < EOLS_TO_END_T6_TX_PAGE; i++)
encode_eol(s);
}
else
{
- /* Attach a return to control (RTC == 6 x EOLs) to the end of the page */
+ /* Attach an RTC (return to control == 6 x EOLs) to the end of the page */
s->row_is_2d = FALSE;
for (i = 0; i < EOLS_TO_END_T4_TX_PAGE; i++)
encode_eol(s);
@@ -2095,27 +2184,20 @@
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) t4_tx_more_pages(t4_state_t *s)
+SPAN_DECLARE(int) t4_tx_next_page_has_different_format(t4_state_t *s)
{
- span_log(&s->logging, SPAN_LOG_FLOW, "Checking for the existance of page %d\n", s->pages_transferred + 1);
- if (s->pages_transferred >= s->stop_page)
- return -1;
- if (s->tiff.tiff_file == NULL)
+ span_log(&s->logging, SPAN_LOG_FLOW, "Checking for the existance of page %d\n", s->current_page + 1);
+ if (s->current_page >= s->stop_page)
return -1;
- if (s->pages_in_file >= 0)
- {
- if (s->pages_transferred + 1 >= s->pages_in_file)
- return -1;
- }
- else
+ if (s->row_read_handler == NULL)
{
- if (s->row_read_handler == NULL)
- {
#if defined(HAVE_LIBTIFF)
- if (!TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) s->pages_transferred + 1))
- return -1;
+ if (s->tiff.tiff_file == NULL)
+ return -1;
+ if (!TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) s->current_page + 1))
+ return -1;
+ return test_tiff_directory_info(s);
#endif
- }
}
return 0;
}
@@ -2131,7 +2213,7 @@
SPAN_DECLARE(int) t4_tx_end_page(t4_state_t *s)
{
- s->pages_transferred++;
+ s->current_page++;
return 0;
}
/*- End of function --------------------------------------------------------*/
@@ -2261,9 +2343,15 @@
}
/*- End of function --------------------------------------------------------*/
+SPAN_DECLARE(int) t4_tx_get_current_page_in_file(t4_state_t *s)
+{
+ return s->current_page;
+}
+/*- End of function --------------------------------------------------------*/
+
SPAN_DECLARE(void) t4_get_transfer_statistics(t4_state_t *s, t4_stats_t *t)
{
- t->pages_transferred = s->pages_transferred - s->start_page;
+ t->pages_transferred = s->current_page - s->start_page;
t->pages_in_file = s->pages_in_file;
t->width = s->image_width;
t->length = s->image_length;
Modified: freeswitch/trunk/libs/spandsp/test-data/etsi/fax/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/spandsp/test-data/etsi/fax/Makefile.am (original)
+++ freeswitch/trunk/libs/spandsp/test-data/etsi/fax/Makefile.am Fri Feb 20 12:30:05 2009
@@ -16,30 +16,33 @@
## along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
##
-## $Id: Makefile.am,v 1.2 2008/09/10 16:55:15 steveu Exp $
+## $Id: Makefile.am,v 1.3 2009/02/20 12:34:20 steveu Exp $
AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
PBM2G3 = pbmtog3
FAX2TIFF = fax2tiff
+TIFFCP = tiffcp
+
+ETSI_TEST_PAGES = etsi_300_242_a4_diago1.tif \
+ etsi_300_242_a4_diago2.tif \
+ etsi_300_242_a4_duration1.tif \
+ etsi_300_242_a4_duration2.tif \
+ etsi_300_242_a4_error.tif \
+ etsi_300_242_a4_impress.tif \
+ etsi_300_242_a4_impress_white.tif \
+ etsi_300_242_a4_stairstep.tif \
+ etsi_300_242_a4_white.tif \
+ etsi_300_242_a4_white_2p.tif
EXTRA_DIST =
-nobase_data_DATA = etsi_300_242_a4_diago1.tif \
- etsi_300_242_a4_diago2.tif \
- etsi_300_242_a4_duration1.tif \
- etsi_300_242_a4_duration2.tif \
- etsi_300_242_a4_error.tif \
- etsi_300_242_a4_impress.tif \
- etsi_300_242_a4_impress_white.tif \
- etsi_300_242_a4_stairstep.tif \
- etsi_300_242_a4_white.tif \
- etsi_300_242_a4_white_2p.tif
+nobase_data_DATA = ${ETSI_TEST_PAGES}
-noinst_PROGRAMS = generate_etsi_300_242_pages
+noinst_PROGRAMS = generate_etsi_300_242_pages
generate_etsi_300_242_pages_SOURCES = generate_etsi_300_242_pages.c
-generate_etsi_300_242_pages_LDADD = -ltiff
+generate_etsi_300_242_pages_LDADD = -lspandsp -ltiff
clean:
rm -f *.tif *.g3
@@ -50,14 +53,5 @@
.pbm.g3:
${PBM2G3} $*.pbm >$*.g3
-etsi_300_242_a4_diago1.tif \
-etsi_300_242_a4_diago2.tif \
-etsi_300_242_a4_duration1.tif \
-etsi_300_242_a4_duration2.tif \
-etsi_300_242_a4_error.tif \
-etsi_300_242_a4_impress.tif \
-etsi_300_242_a4_impress_white.tif \
-etsi_300_242_a4_stairstep.tif \
-etsi_300_242_a4_white.tif \
-etsi_300_242_a4_white_2p.tif: generate_etsi_300_242_pages$(EXEEXT)
+${ETSI_TEST_PAGES}: generate_etsi_300_242_pages$(EXEEXT)
./generate_etsi_300_242_pages$(EXEEXT)
Modified: freeswitch/trunk/libs/spandsp/test-data/etsi/fax/generate_etsi_300_242_pages.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/test-data/etsi/fax/generate_etsi_300_242_pages.c (original)
+++ freeswitch/trunk/libs/spandsp/test-data/etsi/fax/generate_etsi_300_242_pages.c Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: generate_etsi_300_242_pages.c,v 1.2 2008/09/10 16:55:15 steveu Exp $
+ * $Id: generate_etsi_300_242_pages.c,v 1.3 2009/02/20 12:34:20 steveu Exp $
*/
/*! \file */
@@ -177,6 +177,9 @@
},
};
+int reverse_photo_metric = FALSE;
+int reverse_fill_order = FALSE;
+
static void clear_row(uint8_t buf[], int width)
{
memset(buf, 0, width/8 + 1);
@@ -245,6 +248,7 @@
uint8_t image_buffer[8192];
int row;
int start_pixel;
+ int i;
/* TSB-85 STAIRSTEP page. */
start_pixel = 0;
@@ -252,6 +256,13 @@
{
clear_row(image_buffer, 1728);
set_pixel_range(image_buffer, 1, start_pixel, start_pixel + 63);
+ if (reverse_photo_metric)
+ {
+ for (i = 0; i < 1728/8; i++)
+ image_buffer[i] = ~image_buffer[i];
+ }
+ if (reverse_fill_order)
+ bit_reverse(image_buffer, image_buffer, 1728/8);
if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0)
{
printf("Write error at row %d.\n", row);
@@ -571,9 +582,14 @@
TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1);
TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L);
TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
- TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);
- TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB);
-
+ if (reverse_photo_metric)
+ TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
+ else
+ TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);
+ if (reverse_fill_order)
+ TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
+ else
+ TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB);
x_resolution = sequence[i].x_res/100.0f;
y_resolution = sequence[i].y_res/100.0f;
TIFFSetField(tiff_file, TIFFTAG_XRESOLUTION, floorf(x_resolution*2.54f + 0.5f));
Modified: freeswitch/trunk/libs/spandsp/test-data/itu/fax/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/spandsp/test-data/itu/fax/Makefile.am (original)
+++ freeswitch/trunk/libs/spandsp/test-data/itu/fax/Makefile.am Fri Feb 20 12:30:05 2009
@@ -16,72 +16,93 @@
## License along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
##
-## $Id: Makefile.am,v 1.3 2008/05/03 13:05:04 steveu Exp $
+## $Id: Makefile.am,v 1.4 2009/02/20 12:34:20 steveu Exp $
AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
PBM2G3 = pbmtog3
FAX2TIFF = fax2tiff
+TIFFCP = tiffcp
-EXTRA_DIST = itu1.pbm \
- itu2.pbm \
- itu3.pbm \
- itu4.pbm \
- itu5.pbm \
- itu6.pbm \
- itu7.pbm \
- itu8.pbm \
- test1.pbm \
- test2.pbm \
- test3.pbm \
- test4.pbm
+ITU_TEST_PAGES_PBM = itu1.pbm \
+ itu2.pbm \
+ itu3.pbm \
+ itu4.pbm \
+ itu5.pbm \
+ itu6.pbm \
+ itu7.pbm \
+ itu8.pbm \
+ test1.pbm \
+ test2.pbm \
+ test3.pbm \
+ test4.pbm
+
+ITU_TEST_PAGES_G3 = itu1.g3 \
+ itu2.g3 \
+ itu3.g3 \
+ itu4.g3 \
+ itu5.g3 \
+ itu6.g3 \
+ itu7.g3 \
+ itu8.g3 \
+ test1.g3 \
+ test2.g3 \
+ test3.g3 \
+ test4.g3
+
+ITU_TEST_PAGES = itu1.tif \
+ itu2.tif \
+ itu3.tif \
+ itu4.tif \
+ itu5.tif \
+ itu6.tif \
+ itu7.tif \
+ itu8.tif \
+ test1.tif \
+ test2.tif \
+ test3.tif \
+ test4.tif
+
+MIXED_SIZE_PAGES = R1200_1200_A4.tif \
+ R1200_1200_B4.tif \
+ R1200_1200_A3.tif \
+ R600_1200_A4.tif \
+ R600_1200_B4.tif \
+ R600_1200_A3.tif \
+ R600_600_A4.tif \
+ R600_600_B4.tif \
+ R600_600_A3.tif \
+ R16_800_A4.tif \
+ R16_800_B4.tif \
+ R16_800_A3.tif \
+ R16_154_A4.tif \
+ R16_154_B4.tif \
+ R16_154_A3.tif \
+ R300_600_A4.tif \
+ R300_600_B4.tif \
+ R300_600_A3.tif \
+ R300_300_A4.tif \
+ R300_300_B4.tif \
+ R300_300_A3.tif \
+ R8_154_A4.tif \
+ R8_154_B4.tif \
+ R8_154_A3.tif \
+ R8_77_A4.tif \
+ R8_77_B4.tif \
+ R8_77_A3.tif \
+ R8_385_A4.tif \
+ R8_385_B4.tif \
+ R8_385_A3.tif
+
+EXTRA_DIST = ${ITU_TEST_PAGES_PBM}
nobase_data_DATA = itutests.tif \
- itu1.tif \
- itu2.tif \
- itu3.tif \
- itu4.tif \
- itu5.tif \
- itu6.tif \
- itu7.tif \
- itu8.tif \
- test1.tif \
- test2.tif \
- test3.tif \
- test4.tif \
+ ${ITU_TEST_PAGES} \
dithered.tif \
100pages.tif \
- R1200_1200_A4.tif \
- R1200_1200_B4.tif \
- R1200_1200_A3.tif \
- R600_1200_A4.tif \
- R600_1200_B4.tif \
- R600_1200_A3.tif \
- R600_600_A4.tif \
- R600_600_B4.tif \
- R600_600_A3.tif \
- R16_800_A4.tif \
- R16_800_B4.tif \
- R16_800_A3.tif \
- R16_154_A3.tif \
- R16_154_A4.tif \
- R16_154_B4.tif \
- R300_600_A4.tif \
- R300_600_B4.tif \
- R300_600_A3.tif \
- R300_300_A4.tif \
- R300_300_B4.tif \
- R300_300_A3.tif \
- R8_154_A3.tif \
- R8_154_A4.tif \
- R8_154_B4.tif \
- R8_77_A3.tif \
- R8_77_A4.tif \
- R8_77_B4.tif \
- R8_385_A3.tif \
- R8_385_A4.tif \
- R8_385_B4.tif
+ ${MIXED_SIZE_PAGES} \
+ mixed_size_pages.tif
noinst_PROGRAMS = generate_dithered_tif \
generate_sized_pages
@@ -95,22 +116,19 @@
clean:
rm -f *.tif *.g3
-itutests.tif: itu1.g3 itu2.g3 itu3.g3 itu4.g3 itu5.g3 itu6.g3 itu7.g3 itu8.g3 \
- test1.g3 test2.g3 test3.g3 test4.g3
- $(FAX2TIFF) -M -o $@ itu1.g3 itu2.g3 itu3.g3 itu4.g3 itu5.g3 itu6.g3 itu7.g3 itu8.g3 \
- test1.g3 test2.g3 test3.g3 test4.g3
+itutests.tif: ${ITU_TEST_PAGES_G3}
+ $(FAX2TIFF) -M -o $@ ${ITU_TEST_PAGES_G3}
-100pages.tif: itu1.g3 itu2.g3 itu3.g3 itu4.g3 itu5.g3 itu6.g3 itu7.g3 itu8.g3 \
- test1.g3 test2.g3 test3.g3 test4.g3
+100pages.tif: ${ITU_TEST_PAGES_G3}
$(FAX2TIFF) -M -o $@ \
- itu1.g3 itu2.g3 itu3.g3 itu4.g3 itu5.g3 itu6.g3 itu7.g3 itu8.g3 test1.g3 test2.g3 test3.g3 test4.g3 \
- itu1.g3 itu2.g3 itu3.g3 itu4.g3 itu5.g3 itu6.g3 itu7.g3 itu8.g3 test1.g3 test2.g3 test3.g3 test4.g3 \
- itu1.g3 itu2.g3 itu3.g3 itu4.g3 itu5.g3 itu6.g3 itu7.g3 itu8.g3 test1.g3 test2.g3 test3.g3 test4.g3 \
- itu1.g3 itu2.g3 itu3.g3 itu4.g3 itu5.g3 itu6.g3 itu7.g3 itu8.g3 test1.g3 test2.g3 test3.g3 test4.g3 \
- itu1.g3 itu2.g3 itu3.g3 itu4.g3 itu5.g3 itu6.g3 itu7.g3 itu8.g3 test1.g3 test2.g3 test3.g3 test4.g3 \
- itu1.g3 itu2.g3 itu3.g3 itu4.g3 itu5.g3 itu6.g3 itu7.g3 itu8.g3 test1.g3 test2.g3 test3.g3 test4.g3 \
- itu1.g3 itu2.g3 itu3.g3 itu4.g3 itu5.g3 itu6.g3 itu7.g3 itu8.g3 test1.g3 test2.g3 test3.g3 test4.g3 \
- itu1.g3 itu2.g3 itu3.g3 itu4.g3 itu5.g3 itu6.g3 itu7.g3 itu8.g3 test1.g3 test2.g3 test3.g3 test4.g3 \
+ ${ITU_TEST_PAGES_G3} \
+ ${ITU_TEST_PAGES_G3} \
+ ${ITU_TEST_PAGES_G3} \
+ ${ITU_TEST_PAGES_G3} \
+ ${ITU_TEST_PAGES_G3} \
+ ${ITU_TEST_PAGES_G3} \
+ ${ITU_TEST_PAGES_G3} \
+ ${ITU_TEST_PAGES_G3} \
itu1.g3 itu2.g3 itu3.g3 itu4.g3
.g3.tif:
@@ -122,34 +140,8 @@
dithered.tif: generate_dithered_tif$(EXEEXT)
./generate_dithered_tif$(EXEEXT)
-R1200_1200_A4.tif \
-R1200_1200_B4.tif \
-R1200_1200_A3.tif \
-R600_1200_A4.tif \
-R600_1200_B4.tif \
-R600_1200_A3.tif \
-R600_600_A4.tif \
-R600_600_B4.tif \
-R600_600_A3.tif \
-R16_800_A4.tif \
-R16_800_B4.tif \
-R16_800_A3.tif \
-R16_154_A3.tif \
-R16_154_A4.tif \
-R16_154_B4.tif \
-R300_600_A4.tif \
-R300_600_B4.tif \
-R300_600_A3.tif \
-R300_300_A4.tif \
-R300_300_B4.tif \
-R300_300_A3.tif \
-R8_154_A3.tif \
-R8_154_A4.tif \
-R8_154_B4.tif \
-R8_77_A3.tif \
-R8_77_A4.tif \
-R8_77_B4.tif \
-R8_385_A3.tif \
-R8_385_A4.tif \
-R8_385_B4.tif: generate_sized_pages$(EXEEXT)
+${MIXED_SIZE_PAGES}: generate_sized_pages$(EXEEXT)
./generate_sized_pages$(EXEEXT)
+
+mixed_size_pages.tif: ${MIXED_SIZE_PAGES}
+ $(TIFFCP) ${MIXED_SIZE_PAGES} $@
Modified: freeswitch/trunk/libs/spandsp/tests/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/Makefile.am (original)
+++ freeswitch/trunk/libs/spandsp/tests/Makefile.am Fri Feb 20 12:30:05 2009
@@ -16,7 +16,7 @@
## along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
##
-## $Id: Makefile.am,v 1.109 2009/01/30 05:35:18 steveu Exp $
+## $Id: Makefile.am,v 1.110 2009/02/20 12:34:20 steveu Exp $
AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
@@ -165,7 +165,7 @@
fax_decode_SOURCES = fax_decode.c
fax_decode_LDADD = $(LIBDIR) -lspandsp
-fax_tests_SOURCES = fax_tests.c
+fax_tests_SOURCES = fax_tests.c fax_utils.c
fax_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp
fsk_tests_SOURCES = fsk_tests.c
@@ -255,25 +255,25 @@
t4_tests_SOURCES = t4_tests.c
t4_tests_LDADD = $(LIBDIR) -lspandsp
-t31_tests_SOURCES = t31_tests.c media_monitor.cpp
+t31_tests_SOURCES = t31_tests.c fax_utils.c media_monitor.cpp
t31_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp
t38_core_tests_SOURCES = t38_core_tests.c
t38_core_tests_LDADD = $(LIBDIR) -lspandsp
-t38_gateway_tests_SOURCES = t38_gateway_tests.c media_monitor.cpp
+t38_gateway_tests_SOURCES = t38_gateway_tests.c fax_utils.c media_monitor.cpp
t38_gateway_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp
-t38_gateway_to_terminal_tests_SOURCES = t38_gateway_to_terminal_tests.c media_monitor.cpp
+t38_gateway_to_terminal_tests_SOURCES = t38_gateway_to_terminal_tests.c fax_utils.c media_monitor.cpp
t38_gateway_to_terminal_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp
t38_non_ecm_buffer_tests_SOURCES = t38_non_ecm_buffer_tests.c
t38_non_ecm_buffer_tests_LDADD = $(LIBDIR) -lspandsp
-t38_terminal_tests_SOURCES = t38_terminal_tests.c media_monitor.cpp
+t38_terminal_tests_SOURCES = t38_terminal_tests.c fax_utils.c media_monitor.cpp
t38_terminal_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp
-t38_terminal_to_gateway_tests_SOURCES = t38_terminal_to_gateway_tests.c media_monitor.cpp
+t38_terminal_to_gateway_tests_SOURCES = t38_terminal_to_gateway_tests.c fax_utils.c media_monitor.cpp
t38_terminal_to_gateway_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp
time_scale_tests_SOURCES = time_scale_tests.c
@@ -285,7 +285,7 @@
tone_generate_tests_SOURCES = tone_generate_tests.c
tone_generate_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp
-tsb85_tests_SOURCES = tsb85_tests.c fax_tester.c
+tsb85_tests_SOURCES = tsb85_tests.c fax_utils.c fax_tester.c
tsb85_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp
v17_tests_SOURCES = v17_tests.c line_model_monitor.cpp modem_monitor.cpp
Modified: freeswitch/trunk/libs/spandsp/tests/fax_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/fax_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/fax_tests.c Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: fax_tests.c,v 1.100 2009/01/03 14:44:15 steveu Exp $
+ * $Id: fax_tests.c,v 1.101 2009/02/20 12:34:20 steveu Exp $
*/
/*! \page fax_tests_page FAX tests
@@ -48,6 +48,8 @@
#include "spandsp.h"
#include "spandsp-sim.h"
+#include "fax_utils.h"
+
#define SAMPLES_PER_CHUNK 160
#define INPUT_TIFF_FILE_NAME "../test-data/itu/fax/itutests.tif"
@@ -77,22 +79,12 @@
static int phase_b_handler(t30_state_t *s, void *user_data, int result)
{
int i;
- const char *u;
-
- i = (intptr_t) user_data;
- if ((u = t30_get_rx_ident(s)))
- printf("%d: Phase B: remote ident '%s'\n", i, u);
- if ((u = t30_get_rx_sub_address(s)))
- printf("%d: Phase B: remote sub-address '%s'\n", i, u);
- if ((u = t30_get_rx_polled_sub_address(s)))
- printf("%d: Phase B: remote polled sub-address '%s'\n", i, u);
- if ((u = t30_get_rx_selective_polling_address(s)))
- printf("%d: Phase B: remote selective polling address '%s'\n", i, u);
- if ((u = t30_get_rx_sender_ident(s)))
- printf("%d: Phase B: remote sender ident '%s'\n", i, u);
- if ((u = t30_get_rx_password(s)))
- printf("%d: Phase B: remote password '%s'\n", i, u);
- printf("%d: Phase B handler on channel %d - (0x%X) %s\n", i, i, result, t30_frametype(result));
+ char tag[20];
+
+ i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase B:", i);
+ printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
+ log_rx_parameters(s, tag);
return T30_ERR_OK;
}
/*- End of function --------------------------------------------------------*/
@@ -100,31 +92,14 @@
static int phase_d_handler(t30_state_t *s, void *user_data, int result)
{
int i;
- t30_stats_t t;
- const char *u;
-
- i = (intptr_t) user_data;
- t30_get_transfer_statistics(s, &t);
+ char tag[20];
- printf("%d: Phase D handler on channel %d - (0x%X) %s\n", i, i, result, t30_frametype(result));
- printf("%d: Phase D: bit rate %d\n", i, t.bit_rate);
- printf("%d: Phase D: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%d: Phase D: pages transferred %d\n", i, t.pages_transferred);
- printf("%d: Phase D: pages in the file %d\n", i, t.pages_in_file);
- printf("%d: Phase D: image size %d x %d\n", i, t.width, t.length);
- printf("%d: Phase D: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%d: Phase D: bad rows %d\n", i, t.bad_rows);
- printf("%d: Phase D: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%d: Phase D: bad ECM frames %d\n", i, t.error_correcting_mode_retries);
- printf("%d: Phase D: compression type %d\n", i, t.encoding);
- printf("%d: Phase D: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%d: Phase D: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%d: Phase D: remote ident '%s'\n", i, u);
-#if defined(WITH_SPANDSP_INTERNALS)
- printf("%d: Phase D: bits per row - min %d, max %d\n", i, s->t4.min_row_bits, s->t4.max_row_bits);
-#endif
+ i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase D:", i);
+ printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
if (use_receiver_not_ready)
t30_set_receiver_not_ready(s, 3);
@@ -160,34 +135,17 @@
{
int i;
t30_stats_t t;
- const char *u;
-
+ char tag[20];
+
i = (intptr_t) user_data;
- printf("%d: Phase E handler on channel %d - (%d) %s\n", i, i, result, t30_completion_code_to_str(result));
+ snprintf(tag, sizeof(tag), "%c: Phase E:", i);
+ printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result));
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
t30_get_transfer_statistics(s, &t);
- printf("%d: Phase E: bit rate %d\n", i, t.bit_rate);
- printf("%d: Phase E: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%d: Phase E: pages transferred %d\n", i, t.pages_transferred);
- printf("%d: Phase E: pages in the file %d\n", i, t.pages_in_file);
- printf("%d: Phase E: image size %d x %d\n", i, t.width, t.length);
- printf("%d: Phase E: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%d: Phase E: bad rows %d\n", i, t.bad_rows);
- printf("%d: Phase E: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%d: Phase E: bad ECM frames %d\n", i, t.error_correcting_mode_retries);
- printf("%d: Phase E: coding method %s\n", i, t4_encoding_to_str(t.encoding));
- printf("%d: Phase E: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%d: Phase E: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%d: Phase E: remote ident '%s'\n", i, u);
- if ((u = t30_get_rx_country(s)))
- printf("%d: Phase E: Remote was made in '%s'\n", i, u);
- if ((u = t30_get_rx_vendor(s)))
- printf("%d: Phase E: Remote was made by '%s'\n", i, u);
- if ((u = t30_get_rx_model(s)))
- printf("%d: Phase E: Remote is model '%s'\n", i, u);
- machines[i].succeeded = (result == T30_ERR_OK) && (t.pages_transferred == 12);
- machines[i].done = TRUE;
+ machines[i - 'A'].succeeded = (result == T30_ERR_OK) && (t.pages_tx == 12 || t.pages_rx == 12);
+ machines[i - 'A'].done = TRUE;
}
/*- End of function --------------------------------------------------------*/
@@ -200,7 +158,7 @@
int i;
i = (intptr_t) user_data;
- printf("%d: Real time frame handler on channel %d - %s, %s, length = %d\n",
+ printf("%c: Real time frame handler on channel %c - %s, %s, length = %d\n",
i,
i,
(direction) ? "line->T.30" : "T.30->line",
@@ -214,7 +172,7 @@
int i;
i = (intptr_t) user_data;
- printf("%d: Document handler on channel %d - event %d\n", i, i, event);
+ printf("%c: Document handler on channel %c - event %d\n", i, i, event);
return FALSE;
}
/*- End of function --------------------------------------------------------*/
@@ -419,6 +377,7 @@
{
sprintf(buf, "fax_tests_%d.tif", (mc->chan + 1)/2);
t30_set_rx_file(t30, buf, -1);
+ t30_set_rx_encoding(t30, T4_COMPRESSION_ITU_T6);
}
}
else
@@ -427,6 +386,7 @@
{
sprintf(buf, "fax_tests_%d.tif", (mc->chan + 1)/2);
t30_set_rx_file(t30, buf, -1);
+ t30_set_rx_encoding(t30, T4_COMPRESSION_ITU_T6);
}
else
{
@@ -436,16 +396,18 @@
t30_set_tx_file(t30, input_tiff_file_name, -1, -1);
}
}
- t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) mc->chan);
- t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) mc->chan);
- t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) mc->chan);
- t30_set_real_time_frame_handler(t30, real_time_frame_handler, (void *) (intptr_t) mc->chan);
- t30_set_document_handler(t30, document_handler, (void *) (intptr_t) mc->chan);
+ t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) mc->chan + 'A');
+ t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) mc->chan + 'A');
+ t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) mc->chan + 'A');
+ t30_set_real_time_frame_handler(t30, real_time_frame_handler, (void *) (intptr_t) mc->chan + 'A');
+ t30_set_document_handler(t30, document_handler, (void *) (intptr_t) mc->chan + 'A');
sprintf(mc->tag, "FAX-%d", j + 1);
logging = t30_get_logging_state(t30);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);
span_log_set_tag(logging, mc->tag);
+ span_log_set_level(&t30->t4.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);
+ span_log_set_tag(&t30->t4.logging, mc->tag);
logging = fax_get_logging_state(mc->fax);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);
Added: freeswitch/trunk/libs/spandsp/tests/fax_utils.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/spandsp/tests/fax_utils.c Fri Feb 20 12:30:05 2009
@@ -0,0 +1,111 @@
+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * fax_utils.c
+ *
+ * Written by Steve Underwood <steveu(a)coppice.org>
+ *
+ * Copyright (C) 2009 Steve Underwood
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2, as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id: fax_utils.c,v 1.1 2009/02/20 12:34:20 steveu Exp $
+ */
+
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <assert.h>
+#include <audiofile.h>
+
+//#if defined(WITH_SPANDSP_INTERNALS)
+#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES
+//#endif
+
+#include "spandsp.h"
+#include "spandsp-sim.h"
+#include "fax_utils.h"
+
+void log_tx_parameters(t30_state_t *s, const char *tag)
+{
+ const char *u;
+
+ if ((u = t30_get_tx_ident(s)))
+ printf("%s: Local ident '%s'\n", tag, u);
+ if ((u = t30_get_tx_sub_address(s)))
+ printf("%s: Local sub-address '%s'\n", tag, u);
+ if ((u = t30_get_tx_polled_sub_address(s)))
+ printf("%s: Local polled sub-address '%s'\n", tag, u);
+ if ((u = t30_get_tx_selective_polling_address(s)))
+ printf("%s: Local selective polling address '%s'\n", tag, u);
+ if ((u = t30_get_tx_sender_ident(s)))
+ printf("%s: Local sender ident '%s'\n", tag, u);
+ if ((u = t30_get_tx_password(s)))
+ printf("%s: Local password '%s'\n", tag, u);
+}
+/*- End of function --------------------------------------------------------*/
+
+void log_rx_parameters(t30_state_t *s, const char *tag)
+{
+ const char *u;
+
+ if ((u = t30_get_rx_ident(s)))
+ printf("%s: Remote ident '%s'\n", tag, u);
+ if ((u = t30_get_rx_sub_address(s)))
+ printf("%s: Remote sub-address '%s'\n", tag, u);
+ if ((u = t30_get_rx_polled_sub_address(s)))
+ printf("%s: Remote polled sub-address '%s'\n", tag, u);
+ if ((u = t30_get_rx_selective_polling_address(s)))
+ printf("%s: Remote selective polling address '%s'\n", tag, u);
+ if ((u = t30_get_rx_sender_ident(s)))
+ printf("%s: Remote sender ident '%s'\n", tag, u);
+ if ((u = t30_get_rx_password(s)))
+ printf("%s: Remote password '%s'\n", tag, u);
+ if ((u = t30_get_rx_country(s)))
+ printf("%s: Remote was made in '%s'\n", tag, u);
+ if ((u = t30_get_rx_vendor(s)))
+ printf("%s: Remote was made by '%s'\n", tag, u);
+ if ((u = t30_get_rx_model(s)))
+ printf("%s: Remote is model '%s'\n", tag, u);
+}
+/*- End of function --------------------------------------------------------*/
+
+void log_transfer_statistics(t30_state_t *s, const char *tag)
+{
+ t30_stats_t t;
+
+ t30_get_transfer_statistics(s, &t);
+ printf("%s: bit rate %d\n", tag, t.bit_rate);
+ printf("%s: ECM %s\n", tag, (t.error_correcting_mode) ? "on" : "off");
+ printf("%s: pages tx %d, pages rx %d\n", tag, t.pages_tx, t.pages_rx);
+ printf("%s: pages in the file %d\n", tag, t.pages_in_file);
+ printf("%s: image size %d x %d\n", tag, t.width, t.length);
+ printf("%s: image resolution %d x %d\n", tag, t.x_resolution, t.y_resolution);
+ printf("%s: bad rows %d, longest bad row run %d\n", tag, t.bad_rows, t.longest_bad_row_run);
+ printf("%s: bad ECM frames %d\n", tag, t.error_correcting_mode_retries);
+ printf("%s: compression type %d\n", tag, t.encoding);
+ printf("%s: image size %d bytes\n", tag, t.image_size);
+#if defined(WITH_SPANDSP_INTERNALS)
+ printf("%s: bits per row - min %d, max %d\n", tag, s->t4.min_row_bits, s->t4.max_row_bits);
+#endif
+}
+/*- End of function --------------------------------------------------------*/
+/*- End of file ------------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/tests/t31_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/t31_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/t31_tests.c Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t31_tests.c,v 1.70 2009/02/02 13:05:28 steveu Exp $
+ * $Id: t31_tests.c,v 1.71 2009/02/20 12:38:37 steveu Exp $
*/
/*! \file */
@@ -61,14 +61,18 @@
#if defined(ENABLE_GUI)
#include "media_monitor.h"
#endif
+#include "fax_utils.h"
#define INPUT_FILE_NAME "../test-data/itu/fax/itu1.tif"
#define OUTPUT_FILE_NAME "t31.tif"
#define OUTPUT_WAVE_FILE_NAME "t31_tests.wav"
-#define DLE 0x10
-#define ETX 0x03
-#define SUB 0x1A
+enum
+{
+ ETX = 0x03,
+ DLE = 0x10,
+ SUB = 0x1A
+};
#define MANUFACTURER "www.soft-switch.org"
@@ -91,6 +95,7 @@
#define RESPONSE(b) {"", 0, b, sizeof(b) - 1}
#define FAST_RESPONSE(b) {NULL, -1, b, sizeof(b) - 1}
#define FAST_SEND(b) {(const char *) 1, -2, b, sizeof(b) - 1}
+#define FAST_SEND_TCF(b) {(const char *) 2, -2, b, sizeof(b) - 1}
static const struct command_response_s fax_send_test_seq[] =
{
@@ -121,7 +126,7 @@
EXCHANGE("AT+FTS=8\r", "\r\nOK\r\n"),
EXCHANGE("AT+FTM=96\r", "\r\nCONNECT\r\n"),
//<TCF data pattern>
- FAST_SEND("\r\nOK\r\n"),
+ FAST_SEND_TCF("\r\nOK\r\n"),
EXCHANGE("AT+FRH=3\r", "\r\nCONNECT\r\n"),
//<CFR frame data>
RESPONSE("\xFF\x13\x84\xEA\x7D\x10\x03"),
@@ -206,9 +211,12 @@
static int phase_b_handler(t30_state_t *s, void *user_data, int result)
{
int i;
-
+ char tag[20];
+
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase B:", i);
printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
+ log_rx_parameters(s, tag);
return T30_ERR_OK;
}
/*- End of function --------------------------------------------------------*/
@@ -216,28 +224,14 @@
static int phase_d_handler(t30_state_t *s, void *user_data, int result)
{
int i;
- t30_stats_t t;
- const char *u;
+ char tag[20];
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase D:", i);
printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
- t30_get_transfer_statistics(s, &t);
- printf("%c: Phase D: bit rate %d\n", i, t.bit_rate);
- printf("%c: Phase D: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%c: Phase D: pages transferred %d\n", i, t.pages_transferred);
- printf("%c: Phase D: image size %d x %d\n", i, t.width, t.length);
- printf("%c: Phase D: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%c: Phase D: bad rows %d\n", i, t.bad_rows);
- printf("%c: Phase D: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%c: Phase D: coding method %s\n", i, t4_encoding_to_str(t.encoding));
- printf("%c: Phase D: image size %d\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%c: Phase D: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%c: Phase D: remote ident '%s'\n", i, u);
-#if defined(WITH_SPANDSP_INTERNALS)
- printf("%c: Phase D: bits per row - min %d, max %d\n", i, s->t4.min_row_bits, s->t4.max_row_bits);
-#endif
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
return T30_ERR_OK;
}
/*- End of function --------------------------------------------------------*/
@@ -245,9 +239,14 @@
static void phase_e_handler(t30_state_t *s, void *user_data, int result)
{
int i;
+ char tag[20];
i = (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase E:", i);
printf("Phase E handler on channel %c\n", i);
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
//exit(0);
}
/*- End of function --------------------------------------------------------*/
@@ -404,6 +403,7 @@
{
t38_terminal_state_t *t38_state;
int fast_send;
+ int fast_send_tcf;
int fast_blocks;
uint8_t fast_buf[1000];
int msg_len;
@@ -417,6 +417,7 @@
t30_state_t *t30;
t38_core_state_t *t38_core;
logging_state_t *logging;
+ int i;
t38_version = 1;
without_pacing = FALSE;
@@ -503,6 +504,7 @@
span_log_set_tag(logging, "T.38");
fast_send = FALSE;
+ fast_send_tcf = TRUE;
fast_blocks = 0;
kick = TRUE;
#if defined(ENABLE_GUI)
@@ -535,7 +537,7 @@
if (kick)
{
kick = FALSE;
- if (fax_test_seq[test_seq_ptr].command > (const char *) 1)
+ if (fax_test_seq[test_seq_ptr].command > (const char *) 2)
{
if (fax_test_seq[test_seq_ptr].command[0])
{
@@ -545,15 +547,52 @@
}
else
{
- printf("Fast send\n");
- fast_send = TRUE;
- fast_blocks = 100;
+ if (fax_test_seq[test_seq_ptr].command == (const char *) 2)
+ {
+ printf("Fast send TCF\n");
+ fast_send = TRUE;
+ fast_send_tcf = TRUE;
+ fast_blocks = 100;
+ }
+ else
+ {
+ printf("Fast send image\n");
+ fast_send = TRUE;
+ fast_send_tcf = FALSE;
+ fast_blocks = 100;
+ }
}
}
if (fast_send)
{
/* Send fast modem data */
- memset(fast_buf, 0, 36);
+ if (fast_send_tcf)
+ {
+ memset(fast_buf, 0, 36);
+ }
+ else
+ {
+ if (fast_blocks == 1)
+ {
+ /* Create the end of page condition */
+ for (i = 0; i < 36; i += 2)
+ {
+ fast_buf[i] = 0x00;
+ fast_buf[i + 1] = 0x80;
+ }
+ }
+ else
+ {
+ /* Create a chunk of white page */
+ for (i = 0; i < 36; i += 4)
+ {
+ fast_buf[i] = 0x00;
+ fast_buf[i + 1] = 0x80;
+ fast_buf[i + 2] = 0xB2;
+ fast_buf[i + 3] = 0x01;
+ }
+ }
+ }
if (fast_blocks == 1)
{
/* Insert EOLs */
@@ -625,10 +664,12 @@
AFfilehandle wave_handle;
AFfilehandle in_handle;
int fast_send;
+ int fast_send_tcf;
int fast_blocks;
uint8_t fast_buf[1000];
t30_state_t *t30;
logging_state_t *logging;
+ int i;
wave_handle = AF_NULL_FILEHANDLE;
if (log_audio)
@@ -694,6 +735,7 @@
span_log_set_tag(logging, "FAX");
fast_send = FALSE;
+ fast_send_tcf = TRUE;
fast_blocks = 0;
kick = TRUE;
while (!done)
@@ -701,7 +743,7 @@
if (kick)
{
kick = FALSE;
- if (fax_test_seq[test_seq_ptr].command > (const char *) 1)
+ if (fax_test_seq[test_seq_ptr].command > (const char *) 2)
{
if (fax_test_seq[test_seq_ptr].command[0])
{
@@ -711,15 +753,52 @@
}
else
{
- printf("Fast send\n");
- fast_send = TRUE;
- fast_blocks = 100;
+ if (fax_test_seq[test_seq_ptr].command == (const char *) 2)
+ {
+ printf("Fast send TCF\n");
+ fast_send = TRUE;
+ fast_send_tcf = TRUE;
+ fast_blocks = 100;
+ }
+ else
+ {
+ printf("Fast send image\n");
+ fast_send = TRUE;
+ fast_send_tcf = FALSE;
+ fast_blocks = 100;
+ }
}
}
if (fast_send)
{
/* Send fast modem data */
- memset(fast_buf, 0, 36);
+ if (fast_send_tcf)
+ {
+ memset(fast_buf, 0, 36);
+ }
+ else
+ {
+ if (fast_blocks == 1)
+ {
+ /* Create the end of page condition */
+ for (i = 0; i < 36; i += 2)
+ {
+ fast_buf[i] = 0x00;
+ fast_buf[i + 1] = 0x80;
+ }
+ }
+ else
+ {
+ /* Create a chunk of white page */
+ for (i = 0; i < 36; i += 4)
+ {
+ fast_buf[i] = 0x00;
+ fast_buf[i + 1] = 0x80;
+ fast_buf[i + 2] = 0xB2;
+ fast_buf[i + 3] = 0x01;
+ }
+ }
+ }
if (fast_blocks == 1)
{
/* Insert EOLs */
@@ -780,6 +859,9 @@
if (fax_rx(fax_state, t31_amp, SAMPLES_PER_CHUNK))
break;
+ span_log_bump_samples(&fax_state->logging, SAMPLES_PER_CHUNK);
+ span_log_bump_samples(&t30->logging, SAMPLES_PER_CHUNK);
+
if (log_audio)
{
outframes = afWriteFrames(wave_handle, AF_DEFAULT_TRACK, out_amp, SAMPLES_PER_CHUNK);
Modified: freeswitch/trunk/libs/spandsp/tests/t38_gateway_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/t38_gateway_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/t38_gateway_tests.c Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t38_gateway_tests.c,v 1.79 2009/01/07 12:50:53 steveu Exp $
+ * $Id: t38_gateway_tests.c,v 1.80 2009/02/20 12:34:20 steveu Exp $
*/
/*! \file */
@@ -73,6 +73,7 @@
#if defined(ENABLE_GUI)
#include "media_monitor.h"
#endif
+#include "fax_utils.h"
#define SAMPLES_PER_CHUNK 160
@@ -102,9 +103,12 @@
static int phase_b_handler(t30_state_t *s, void *user_data, int result)
{
int i;
-
+ char tag[20];
+
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase B:", i);
printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
+ log_rx_parameters(s, tag);
return T30_ERR_OK;
}
/*- End of function --------------------------------------------------------*/
@@ -112,28 +116,14 @@
static int phase_d_handler(t30_state_t *s, void *user_data, int result)
{
int i;
- t30_stats_t t;
- const char *u;
+ char tag[20];
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase D:", i);
printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
- t30_get_transfer_statistics(s, &t);
- printf("%c: Phase D: bit rate %d\n", i, t.bit_rate);
- printf("%c: Phase D: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%c: Phase D: pages transferred %d\n", i, t.pages_transferred);
- printf("%c: Phase D: image size %d x %d\n", i, t.width, t.length);
- printf("%c: Phase D: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%c: Phase D: bad rows %d\n", i, t.bad_rows);
- printf("%c: Phase D: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%c: Phase D: coding method %s\n", i, t4_encoding_to_str(t.encoding));
- printf("%c: Phase D: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%c: Phase D: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%c: Phase D: remote ident '%s'\n", i, u);
-#if defined(WITH_SPANDSP_INTERNALS)
- printf("%c: Phase D: bits per row - min %d, max %d\n", i, s->t4.min_row_bits, s->t4.max_row_bits);
-#endif
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
return T30_ERR_OK;
}
/*- End of function --------------------------------------------------------*/
@@ -142,25 +132,16 @@
{
int i;
t30_stats_t t;
- const char *u;
+ char tag[20];
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase E:", i);
printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result));
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
t30_get_transfer_statistics(s, &t);
- printf("%c: Phase E: bit rate %d\n", i, t.bit_rate);
- printf("%c: Phase E: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%c: Phase E: pages transferred %d\n", i, t.pages_transferred);
- printf("%c: Phase E: image size %d x %d\n", i, t.width, t.length);
- printf("%c: Phase E: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%c: Phase E: bad rows %d\n", i, t.bad_rows);
- printf("%c: Phase E: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%c: Phase E: coding method %s\n", i, t4_encoding_to_str(t.encoding));
- printf("%c: Phase E: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%c: Phase E: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%c: Phase E: remote ident '%s'\n", i, u);
- succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_transferred == 12);
+ succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_tx == 12 || t.pages_rx == 12);
done[i - 'A'] = TRUE;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/tests/t38_gateway_to_terminal_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/t38_gateway_to_terminal_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/t38_gateway_to_terminal_tests.c Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t38_gateway_to_terminal_tests.c,v 1.63 2009/01/07 12:50:53 steveu Exp $
+ * $Id: t38_gateway_to_terminal_tests.c,v 1.64 2009/02/20 12:34:20 steveu Exp $
*/
/*! \file */
@@ -73,6 +73,7 @@
#if defined(ENABLE_GUI)
#include "media_monitor.h"
#endif
+#include "fax_utils.h"
#define SAMPLES_PER_CHUNK 160
@@ -97,9 +98,12 @@
static int phase_b_handler(t30_state_t *s, void *user_data, int result)
{
int i;
-
+ char tag[20];
+
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase B:", i);
printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
+ log_rx_parameters(s, tag);
return T30_ERR_OK;
}
/*- End of function --------------------------------------------------------*/
@@ -107,28 +111,14 @@
static int phase_d_handler(t30_state_t *s, void *user_data, int result)
{
int i;
- t30_stats_t t;
- const char *u;
+ char tag[20];
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase D:", i);
printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
- t30_get_transfer_statistics(s, &t);
- printf("%c: Phase D: bit rate %d\n", i, t.bit_rate);
- printf("%c: Phase D: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%c: Phase D: pages transferred %d\n", i, t.pages_transferred);
- printf("%c: Phase D: image size %d x %d\n", i, t.width, t.length);
- printf("%c: Phase D: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%c: Phase D: bad rows %d\n", i, t.bad_rows);
- printf("%c: Phase D: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%c: Phase D: coding method %s\n", i, t4_encoding_to_str(t.encoding));
- printf("%c: Phase D: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%c: Phase D: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%c: Phase D: remote ident '%s'\n", i, u);
-#if defined(WITH_SPANDSP_INTERNALS)
- printf("%c: Phase D: bits per row - min %d, max %d\n", i, s->t4.min_row_bits, s->t4.max_row_bits);
-#endif
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
return T30_ERR_OK;
}
/*- End of function --------------------------------------------------------*/
@@ -137,25 +127,16 @@
{
int i;
t30_stats_t t;
- const char *u;
+ char tag[20];
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase E:", i);
printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result));
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
t30_get_transfer_statistics(s, &t);
- printf("%c: Phase E: bit rate %d\n", i, t.bit_rate);
- printf("%c: Phase E: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%c: Phase E: pages transferred %d\n", i, t.pages_transferred);
- printf("%c: Phase E: image size %d x %d\n", i, t.width, t.length);
- printf("%c: Phase E: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%c: Phase E: bad rows %d\n", i, t.bad_rows);
- printf("%c: Phase E: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%c: Phase E: coding method %s\n", i, t4_encoding_to_str(t.encoding));
- printf("%c: Phase E: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%c: Phase E: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%c: Phase E: remote ident '%s'\n", i, u);
- succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_transferred == 12);
+ succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_tx == 12 || t.pages_rx == 12);
done[i - 'A'] = TRUE;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/tests/t38_terminal_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/t38_terminal_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/t38_terminal_tests.c Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t38_terminal_tests.c,v 1.64 2009/01/07 12:50:53 steveu Exp $
+ * $Id: t38_terminal_tests.c,v 1.65 2009/02/20 12:34:20 steveu Exp $
*/
/*! \file */
@@ -73,6 +73,7 @@
#if defined(ENABLE_GUI)
#include "media_monitor.h"
#endif
+#include "fax_utils.h"
#define SAMPLES_PER_CHUNK 160
@@ -95,9 +96,12 @@
static int phase_b_handler(t30_state_t *s, void *user_data, int result)
{
int i;
-
+ char tag[20];
+
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase B:", i);
printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
+ log_rx_parameters(s, tag);
return T30_ERR_OK;
}
/*- End of function --------------------------------------------------------*/
@@ -105,28 +109,14 @@
static int phase_d_handler(t30_state_t *s, void *user_data, int result)
{
int i;
- t30_stats_t t;
- const char *u;
+ char tag[20];
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase D:", i);
printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
- t30_get_transfer_statistics(s, &t);
- printf("%c: Phase D: bit rate %d\n", i, t.bit_rate);
- printf("%c: Phase D: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%c: Phase D: pages transferred %d\n", i, t.pages_transferred);
- printf("%c: Phase D: image size %d x %d\n", i, t.width, t.length);
- printf("%c: Phase D: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%c: Phase D: bad rows %d\n", i, t.bad_rows);
- printf("%c: Phase D: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%c: Phase D: coding method %s\n", i, t4_encoding_to_str(t.encoding));
- printf("%c: Phase D: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%c: Phase D: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%c: Phase D: remote ident '%s'\n", i, u);
-#if defined(WITH_SPANDSP_INTERNALS)
- printf("%c: Phase D: bits per row - min %d, max %d\n", i, s->t4.min_row_bits, s->t4.max_row_bits);
-#endif
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
return T30_ERR_OK;
}
/*- End of function --------------------------------------------------------*/
@@ -135,25 +125,16 @@
{
int i;
t30_stats_t t;
- const char *u;
-
+ char tag[20];
+
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase E:", i);
printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result));
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
t30_get_transfer_statistics(s, &t);
- printf("%c: Phase E: bit rate %d\n", i, t.bit_rate);
- printf("%c: Phase E: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%c: Phase E: pages transferred %d\n", i, t.pages_transferred);
- printf("%c: Phase E: image size %d x %d\n", i, t.width, t.length);
- printf("%c: Phase E: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%c: Phase E: bad rows %d\n", i, t.bad_rows);
- printf("%c: Phase E: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%c: Phase E: coding method %s\n", i, t4_encoding_to_str(t.encoding));
- printf("%c: Phase E: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%c: Phase E: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%c: Phase E: remote ident '%s'\n", i, u);
- succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_transferred == 12);
+ succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_tx == 12 || t.pages_rx == 12);
//done[i - 'A'] = TRUE;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/tests/t38_terminal_to_gateway_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/t38_terminal_to_gateway_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/t38_terminal_to_gateway_tests.c Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t38_terminal_to_gateway_tests.c,v 1.62 2009/01/07 12:50:53 steveu Exp $
+ * $Id: t38_terminal_to_gateway_tests.c,v 1.63 2009/02/20 12:34:20 steveu Exp $
*/
/*! \file */
@@ -73,6 +73,7 @@
#if defined(ENABLE_GUI)
#include "media_monitor.h"
#endif
+#include "fax_utils.h"
#define SAMPLES_PER_CHUNK 160
@@ -97,9 +98,12 @@
static int phase_b_handler(t30_state_t *s, void *user_data, int result)
{
int i;
-
+ char tag[20];
+
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase B:", i);
printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
+ log_rx_parameters(s, tag);
return T30_ERR_OK;
}
/*- End of function --------------------------------------------------------*/
@@ -107,28 +111,14 @@
static int phase_d_handler(t30_state_t *s, void *user_data, int result)
{
int i;
- t30_stats_t t;
- const char *u;
+ char tag[20];
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase D:", i);
printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
- t30_get_transfer_statistics(s, &t);
- printf("%c: Phase D: bit rate %d\n", i, t.bit_rate);
- printf("%c: Phase D: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%c: Phase D: pages transferred %d\n", i, t.pages_transferred);
- printf("%c: Phase D: image size %d x %d\n", i, t.width, t.length);
- printf("%c: Phase D: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%c: Phase D: bad rows %d\n", i, t.bad_rows);
- printf("%c: Phase D: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%c: Phase D: coding method %s\n", i, t4_encoding_to_str(t.encoding));
- printf("%c: Phase D: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%c: Phase D: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%c: Phase D: remote ident '%s'\n", i, u);
-#if defined(WITH_SPANDSP_INTERNALS)
- printf("%c: Phase D: bits per row - min %d, max %d\n", i, s->t4.min_row_bits, s->t4.max_row_bits);
-#endif
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
return T30_ERR_OK;
}
/*- End of function --------------------------------------------------------*/
@@ -137,25 +127,16 @@
{
int i;
t30_stats_t t;
- const char *u;
+ char tag[20];
i = (int) (intptr_t) user_data;
+ snprintf(tag, sizeof(tag), "%c: Phase E:", i);
printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result));
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
t30_get_transfer_statistics(s, &t);
- printf("%c: Phase E: bit rate %d\n", i, t.bit_rate);
- printf("%c: Phase E: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%c: Phase E: pages transferred %d\n", i, t.pages_transferred);
- printf("%c: Phase E: image size %d x %d\n", i, t.width, t.length);
- printf("%c: Phase E: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%c: Phase E: bad rows %d\n", i, t.bad_rows);
- printf("%c: Phase E: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%c: Phase E: coding method %s\n", i, t4_encoding_to_str(t.encoding));
- printf("%c: Phase E: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%c: Phase E: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%c: Phase E: remote ident '%s'\n", i, u);
- succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_transferred == 12);
+ succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_tx == 12 || t.pages_rx == 12);
done[i - 'A'] = TRUE;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/tests/t4_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/t4_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/t4_tests.c Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t4_tests.c,v 1.66 2009/02/10 13:06:47 steveu Exp $
+ * $Id: t4_tests.c,v 1.67 2009/02/20 12:34:20 steveu Exp $
*/
/*! \file */
@@ -292,7 +292,7 @@
printf("Failed to init T.4 rx\n");
exit(2);
}
-
+ span_log_set_level(&receive_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);
t4_rx_set_rx_encoding(&receive_state, compression);
t4_rx_set_x_resolution(&receive_state, T4_X_RESOLUTION_R8);
//t4_rx_set_y_resolution(&receive_state, T4_Y_RESOLUTION_FINE);
@@ -365,6 +365,7 @@
printf("Failed to init T.4 send\n");
exit(2);
}
+ span_log_set_level(&send_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);
t4_tx_set_min_row_bits(&send_state, min_row_bits);
t4_tx_set_local_ident(&send_state, "111 2222 3333");
@@ -374,6 +375,7 @@
printf("Failed to init T.4 rx\n");
exit(2);
}
+ span_log_set_level(&receive_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);
t4_rx_set_x_resolution(&receive_state, t4_tx_get_x_resolution(&send_state));
t4_rx_set_y_resolution(&receive_state, t4_tx_get_y_resolution(&send_state));
t4_rx_set_image_width(&receive_state, t4_tx_get_image_width(&send_state));
@@ -521,6 +523,7 @@
printf("Failed to init T.4 tx\n");
exit(2);
}
+ span_log_set_level(&send_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);
t4_tx_set_row_read_handler(&send_state, row_read_handler, NULL);
t4_tx_set_min_row_bits(&send_state, min_row_bits);
t4_tx_set_local_ident(&send_state, "111 2222 3333");
@@ -531,6 +534,7 @@
printf("Failed to init T.4 rx\n");
exit(2);
}
+ span_log_set_level(&receive_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);
t4_rx_set_row_write_handler(&receive_state, row_write_handler, NULL);
t4_rx_set_x_resolution(&receive_state, t4_tx_get_x_resolution(&send_state));
t4_rx_set_y_resolution(&receive_state, t4_tx_get_y_resolution(&send_state));
Modified: freeswitch/trunk/libs/spandsp/tests/tsb85_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/tsb85_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/tsb85_tests.c Fri Feb 20 12:30:05 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: tsb85_tests.c,v 1.29 2009/02/10 13:06:47 steveu Exp $
+ * $Id: tsb85_tests.c,v 1.30 2009/02/20 12:34:20 steveu Exp $
*/
/*! \file */
@@ -67,6 +67,7 @@
#include "spandsp-sim.h"
#include "fax_tester.h"
+#include "fax_utils.h"
#define OUTPUT_TIFF_FILE_NAME "tsb85.tif"
@@ -107,10 +108,10 @@
status = T30_ERR_OK;
if ((u = t30_get_rx_ident(s)))
{
- printf("%d: Phase B: remote ident '%s'\n", i, u);
+ printf("%c: Phase B: remote ident '%s'\n", i, u);
if (expected_rx_info.ident[0] && strcmp(expected_rx_info.ident, u))
{
- printf("%d: Phase B: remote ident incorrect! - expected '%s'\n", i, expected_rx_info.ident);
+ printf("%c: Phase B: remote ident incorrect! - expected '%s'\n", i, expected_rx_info.ident);
status = T30_ERR_IDENT_UNACCEPTABLE;
}
}
@@ -118,16 +119,16 @@
{
if (expected_rx_info.ident[0])
{
- printf("%d: Phase B: remote ident missing!\n", i);
+ printf("%c: Phase B: remote ident missing!\n", i);
status = T30_ERR_IDENT_UNACCEPTABLE;
}
}
if ((u = t30_get_rx_sub_address(s)))
{
- printf("%d: Phase B: remote sub-address '%s'\n", i, u);
+ printf("%c: Phase B: remote sub-address '%s'\n", i, u);
if (expected_rx_info.sub_address[0] && strcmp(expected_rx_info.sub_address, u))
{
- printf("%d: Phase B: remote sub-address incorrect! - expected '%s'\n", i, expected_rx_info.sub_address);
+ printf("%c: Phase B: remote sub-address incorrect! - expected '%s'\n", i, expected_rx_info.sub_address);
status = T30_ERR_SUB_UNACCEPTABLE;
}
}
@@ -135,16 +136,16 @@
{
if (expected_rx_info.sub_address[0])
{
- printf("%d: Phase B: remote sub-address missing!\n", i);
+ printf("%c: Phase B: remote sub-address missing!\n", i);
status = T30_ERR_SUB_UNACCEPTABLE;
}
}
if ((u = t30_get_rx_polled_sub_address(s)))
{
- printf("%d: Phase B: remote polled sub-address '%s'\n", i, u);
+ printf("%c: Phase B: remote polled sub-address '%s'\n", i, u);
if (expected_rx_info.polled_sub_address[0] && strcmp(expected_rx_info.polled_sub_address, u))
{
- printf("%d: Phase B: remote polled sub-address incorrect! - expected '%s'\n", i, expected_rx_info.polled_sub_address);
+ printf("%c: Phase B: remote polled sub-address incorrect! - expected '%s'\n", i, expected_rx_info.polled_sub_address);
status = T30_ERR_PSA_UNACCEPTABLE;
}
}
@@ -152,16 +153,16 @@
{
if (expected_rx_info.polled_sub_address[0])
{
- printf("%d: Phase B: remote polled sub-address missing!\n", i);
+ printf("%c: Phase B: remote polled sub-address missing!\n", i);
status = T30_ERR_PSA_UNACCEPTABLE;
}
}
if ((u = t30_get_rx_selective_polling_address(s)))
{
- printf("%d: Phase B: remote selective polling address '%s'\n", i, u);
+ printf("%c: Phase B: remote selective polling address '%s'\n", i, u);
if (expected_rx_info.selective_polling_address[0] && strcmp(expected_rx_info.selective_polling_address, u))
{
- printf("%d: Phase B: remote selective polling address incorrect! - expected '%s'\n", i, expected_rx_info.selective_polling_address);
+ printf("%c: Phase B: remote selective polling address incorrect! - expected '%s'\n", i, expected_rx_info.selective_polling_address);
status = T30_ERR_SEP_UNACCEPTABLE;
}
}
@@ -169,16 +170,16 @@
{
if (expected_rx_info.selective_polling_address[0])
{
- printf("%d: Phase B: remote selective polling address missing!\n", i);
+ printf("%c: Phase B: remote selective polling address missing!\n", i);
status = T30_ERR_SEP_UNACCEPTABLE;
}
}
if ((u = t30_get_rx_sender_ident(s)))
{
- printf("%d: Phase B: remote sender ident '%s'\n", i, u);
+ printf("%c: Phase B: remote sender ident '%s'\n", i, u);
if (expected_rx_info.sender_ident[0] && strcmp(expected_rx_info.sender_ident, u))
{
- printf("%d: Phase B: remote sender ident incorrect! - expected '%s'\n", i, expected_rx_info.sender_ident);
+ printf("%c: Phase B: remote sender ident incorrect! - expected '%s'\n", i, expected_rx_info.sender_ident);
status = T30_ERR_SID_UNACCEPTABLE;
}
}
@@ -186,16 +187,16 @@
{
if (expected_rx_info.sender_ident[0])
{
- printf("%d: Phase B: remote sender ident missing!\n", i);
+ printf("%c: Phase B: remote sender ident missing!\n", i);
status = T30_ERR_SID_UNACCEPTABLE;
}
}
if ((u = t30_get_rx_password(s)))
{
- printf("%d: Phase B: remote password '%s'\n", i, u);
+ printf("%c: Phase B: remote password '%s'\n", i, u);
if (expected_rx_info.password[0] && strcmp(expected_rx_info.password, u))
{
- printf("%d: Phase B: remote password incorrect! - expected '%s'\n", i, expected_rx_info.password);
+ printf("%c: Phase B: remote password incorrect! - expected '%s'\n", i, expected_rx_info.password);
status = T30_ERR_PWD_UNACCEPTABLE;
}
}
@@ -203,11 +204,11 @@
{
if (expected_rx_info.password[0])
{
- printf("%d: Phase B: remote password missing!\n", i);
+ printf("%c: Phase B: remote password missing!\n", i);
status = T30_ERR_PWD_UNACCEPTABLE;
}
}
- printf("%d: Phase B handler on channel %d - (0x%X) %s\n", i, i, result, t30_frametype(result));
+ printf("%c: Phase B handler on channel %d - (0x%X) %s\n", i, i, result, t30_frametype(result));
return status;
}
/*- End of function --------------------------------------------------------*/
@@ -215,37 +216,24 @@
static int phase_d_handler(t30_state_t *s, void *user_data, int result)
{
int i;
- t30_stats_t t;
- const char *u;
+ char tag[20];
i = (intptr_t) user_data;
- t30_get_transfer_statistics(s, &t);
+ snprintf(tag, sizeof(tag), "%c: Phase D:", i);
- printf("%d: Phase D handler on channel %d - (0x%X) %s\n", i, i, result, t30_frametype(result));
- printf("%d: Phase D: bit rate %d\n", i, t.bit_rate);
- printf("%d: Phase D: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%d: Phase D: pages transferred %d\n", i, t.pages_transferred);
- printf("%d: Phase D: pages in the file %d\n", i, t.pages_in_file);
- printf("%d: Phase D: image size %d x %d\n", i, t.width, t.length);
- printf("%d: Phase D: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%d: Phase D: bad rows %d\n", i, t.bad_rows);
- printf("%d: Phase D: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%d: Phase D: compression type %d\n", i, t.encoding);
- printf("%d: Phase D: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%d: Phase D: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%d: Phase D: remote ident '%s'\n", i, u);
- printf("%d: Phase D: bits per row - min %d, max %d\n", i, s->t4.min_row_bits, s->t4.max_row_bits);
+ printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result));
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
if (use_receiver_not_ready)
t30_set_receiver_not_ready(s, 3);
if (test_local_interrupt)
{
- if (i == 0)
+ if (i == 'A')
{
- printf("%d: Initiating interrupt request\n", i);
+ printf("%c: Initiating interrupt request\n", i);
t30_local_interrupt_request(s, TRUE);
}
else
@@ -256,7 +244,7 @@
case T30_PRI_MPS:
case T30_PRI_EOM:
case T30_PRI_EOP:
- printf("%d: Accepting interrupt request\n", i);
+ printf("%c: Accepting interrupt request\n", i);
t30_local_interrupt_request(s, TRUE);
break;
case T30_PIN:
@@ -271,32 +259,14 @@
static void phase_e_handler(t30_state_t *s, void *user_data, int result)
{
int i;
- t30_stats_t t;
- const char *u;
+ char tag[20];
i = (intptr_t) user_data;
- printf("%d: Phase E handler on channel %d - (%d) %s\n", i, i, result, t30_completion_code_to_str(result));
- t30_get_transfer_statistics(s, &t);
- printf("%d: Phase E: bit rate %d\n", i, t.bit_rate);
- printf("%d: Phase E: ECM %s\n", i, (t.error_correcting_mode) ? "on" : "off");
- printf("%d: Phase E: pages transferred %d\n", i, t.pages_transferred);
- printf("%d: Phase E: pages in the file %d\n", i, t.pages_in_file);
- printf("%d: Phase E: image size %d x %d\n", i, t.width, t.length);
- printf("%d: Phase E: image resolution %d x %d\n", i, t.x_resolution, t.y_resolution);
- printf("%d: Phase E: bad rows %d\n", i, t.bad_rows);
- printf("%d: Phase E: longest bad row run %d\n", i, t.longest_bad_row_run);
- printf("%d: Phase E: coding method %s\n", i, t4_encoding_to_str(t.encoding));
- printf("%d: Phase E: image size %d bytes\n", i, t.image_size);
- if ((u = t30_get_tx_ident(s)))
- printf("%d: Phase E: local ident '%s'\n", i, u);
- if ((u = t30_get_rx_ident(s)))
- printf("%d: Phase E: remote ident '%s'\n", i, u);
- if ((u = t30_get_rx_country(s)))
- printf("%d: Phase E: Remote was made in '%s'\n", i, u);
- if ((u = t30_get_rx_vendor(s)))
- printf("%d: Phase E: Remote was made by '%s'\n", i, u);
- if ((u = t30_get_rx_model(s)))
- printf("%d: Phase E: Remote is model '%s'\n", i, u);
+ snprintf(tag, sizeof(tag), "%c: Phase E:", i);
+ printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result));
+ log_transfer_statistics(s, tag);
+ log_tx_parameters(s, tag);
+ log_rx_parameters(s, tag);
}
/*- End of function --------------------------------------------------------*/
@@ -439,11 +409,11 @@
| T30_SUPPORT_600_1200_RESOLUTION);
t30_set_supported_modems(t30, T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17);
t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION);
- t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 1);
- t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 1);
- t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 1);
- t30_set_real_time_frame_handler(t30, t30_real_time_frame_handler, (void *) (intptr_t) 1);
- t30_set_document_handler(t30, document_handler, (void *) (intptr_t) 1);
+ t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'A');
+ t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'A');
+ t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'A');
+ t30_set_real_time_frame_handler(t30, t30_real_time_frame_handler, (void *) (intptr_t) 'A');
+ t30_set_document_handler(t30, document_handler, (void *) (intptr_t) 'A');
logging = fax_get_logging_state(fax);
span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);
1
0
Author: brian
Date: Fri Feb 20 12:28:23 2009
New Revision: 12189
Log:
more examples from anm
Added:
freeswitch/trunk/libs/esl/python/events.py
Added: freeswitch/trunk/libs/esl/python/events.py
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/python/events.py Fri Feb 20 12:28:23 2009
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+
+import string
+import sys
+import pickle
+
+from ESL import *
+
+con = ESLconnection("localhost","8021","ClueCon")
+#are we connected?
+
+if con.connected:
+
+ con.events("plain", "all");
+
+ while 1:
+ #my $e = $con->recvEventTimed(100);
+ e = con.recvEvent()
+
+ if e:
+ print e.serialize()
1
0
[commit] r12188 - in freeswitch/trunk/libs/spandsp/src: . spandsp spandsp/private
by FreeSWITCH SVN 20 Feb '09
by FreeSWITCH SVN 20 Feb '09
20 Feb '09
Author: mikej
Date: Fri Feb 20 12:28:09 2009
New Revision: 12188
Log:
update to snapshot spandsp-20090216
Added:
freeswitch/trunk/libs/spandsp/src/fax_modems.c
Modified:
freeswitch/trunk/libs/spandsp/src/Makefile.am
freeswitch/trunk/libs/spandsp/src/fax.c
freeswitch/trunk/libs/spandsp/src/libspandsp.dsp
freeswitch/trunk/libs/spandsp/src/libspandsp.vcproj
freeswitch/trunk/libs/spandsp/src/modem_connect_tones.c
freeswitch/trunk/libs/spandsp/src/spandsp/fax_modems.h
freeswitch/trunk/libs/spandsp/src/spandsp/private/fax_modems.h
freeswitch/trunk/libs/spandsp/src/spandsp/private/t4.h
freeswitch/trunk/libs/spandsp/src/spandsp/version.h
freeswitch/trunk/libs/spandsp/src/t31.c
freeswitch/trunk/libs/spandsp/src/t38_gateway.c
freeswitch/trunk/libs/spandsp/src/t4.c
Modified: freeswitch/trunk/libs/spandsp/src/Makefile.am
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/Makefile.am (original)
+++ freeswitch/trunk/libs/spandsp/src/Makefile.am Fri Feb 20 12:28:09 2009
@@ -16,7 +16,7 @@
## License along with this program; if not, write to the Free Software
## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
##
-## $Id: Makefile.am,v 1.123 2009/02/10 17:16:57 steveu Exp $
+## $Id: Makefile.am,v 1.124 2009/02/14 15:21:14 steveu Exp $
AM_CFLAGS = $(COMP_VENDOR_CFLAGS)
AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS)
@@ -65,6 +65,7 @@
dtmf.c \
echo.c \
fax.c \
+ fax_modems.c \
fsk.c \
g711.c \
g722.c \
Modified: freeswitch/trunk/libs/spandsp/src/fax.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/fax.c (original)
+++ freeswitch/trunk/libs/spandsp/src/fax.c Fri Feb 20 12:28:09 2009
@@ -23,7 +23,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: fax.c,v 1.86 2009/02/10 13:06:46 steveu Exp $
+ * $Id: fax.c,v 1.88 2009/02/16 09:57:22 steveu Exp $
*/
/*! \file */
@@ -223,38 +223,6 @@
}
/*- End of function --------------------------------------------------------*/
-static void fax_fax_modems_init(fax_modems_state_t *s, int use_tep, void *user_data)
-{
- s->use_tep = use_tep;
-
- hdlc_rx_init(&s->hdlc_rx, FALSE, FALSE, HDLC_FRAMING_OK_THRESHOLD, t30_hdlc_accept, user_data);
- hdlc_tx_init(&s->hdlc_tx, FALSE, 2, FALSE, hdlc_underflow_handler, user_data);
- fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) hdlc_rx_put_bit, &s->hdlc_rx);
- fsk_rx_signal_cutoff(&s->v21_rx, -45.5);
- fsk_tx_init(&s->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &s->hdlc_tx);
- v17_rx_init(&s->v17_rx, 14400, t30_non_ecm_put_bit, user_data);
- v17_tx_init(&s->v17_tx, 14400, s->use_tep, t30_non_ecm_get_bit, user_data);
- v29_rx_init(&s->v29_rx, 9600, t30_non_ecm_put_bit, user_data);
- v29_rx_signal_cutoff(&s->v29_rx, -45.5);
- v29_tx_init(&s->v29_tx, 9600, s->use_tep, t30_non_ecm_get_bit, user_data);
- v27ter_rx_init(&s->v27ter_rx, 4800, t30_non_ecm_put_bit, user_data);
- v27ter_tx_init(&s->v27ter_tx, 4800, s->use_tep, t30_non_ecm_get_bit, user_data);
- silence_gen_init(&s->silence_gen, 0);
- modem_connect_tones_tx_init(&s->connect_tx, MODEM_CONNECT_TONES_FAX_CNG);
- modem_connect_tones_rx_init(&s->connect_rx,
- MODEM_CONNECT_TONES_FAX_CNG,
- tone_detected,
- user_data);
- dc_restore_init(&s->dc_restore);
-
- s->rx_signal_present = FALSE;
- s->rx_handler = (span_rx_handler_t *) &span_dummy_rx;
- s->rx_user_data = NULL;
- s->tx_handler = (span_tx_handler_t *) &silence_gen;
- s->tx_user_data = &s->silence_gen;
-}
-/*- End of function --------------------------------------------------------*/
-
SPAN_DECLARE(int) fax_rx(fax_state_t *s, int16_t *amp, int len)
{
int i;
@@ -371,7 +339,7 @@
{
case T30_MODEM_V21:
fsk_rx_init(&t->v21_rx, &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) hdlc_rx_put_bit, put_bit_user_data);
- fsk_rx_signal_cutoff(&t->v21_rx, -45.5);
+ fsk_rx_signal_cutoff(&t->v21_rx, -45.5f);
t->rx_handler = (span_rx_handler_t *) &fsk_rx;
t->rx_user_data = &t->v21_rx;
break;
@@ -548,7 +516,14 @@
memset(s, 0, sizeof(*s));
span_log_init(&s->logging, SPAN_LOG_NONE, NULL);
span_log_set_protocol(&s->logging, "FAX");
- fax_fax_modems_init(&s->modems, FALSE, &s->t30);
+ fax_modems_init(&s->modems,
+ FALSE,
+ t30_hdlc_accept,
+ hdlc_underflow_handler,
+ t30_non_ecm_put_bit,
+ t30_non_ecm_get_bit,
+ tone_detected,
+ &s->t30);
t30_init(&s->t30,
calling_party,
fax_set_rx_type,
Added: freeswitch/trunk/libs/spandsp/src/fax_modems.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/spandsp/src/fax_modems.c Fri Feb 20 12:28:09 2009
@@ -0,0 +1,289 @@
+/*
+ * SpanDSP - a series of DSP components for telephony
+ *
+ * fax_modems.c - the analogue modem set for fax processing
+ *
+ * Written by Steve Underwood <steveu(a)coppice.org>
+ *
+ * Copyright (C) 2003, 2005, 2006, 2008 Steve Underwood
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 2.1,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id: fax_modems.c,v 1.2 2009/02/16 09:57:22 steveu Exp $
+ */
+
+/*! \file */
+
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#if defined(HAVE_TGMATH_H)
+#include <tgmath.h>
+#endif
+#if defined(HAVE_MATH_H)
+#include <math.h>
+#endif
+#include "floating_fudge.h"
+#include <assert.h>
+#include <fcntl.h>
+#include <time.h>
+#if defined(LOG_FAX_AUDIO)
+#include <unistd.h>
+#endif
+
+#include "spandsp/telephony.h"
+#include "spandsp/logging.h"
+#include "spandsp/bit_operations.h"
+#include "spandsp/dc_restore.h"
+#include "spandsp/queue.h"
+#include "spandsp/power_meter.h"
+#include "spandsp/complex.h"
+#include "spandsp/tone_detect.h"
+#include "spandsp/tone_generate.h"
+#include "spandsp/async.h"
+#include "spandsp/crc.h"
+#include "spandsp/hdlc.h"
+#include "spandsp/silence_gen.h"
+#include "spandsp/fsk.h"
+#include "spandsp/v29tx.h"
+#include "spandsp/v29rx.h"
+#include "spandsp/v27ter_tx.h"
+#include "spandsp/v27ter_rx.h"
+#include "spandsp/v17tx.h"
+#include "spandsp/v17rx.h"
+#include "spandsp/super_tone_rx.h"
+#include "spandsp/modem_connect_tones.h"
+#include "spandsp/fax_modems.h"
+
+#include "spandsp/private/logging.h"
+#include "spandsp/private/fsk.h"
+#include "spandsp/private/v17tx.h"
+#include "spandsp/private/v17rx.h"
+#include "spandsp/private/v27ter_tx.h"
+#include "spandsp/private/v27ter_rx.h"
+#include "spandsp/private/v29tx.h"
+#include "spandsp/private/v29rx.h"
+#include "spandsp/private/modem_connect_tones.h"
+#include "spandsp/private/hdlc.h"
+#include "spandsp/private/fax_modems.h"
+
+#define HDLC_FRAMING_OK_THRESHOLD 5
+
+int fax_modems_v17_v21_rx(void *user_data, const int16_t amp[], int len)
+{
+ fax_modems_state_t *s;
+
+ s = (fax_modems_state_t *) user_data;
+ v17_rx(&s->v17_rx, amp, len);
+ fsk_rx(&s->v21_rx, amp, len);
+ if (s->rx_frame_received)
+ {
+ /* We have received something, and the fast modem has not trained. We must
+ be receiving valid V.21 */
+ span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
+ s->rx_handler = (span_rx_handler_t *) &fsk_rx;
+ s->rx_user_data = &s->v21_rx;
+ }
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
+int fax_modems_v27ter_v21_rx(void *user_data, const int16_t amp[], int len)
+{
+ fax_modems_state_t *s;
+
+ s = (fax_modems_state_t *) user_data;
+ v27ter_rx(&s->v27ter_rx, amp, len);
+ fsk_rx(&s->v21_rx, amp, len);
+ if (s->rx_frame_received)
+ {
+ /* We have received something, and the fast modem has not trained. We must
+ be receiving valid V.21 */
+ span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
+ s->rx_handler = (span_rx_handler_t *) &fsk_rx;
+ s->rx_user_data = &s->v21_rx;
+ }
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
+int fax_modems_v29_v21_rx(void *user_data, const int16_t amp[], int len)
+{
+ fax_modems_state_t *s;
+
+ s = (fax_modems_state_t *) user_data;
+ v29_rx(&s->v29_rx, amp, len);
+ fsk_rx(&s->v21_rx, amp, len);
+ if (s->rx_frame_received)
+ {
+ /* We have received something, and the fast modem has not trained. We must
+ be receiving valid V.21 */
+ span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx));
+ s->rx_handler = (span_rx_handler_t *) &fsk_rx;
+ s->rx_user_data = &s->v21_rx;
+ }
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
+static void v21_rx_status_handler(void *user_data, int status)
+{
+ fax_modems_state_t *s;
+
+ s = (fax_modems_state_t *) user_data;
+}
+/*- End of function --------------------------------------------------------*/
+
+static void v17_rx_status_handler(void *user_data, int status)
+{
+ fax_modems_state_t *s;
+
+ s = (fax_modems_state_t *) user_data;
+ switch (status)
+ {
+ case SIG_STATUS_TRAINING_SUCCEEDED:
+ span_log(&s->logging, SPAN_LOG_FLOW, "Switching to V.17 (%.2fdBm0)\n", v17_rx_signal_power(&s->v17_rx));
+ s->rx_handler = (span_rx_handler_t *) &v17_rx;
+ s->rx_user_data = &s->v17_rx;
+ break;
+ }
+}
+/*- End of function --------------------------------------------------------*/
+
+static void v27ter_rx_status_handler(void *user_data, int status)
+{
+ fax_modems_state_t *s;
+
+ s = (fax_modems_state_t *) user_data;
+ switch (status)
+ {
+ case SIG_STATUS_TRAINING_SUCCEEDED:
+ span_log(&s->logging, SPAN_LOG_FLOW, "Switching to V.27ter (%.2fdBm0)\n", v27ter_rx_signal_power(&s->v27ter_rx));
+ s->rx_handler = (span_rx_handler_t *) &v27ter_rx;
+ s->rx_user_data = &s->v27ter_rx;
+ break;
+ }
+}
+/*- End of function --------------------------------------------------------*/
+
+static void v29_rx_status_handler(void *user_data, int status)
+{
+ fax_modems_state_t *s;
+
+ s = (fax_modems_state_t *) user_data;
+ switch (status)
+ {
+ case SIG_STATUS_TRAINING_SUCCEEDED:
+ span_log(&s->logging, SPAN_LOG_FLOW, "Switching to V.29 (%.2fdBm0)\n", v29_rx_signal_power(&s->v29_rx));
+ s->rx_handler = (span_rx_handler_t *) &v29_rx;
+ s->rx_user_data = &s->v29_rx;
+ break;
+ }
+}
+/*- End of function --------------------------------------------------------*/
+
+void start_fax_modems_rx_modem(fax_modems_state_t *s, int which)
+{
+ switch (which)
+ {
+ case FAX_MODEM_V17_RX:
+ v17_rx_set_modem_status_handler(&s->v17_rx, v17_rx_status_handler, s);
+ break;
+ case FAX_MODEM_V27TER_RX:
+ v27ter_rx_set_modem_status_handler(&s->v27ter_rx, v27ter_rx_status_handler, s);
+ break;
+ case FAX_MODEM_V29_RX:
+ v29_rx_set_modem_status_handler(&s->v29_rx, v29_rx_status_handler, s);
+ break;
+ }
+ fsk_rx_set_modem_status_handler(&s->v21_rx, v21_rx_status_handler, s);
+}
+/*- End of function --------------------------------------------------------*/
+
+SPAN_DECLARE(void) fax_modems_set_tep_mode(fax_modems_state_t *s, int use_tep)
+{
+ s->use_tep = use_tep;
+}
+/*- End of function --------------------------------------------------------*/
+
+SPAN_DECLARE(fax_modems_state_t *) fax_modems_init(fax_modems_state_t *s,
+ int use_tep,
+ hdlc_frame_handler_t hdlc_accept,
+ hdlc_underflow_handler_t hdlc_tx_underflow,
+ put_bit_func_t non_ecm_put_bit,
+ get_bit_func_t non_ecm_get_bit,
+ tone_report_func_t tone_callback,
+ void *user_data)
+{
+ if (s == NULL)
+ {
+ if ((s = (fax_modems_state_t *) malloc(sizeof(*s))) == NULL)
+ return NULL;
+ }
+ memset(s, 0, sizeof(*s));
+ s->use_tep = use_tep;
+
+ hdlc_rx_init(&s->hdlc_rx, FALSE, FALSE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept, user_data);
+ hdlc_tx_init(&s->hdlc_tx, FALSE, 2, FALSE, hdlc_tx_underflow, user_data);
+ fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) hdlc_rx_put_bit, &s->hdlc_rx);
+ fsk_rx_signal_cutoff(&s->v21_rx, -39.09f);
+ fsk_tx_init(&s->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &s->hdlc_tx);
+ v17_rx_init(&s->v17_rx, 14400, non_ecm_put_bit, user_data);
+ v17_tx_init(&s->v17_tx, 14400, s->use_tep, non_ecm_get_bit, user_data);
+ v29_rx_init(&s->v29_rx, 9600, non_ecm_put_bit, user_data);
+ v29_rx_signal_cutoff(&s->v29_rx, -45.5f);
+ v29_tx_init(&s->v29_tx, 9600, s->use_tep, non_ecm_get_bit, user_data);
+ v27ter_rx_init(&s->v27ter_rx, 4800, non_ecm_put_bit, user_data);
+ v27ter_tx_init(&s->v27ter_tx, 4800, s->use_tep, non_ecm_get_bit, user_data);
+ silence_gen_init(&s->silence_gen, 0);
+ modem_connect_tones_tx_init(&s->connect_tx, MODEM_CONNECT_TONES_FAX_CNG);
+ if (tone_callback)
+ {
+ modem_connect_tones_rx_init(&s->connect_rx,
+ MODEM_CONNECT_TONES_FAX_CNG,
+ tone_callback,
+ user_data);
+ }
+ dc_restore_init(&s->dc_restore);
+
+ s->rx_signal_present = FALSE;
+ s->rx_handler = (span_rx_handler_t *) &span_dummy_rx;
+ s->rx_user_data = NULL;
+ s->tx_handler = (span_tx_handler_t *) &silence_gen;
+ s->tx_user_data = &s->silence_gen;
+ return s;
+}
+/*- End of function --------------------------------------------------------*/
+
+SPAN_DECLARE(int) fax_modems_release(fax_modems_state_t *s)
+{
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+
+SPAN_DECLARE(int) fax_modems_free(fax_modems_state_t *s)
+{
+ if (s)
+ free(s);
+ return 0;
+}
+/*- End of function --------------------------------------------------------*/
+/*- End of file ------------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/src/libspandsp.dsp
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/libspandsp.dsp (original)
+++ freeswitch/trunk/libs/spandsp/src/libspandsp.dsp Fri Feb 20 12:28:09 2009
@@ -161,6 +161,10 @@
# End Source File
# Begin Source File
+SOURCE=.\fax_modems.c
+# End Source File
+# Begin Source File
+
SOURCE=.\fsk.c
# End Source File
# Begin Source File
Modified: freeswitch/trunk/libs/spandsp/src/libspandsp.vcproj
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/libspandsp.vcproj (original)
+++ freeswitch/trunk/libs/spandsp/src/libspandsp.vcproj Fri Feb 20 12:28:09 2009
@@ -105,6 +105,7 @@
<File RelativePath="dtmf.c"></File>
<File RelativePath="echo.c"></File>
<File RelativePath="fax.c"></File>
+<File RelativePath="fax_modems.c"></File>
<File RelativePath="fsk.c"></File>
<File RelativePath="g711.c"></File>
<File RelativePath="g722.c"></File>
Modified: freeswitch/trunk/libs/spandsp/src/modem_connect_tones.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/modem_connect_tones.c (original)
+++ freeswitch/trunk/libs/spandsp/src/modem_connect_tones.c Fri Feb 20 12:28:09 2009
@@ -23,7 +23,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: modem_connect_tones.c,v 1.34 2009/02/10 13:06:46 steveu Exp $
+ * $Id: modem_connect_tones.c,v 1.35 2009/02/16 09:57:22 steveu Exp $
*/
/*! \file */
@@ -522,7 +522,7 @@
{
case MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE:
fsk_rx_init(&(s->v21rx), &preset_fsk_specs[FSK_V21CH2], TRUE, v21_put_bit, s);
- fsk_rx_signal_cutoff(&(s->v21rx), -45.5);
+ fsk_rx_signal_cutoff(&(s->v21rx), -45.5f);
break;
case MODEM_CONNECT_TONES_ANS_PR:
case MODEM_CONNECT_TONES_ANSAM:
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/fax_modems.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/fax_modems.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/fax_modems.h Fri Feb 20 12:28:09 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: fax_modems.h,v 1.9 2009/02/10 13:06:47 steveu Exp $
+ * $Id: fax_modems.h,v 1.10 2009/02/14 15:21:14 steveu Exp $
*/
/*! \file */
@@ -30,6 +30,25 @@
#if !defined(_SPANDSP_FAX_MODEMS_H_)
#define _SPANDSP_FAX_MODEMS_H_
+enum
+{
+ FAX_MODEM_NONE = -1,
+ FAX_MODEM_FLUSH = 0,
+ FAX_MODEM_SILENCE_TX,
+ FAX_MODEM_SILENCE_RX,
+ FAX_MODEM_CED_TONE,
+ FAX_MODEM_CNG_TONE,
+ FAX_MODEM_NOCNG_TONE,
+ FAX_MODEM_V21_TX,
+ FAX_MODEM_V17_TX,
+ FAX_MODEM_V27TER_TX,
+ FAX_MODEM_V29_TX,
+ FAX_MODEM_V21_RX,
+ FAX_MODEM_V17_RX,
+ FAX_MODEM_V27TER_RX,
+ FAX_MODEM_V29_RX
+};
+
/*!
The set of modems needed for FAX, plus the auxilliary stuff, like tone generation.
*/
@@ -45,7 +64,16 @@
SPAN_DECLARE(int) fax_modems_v27ter_v21_rx(void *user_data, const int16_t amp[], int len);
SPAN_DECLARE(int) fax_modems_v29_v21_rx(void *user_data, const int16_t amp[], int len);
-SPAN_DECLARE(fax_modems_state_t *) fax_modems_init(fax_modems_state_t *s, void *user_data);
+SPAN_DECLARE(void) fax_modems_set_tep_mode(fax_modems_state_t *s, int use_tep);
+
+SPAN_DECLARE(fax_modems_state_t *) fax_modems_init(fax_modems_state_t *s,
+ int use_tep,
+ hdlc_frame_handler_t hdlc_accept,
+ hdlc_underflow_handler_t hdlc_tx_underflow,
+ put_bit_func_t non_ecm_put_bit,
+ get_bit_func_t non_ecm_get_bit,
+ tone_report_func_t tone_callback,
+ void *user_data);
SPAN_DECLARE(int) fax_modems_release(fax_modems_state_t *s);
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/private/fax_modems.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/private/fax_modems.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/private/fax_modems.h Fri Feb 20 12:28:09 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: fax_modems.h,v 1.1 2008/10/13 13:14:01 steveu Exp $
+ * $Id: fax_modems.h,v 1.2 2009/02/14 15:21:14 steveu Exp $
*/
/*! \file */
@@ -90,6 +90,8 @@
int rx_signal_present;
/*! \brief TRUE if a modem has trained correctly. */
int rx_trained;
+ /*! \brief TRUE if an HDLC frame has been received correctly. */
+ int rx_frame_received;
/*! The current receive signal handler */
span_rx_handler_t *rx_handler;
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/private/t4.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/private/t4.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/private/t4.h Fri Feb 20 12:28:09 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t4.h,v 1.2 2009/02/05 12:21:36 steveu Exp $
+ * $Id: t4.h,v 1.3 2009/02/16 09:57:22 steveu Exp $
*/
#if !defined(_SPANDSP_PRIVATE_T4_H_)
@@ -40,6 +40,10 @@
int output_compression;
/*! \brief The TIFF G3 FAX options. */
int output_t4_options;
+ /*! \brief The TIFF photometric setting for the current page. */
+ uint16_t photo_metric;
+ /*! \brief The TIFF fill order setting for the current page. */
+ uint16_t fill_order;
/* "Background" information about the FAX, which can be stored in the image file. */
/*! \brief The vendor of the machine which produced the file. */
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/version.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/version.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/version.h Fri Feb 20 12:28:09 2009
@@ -30,8 +30,8 @@
/* The date and time of the version are in UTC form. */
-#define SPANDSP_RELEASE_DATE 20090212
-#define SPANDSP_RELEASE_TIME 142337
+#define SPANDSP_RELEASE_DATE 20090216
+#define SPANDSP_RELEASE_TIME 100031
#endif
/*- End of file ------------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/src/t31.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/t31.c (original)
+++ freeswitch/trunk/libs/spandsp/src/t31.c Fri Feb 20 12:28:09 2009
@@ -25,7 +25,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t31.c,v 1.142 2009/02/12 14:14:58 steveu Exp $
+ * $Id: t31.c,v 1.144 2009/02/16 09:57:22 steveu Exp $
*/
/*! \file */
@@ -1504,11 +1504,11 @@
static void t31_v21_rx(t31_state_t *s)
{
- hdlc_rx_init(&(s->audio.modems.hdlc_rx), FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept_frame, s);
s->at_state.ok_is_pending = FALSE;
s->hdlc_tx.final = FALSE;
s->hdlc_tx.len = 0;
s->dled = FALSE;
+ hdlc_rx_init(&(s->audio.modems.hdlc_rx), FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept_frame, s);
fsk_rx_init(&(s->audio.modems.v21_rx), &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) hdlc_rx_put_bit, &(s->audio.modems.hdlc_rx));
fsk_rx_signal_cutoff(&(s->audio.modems.v21_rx), -39.09f);
s->at_state.transmit = TRUE;
@@ -2292,39 +2292,6 @@
}
/*- End of function --------------------------------------------------------*/
-static fax_modems_state_t *t31_fax_modems_init(fax_modems_state_t *s, int use_tep, void *user_data)
-{
- s->use_tep = use_tep;
-
- hdlc_rx_init(&s->hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept_frame, user_data);
- hdlc_tx_init(&s->hdlc_tx, FALSE, 2, FALSE, hdlc_tx_underflow, user_data);
- fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) hdlc_rx_put_bit, &s->hdlc_rx);
- fsk_rx_signal_cutoff(&s->v21_rx, -39.09f);
- fsk_tx_init(&s->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &s->hdlc_tx);
- v17_rx_init(&s->v17_rx, 14400, non_ecm_put_bit, user_data);
- v17_tx_init(&s->v17_tx, 14400, s->use_tep, non_ecm_get_bit, user_data);
- v29_rx_init(&s->v29_rx, 9600, non_ecm_put_bit, user_data);
- v29_rx_signal_cutoff(&s->v29_rx, -45.5);
- v29_tx_init(&s->v29_tx, 9600, s->use_tep, non_ecm_get_bit, user_data);
- v27ter_rx_init(&s->v27ter_rx, 4800, non_ecm_put_bit, user_data);
- v27ter_tx_init(&s->v27ter_tx, 4800, s->use_tep, non_ecm_get_bit, user_data);
- silence_gen_init(&s->silence_gen, 0);
- modem_connect_tones_tx_init(&s->connect_tx, MODEM_CONNECT_TONES_FAX_CNG);
- modem_connect_tones_rx_init(&s->connect_rx,
- MODEM_CONNECT_TONES_FAX_CNG,
- tone_detected,
- user_data);
- dc_restore_init(&s->dc_restore);
-
- s->rx_signal_present = FALSE;
- s->rx_handler = (span_rx_handler_t *) &span_dummy_rx;
- s->rx_user_data = NULL;
- s->tx_handler = (span_tx_handler_t *) &silence_gen;
- s->tx_user_data = &s->silence_gen;
- return s;
-}
-/*- End of function --------------------------------------------------------*/
-
SPAN_DECLARE(int) t31_rx(t31_state_t *s, int16_t amp[], int len)
{
int i;
@@ -2537,7 +2504,14 @@
s->modem_control_handler = modem_control_handler;
s->modem_control_user_data = modem_control_user_data;
- t31_fax_modems_init(&s->audio.modems, FALSE, s);
+ fax_modems_init(&s->audio.modems,
+ FALSE,
+ hdlc_accept_frame,
+ hdlc_tx_underflow,
+ non_ecm_put_bit,
+ non_ecm_get_bit,
+ tone_detected,
+ (void *) s);
power_meter_init(&(s->audio.rx_power), 4);
s->audio.last_sample = 0;
s->audio.silence_threshold_power = power_meter_level_dbm0(-36);
Modified: freeswitch/trunk/libs/spandsp/src/t38_gateway.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/t38_gateway.c (original)
+++ freeswitch/trunk/libs/spandsp/src/t38_gateway.c Fri Feb 20 12:28:09 2009
@@ -23,7 +23,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t38_gateway.c,v 1.155 2009/02/12 12:38:39 steveu Exp $
+ * $Id: t38_gateway.c,v 1.157 2009/02/16 09:57:22 steveu Exp $
*/
/*! \file */
@@ -277,42 +277,6 @@
}
/*- End of function --------------------------------------------------------*/
-static void t38_fax_modems_init(fax_modems_state_t *s, int use_tep, void *user_data)
-{
- s->use_tep = use_tep;
-
- hdlc_rx_init(&s->hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, NULL, user_data);
- hdlc_tx_init(&s->hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, user_data);
- fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) t38_hdlc_rx_put_bit, &s->hdlc_rx);
-#if 0
- fsk_rx_signal_cutoff(&s->v21_rx, -45.5);
-#endif
- fsk_tx_init(&s->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &s->hdlc_tx);
- v17_rx_init(&s->v17_rx, 14400, non_ecm_put_bit, user_data);
- v17_tx_init(&s->v17_tx, 14400, s->use_tep, t38_non_ecm_buffer_get_bit, user_data);
- v29_rx_init(&s->v29_rx, 9600, non_ecm_put_bit, user_data);
-#if 0
- v29_rx_signal_cutoff(&s->v29_rx, -45.5);
-#endif
- v29_tx_init(&s->v29_tx, 9600, s->use_tep, t38_non_ecm_buffer_get_bit, user_data);
- v27ter_rx_init(&s->v27ter_rx, 4800, non_ecm_put_bit, user_data);
- v27ter_tx_init(&s->v27ter_tx, 4800, s->use_tep, t38_non_ecm_buffer_get_bit, user_data);
- silence_gen_init(&s->silence_gen, 0);
- modem_connect_tones_tx_init(&s->connect_tx, MODEM_CONNECT_TONES_FAX_CNG);
- modem_connect_tones_rx_init(&s->connect_rx,
- MODEM_CONNECT_TONES_FAX_CNG,
- tone_detected,
- user_data);
- dc_restore_init(&s->dc_restore);
-
- s->rx_signal_present = FALSE;
- s->rx_handler = (span_rx_handler_t *) &span_dummy_rx;
- s->rx_user_data = NULL;
- s->tx_handler = (span_tx_handler_t *) &silence_gen;
- s->tx_user_data = &s->silence_gen;
-}
-/*- End of function --------------------------------------------------------*/
-
static void tone_detected(void *user_data, int on, int level, int delay)
{
t38_gateway_state_t *s;
@@ -1971,7 +1935,7 @@
s->t38x.current_tx_data_type = T38_DATA_V21;
fsk_rx_init(&(s->audio.modems.v21_rx), &preset_fsk_specs[FSK_V21CH2], TRUE, (put_bit_func_t) t38_hdlc_rx_put_bit, &(s->audio.modems.hdlc_rx));
#if 0
- fsk_rx_signal_cutoff(&(s->audio.modems.v21_rx), -45.5);
+ fsk_rx_signal_cutoff(&(s->audio.modems.v21_rx), -45.5f);
#endif
if (s->core.image_data_mode && s->core.ecm_mode)
{
@@ -2187,7 +2151,22 @@
static int t38_gateway_audio_init(t38_gateway_state_t *s)
{
- t38_fax_modems_init(&s->audio.modems, FALSE, s);
+ fax_modems_init(&s->audio.modems,
+ FALSE,
+ NULL,
+ hdlc_underflow_handler,
+ non_ecm_put_bit,
+ t38_non_ecm_buffer_get_bit,
+ tone_detected,
+ s);
+ /* We need to use progressive HDLC transmit, and a special HDLC receiver, which is different
+ from the other uses of FAX modems. */
+ hdlc_tx_init(&s->audio.modems.hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s);
+ fsk_rx_set_put_bit(&s->audio.modems.v21_rx, (put_bit_func_t) t38_hdlc_rx_put_bit, &s->audio.modems.hdlc_rx);
+ /* TODO: Don't use the very low cutoff levels we would like to. We get some quirks if we do.
+ We need to sort this out. */
+ fsk_rx_signal_cutoff(&s->audio.modems.v21_rx, -30.0f);
+ v29_rx_signal_cutoff(&s->audio.modems.v29_rx, -28.5f);
return 0;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/src/t4.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/t4.c (original)
+++ freeswitch/trunk/libs/spandsp/src/t4.c Fri Feb 20 12:28:09 2009
@@ -24,7 +24,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t4.c,v 1.124 2009/02/10 13:06:46 steveu Exp $
+ * $Id: t4.c,v 1.125 2009/02/16 09:57:22 steveu Exp $
*/
/*
@@ -301,6 +301,8 @@
{ -1.00f, -1, -1}
};
uint16_t res_unit;
+ uint16_t photo_metric;
+ uint16_t fill_order;
uint32_t parm;
float x_resolution;
float y_resolution;
@@ -325,6 +327,16 @@
TIFFGetField(t->tiff_file, TIFFTAG_YRESOLUTION, &y_resolution);
res_unit = RESUNIT_INCH;
TIFFGetField(t->tiff_file, TIFFTAG_RESOLUTIONUNIT, &res_unit);
+ photo_metric = PHOTOMETRIC_MINISWHITE;
+ TIFFGetField(t->tiff_file, TIFFTAG_PHOTOMETRIC, &photo_metric);
+ if (photo_metric != PHOTOMETRIC_MINISWHITE)
+ span_log(&s->logging, SPAN_LOG_FLOW, "%s: Photometric needs swapping.\n", s->file);
+ t->photo_metric = photo_metric;
+ fill_order = FILLORDER_LSB2MSB;
+ TIFFGetField(t->tiff_file, TIFFTAG_FILLORDER, &fill_order);
+ if (fill_order != FILLORDER_LSB2MSB)
+ span_log(&s->logging, SPAN_LOG_FLOW, "%s: Fill order needs swapping.\n", s->file);
+ t->fill_order = fill_order;
/* Allow a little range for the X resolution in centimeters. The spec doesn't pin down the
precise value. The other value should be exact. */
@@ -384,6 +396,7 @@
{
int row;
int image_length;
+ int i;
image_length = 0;
TIFFGetField(s->tiff.tiff_file, TIFFTAG_IMAGELENGTH, &image_length);
@@ -394,6 +407,13 @@
span_log(&s->logging, SPAN_LOG_WARNING, "%s: Read error at row %d.\n", s->file, row);
break;
}
+ if (s->tiff.photo_metric != PHOTOMETRIC_MINISWHITE)
+ {
+ for (i = 0; i < s->bytes_per_row; i++)
+ s->row_buf[i] = ~s->row_buf[i];
+ }
+ if (s->tiff.fill_order != FILLORDER_LSB2MSB)
+ bit_reverse(s->row_buf, s->row_buf, s->bytes_per_row);
if (encode_row(s))
return -1;
}
1
0
[commit] r12187 - in freeswitch/trunk/libs/spandsp: spandsp-sim src src/msvc src/spandsp src/spandsp/private tests
by FreeSWITCH SVN 20 Feb '09
by FreeSWITCH SVN 20 Feb '09
20 Feb '09
Author: mikej
Date: Fri Feb 20 12:25:22 2009
New Revision: 12187
Log:
update to snapshot spandsp-20090212
Modified:
freeswitch/trunk/libs/spandsp/spandsp-sim/make_line_models.c
freeswitch/trunk/libs/spandsp/src/hdlc.c
freeswitch/trunk/libs/spandsp/src/logging.c
freeswitch/trunk/libs/spandsp/src/msvc/spandsp.h
freeswitch/trunk/libs/spandsp/src/spandsp.h.in
freeswitch/trunk/libs/spandsp/src/spandsp/async.h
freeswitch/trunk/libs/spandsp/src/spandsp/hdlc.h
freeswitch/trunk/libs/spandsp/src/spandsp/logging.h
freeswitch/trunk/libs/spandsp/src/spandsp/private/hdlc.h
freeswitch/trunk/libs/spandsp/src/spandsp/private/t31.h
freeswitch/trunk/libs/spandsp/src/spandsp/version.h
freeswitch/trunk/libs/spandsp/src/super_tone_tx.c
freeswitch/trunk/libs/spandsp/src/t31.c
freeswitch/trunk/libs/spandsp/src/t38_gateway.c
freeswitch/trunk/libs/spandsp/tests/fax_tester.c
freeswitch/trunk/libs/spandsp/tests/fsk_tests.c
freeswitch/trunk/libs/spandsp/tests/logging_tests.c
freeswitch/trunk/libs/spandsp/tests/make_g168_css.c
freeswitch/trunk/libs/spandsp/tests/super_tone_tx_tests.c
freeswitch/trunk/libs/spandsp/tests/v17_tests.c
freeswitch/trunk/libs/spandsp/tests/v27ter_tests.c
freeswitch/trunk/libs/spandsp/tests/v29_tests.c
Modified: freeswitch/trunk/libs/spandsp/spandsp-sim/make_line_models.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/spandsp-sim/make_line_models.c (original)
+++ freeswitch/trunk/libs/spandsp/spandsp-sim/make_line_models.c Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: make_line_models.c,v 1.8 2009/02/03 16:28:39 steveu Exp $
+ * $Id: make_line_models.c,v 1.9 2009/02/10 17:49:20 steveu Exp $
*/
/*! \page make_line_models_page Telephony line model construction
@@ -37,22 +37,23 @@
#include "config.h"
#endif
+#include <stdlib.h>
+#include <unistd.h>
#include <inttypes.h>
#include <string.h>
#include <stdio.h>
-#include <stdlib.h>
-#if defined(HAVE_TGMATH_H)
-#include <tgmath.h>
-#endif
-#if defined(HAVE_MATH_H)
-#include <math.h>
-#endif
#include "floating_fudge.h"
#if defined(HAVE_FFTW3_H)
#include <fftw3.h>
#else
#include <fftw.h>
#endif
+#if defined(HAVE_TGMATH_H)
+#include <tgmath.h>
+#endif
+#if defined(HAVE_MATH_H)
+#include <math.h>
+#endif
#include "spandsp.h"
Modified: freeswitch/trunk/libs/spandsp/src/hdlc.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/hdlc.c (original)
+++ freeswitch/trunk/libs/spandsp/src/hdlc.c Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: hdlc.c,v 1.70 2009/02/10 13:06:46 steveu Exp $
+ * $Id: hdlc.c,v 1.71 2009/02/12 12:38:39 steveu Exp $
*/
/*! \file */
@@ -43,10 +43,19 @@
#include "spandsp/hdlc.h"
#include "spandsp/private/hdlc.h"
-static void rx_special_condition(hdlc_rx_state_t *s, int condition)
+static void report_status_change(hdlc_rx_state_t *s, int status)
+{
+ if (s->status_handler)
+ s->status_handler(s->status_user_data, status);
+ else if (s->frame_handler)
+ s->frame_handler(s->frame_user_data, NULL, status, TRUE);
+}
+/*- End of function --------------------------------------------------------*/
+
+static void rx_special_condition(hdlc_rx_state_t *s, int status)
{
/* Special conditions */
- switch (condition)
+ switch (status)
{
case SIG_STATUS_CARRIER_UP:
case SIG_STATUS_TRAINING_SUCCEEDED:
@@ -61,7 +70,7 @@
case SIG_STATUS_TRAINING_FAILED:
case SIG_STATUS_CARRIER_DOWN:
case SIG_STATUS_END_OF_DATA:
- s->frame_handler(s->user_data, NULL, condition, TRUE);
+ report_status_change(s, status);
break;
default:
//printf("Eh!\n");
@@ -82,7 +91,7 @@
if (--s->octet_count <= 0)
{
s->octet_count = s->octet_count_report_interval;
- s->frame_handler(s->user_data, NULL, SIG_STATUS_OCTET_REPORT, TRUE);
+ report_status_change(s, SIG_STATUS_OCTET_REPORT);
}
}
else
@@ -105,7 +114,7 @@
if (--s->octet_count <= 0)
{
s->octet_count = s->octet_count_report_interval;
- s->frame_handler(s->user_data, NULL, SIG_STATUS_OCTET_REPORT, TRUE);
+ report_status_change(s, SIG_STATUS_OCTET_REPORT);
}
}
}
@@ -117,7 +126,7 @@
{
/* Hit HDLC abort */
s->rx_aborts++;
- s->frame_handler(s->user_data, NULL, SIG_STATUS_ABORT, TRUE);
+ report_status_change(s, SIG_STATUS_ABORT);
/* If we have not yet seen enough flags, restart the count. If we
are beyond that point, just back off one step, so we need to see
another flag before proceeding to collect frame octets. */
@@ -147,7 +156,7 @@
s->rx_frames++;
s->rx_bytes += s->len - s->crc_bytes;
s->len -= s->crc_bytes;
- s->frame_handler(s->user_data, s->buffer, s->len, TRUE);
+ s->frame_handler(s->frame_user_data, s->buffer, s->len, TRUE);
}
else
{
@@ -155,7 +164,7 @@
if (s->report_bad_frames)
{
s->len -= s->crc_bytes;
- s->frame_handler(s->user_data, s->buffer, s->len, FALSE);
+ s->frame_handler(s->frame_user_data, s->buffer, s->len, FALSE);
}
}
}
@@ -170,7 +179,7 @@
s->len -= s->crc_bytes;
else
s->len = 0;
- s->frame_handler(s->user_data, s->buffer, s->len, FALSE);
+ s->frame_handler(s->frame_user_data, s->buffer, s->len, FALSE);
}
s->rx_length_errors++;
}
@@ -194,7 +203,7 @@
}
if (++s->flags_seen >= s->framing_ok_threshold && !s->framing_ok_announced)
{
- s->frame_handler(s->user_data, NULL, SIG_STATUS_FRAMING_OK, TRUE);
+ report_status_change(s, SIG_STATUS_FRAMING_OK);
s->framing_ok_announced = TRUE;
}
}
@@ -309,7 +318,7 @@
}
memset(s, 0, sizeof(*s));
s->frame_handler = handler;
- s->user_data = user_data;
+ s->frame_user_data = user_data;
s->crc_bytes = (crc32) ? 4 : 2;
s->report_bad_frames = report_bad_frames;
s->framing_ok_threshold = (framing_ok_threshold < 1) ? 1 : framing_ok_threshold;
@@ -318,6 +327,20 @@
}
/*- End of function --------------------------------------------------------*/
+SPAN_DECLARE(void) hdlc_rx_set_frame_handler(hdlc_rx_state_t *s, hdlc_frame_handler_t handler, void *user_data)
+{
+ s->frame_handler = handler;
+ s->frame_user_data = user_data;
+}
+/*- End of function --------------------------------------------------------*/
+
+SPAN_DECLARE(void) hdlc_rx_set_status_handler(hdlc_rx_state_t *s, modem_rx_status_func_t handler, void *user_data)
+{
+ s->status_handler = handler;
+ s->status_user_data = user_data;
+}
+/*- End of function --------------------------------------------------------*/
+
SPAN_DECLARE(int) hdlc_rx_release(hdlc_rx_state_t *s)
{
return 0;
Modified: freeswitch/trunk/libs/spandsp/src/logging.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/logging.c (original)
+++ freeswitch/trunk/libs/spandsp/src/logging.c Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: logging.c,v 1.31 2009/02/10 13:06:46 steveu Exp $
+ * $Id: logging.c,v 1.32 2009/02/10 17:44:18 steveu Exp $
*/
/*! \file */
@@ -241,7 +241,7 @@
}
/*- End of function --------------------------------------------------------*/
-SPAN_DECLARE(int) span_log_init(logging_state_t *s, int level, const char *tag)
+SPAN_DECLARE(logging_state_t *) span_log_init(logging_state_t *s, int level, const char *tag)
{
if (s == NULL)
{
@@ -256,7 +256,7 @@
s->samples_per_second = SAMPLE_RATE;
s->elapsed_samples = 0;
- return 0;
+ return s;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/src/msvc/spandsp.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/msvc/spandsp.h (original)
+++ freeswitch/trunk/libs/spandsp/src/msvc/spandsp.h Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: spandsp.h.in,v 1.16 2009/02/03 16:28:40 steveu Exp $
+ * $Id: spandsp.h.in,v 1.17 2009/02/12 12:38:39 steveu Exp $
*/
/*! \file */
@@ -69,8 +69,8 @@
#include <spandsp/echo.h>
#include <spandsp/modem_echo.h>
#include <spandsp/crc.h>
-#include <spandsp/hdlc.h>
#include <spandsp/async.h>
+#include <spandsp/hdlc.h>
#include <spandsp/noise.h>
#include <spandsp/saturated.h>
#include <spandsp/time_scale.h>
Modified: freeswitch/trunk/libs/spandsp/src/spandsp.h.in
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp.h.in (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp.h.in Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: spandsp.h.in,v 1.16 2009/02/03 16:28:40 steveu Exp $
+ * $Id: spandsp.h.in,v 1.17 2009/02/12 12:38:39 steveu Exp $
*/
/*! \file */
@@ -69,8 +69,8 @@
#include <spandsp/echo.h>
#include <spandsp/modem_echo.h>
#include <spandsp/crc.h>
-#include <spandsp/hdlc.h>
#include <spandsp/async.h>
+#include <spandsp/hdlc.h>
#include <spandsp/noise.h>
#include <spandsp/saturated.h>
#include <spandsp/time_scale.h>
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/async.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/async.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/async.h Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: async.h,v 1.23 2009/02/10 13:06:47 steveu Exp $
+ * $Id: async.h,v 1.24 2009/02/12 12:38:39 steveu Exp $
*/
/*! \file */
@@ -100,10 +100,10 @@
typedef int (*get_bit_func_t)(void *user_data);
/*! Completion callback function for tx data pumps */
-typedef int (*modem_tx_status_func_t)(void *user_data, int status);
+typedef void (*modem_tx_status_func_t)(void *user_data, int status);
/*! Completion callback function for rx data pumps */
-typedef int (*modem_rx_status_func_t)(void *user_data, int status);
+typedef void (*modem_rx_status_func_t)(void *user_data, int status);
enum
{
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/hdlc.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/hdlc.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/hdlc.h Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: hdlc.h,v 1.43 2009/02/10 13:06:47 steveu Exp $
+ * $Id: hdlc.h,v 1.44 2009/02/12 12:38:39 steveu Exp $
*/
/*! \file */
@@ -101,8 +101,32 @@
hdlc_frame_handler_t handler,
void *user_data);
+/*! Change the put_bit function associated with an HDLC receiver context.
+ \brief Change the put_bit function associated with an HDLC receiver context.
+ \param s A pointer to an HDLC receiver context.
+ \param handler The function to be called when a good HDLC frame is received.
+ \param user_data An opaque parameter for the callback routine.
+*/
+SPAN_DECLARE(void) hdlc_rx_set_frame_handler(hdlc_rx_state_t *s, hdlc_frame_handler_t handler, void *user_data);
+
+/*! Change the status report function associated with an HDLC receiver context.
+ \brief Change the status report function associated with an HDLC receiver context.
+ \param s A pointer to an HDLC receiver context.
+ \param handler The callback routine used to report status changes.
+ \param user_data An opaque parameter for the callback routine.
+*/
+SPAN_DECLARE(void) hdlc_rx_set_status_handler(hdlc_rx_state_t *s, modem_rx_status_func_t handler, void *user_data);
+
+/*! Release an HDLC receiver context.
+ \brief Release an HDLC receiver context.
+ \param s A pointer to an HDLC receiver context.
+ \return 0 for OK */
SPAN_DECLARE(int) hdlc_rx_release(hdlc_rx_state_t *s);
+/*! Free an HDLC receiver context.
+ \brief Free an HDLC receiver context.
+ \param s A pointer to an HDLC receiver context.
+ \return 0 for OK */
SPAN_DECLARE(int) hdlc_rx_free(hdlc_rx_state_t *s);
/*! \brief Set the maximum frame length for an HDLC receiver context.
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/logging.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/logging.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/logging.h Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: logging.h,v 1.19 2009/02/10 13:06:47 steveu Exp $
+ * $Id: logging.h,v 1.20 2009/02/10 17:44:18 steveu Exp $
*/
/*! \file */
@@ -127,7 +127,7 @@
SPAN_DECLARE(void) span_set_error_handler(error_handler_func_t func);
-SPAN_DECLARE(int) span_log_init(logging_state_t *s, int level, const char *tag);
+SPAN_DECLARE(logging_state_t *) span_log_init(logging_state_t *s, int level, const char *tag);
SPAN_DECLARE(int) span_log_release(logging_state_t *s);
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/private/hdlc.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/private/hdlc.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/private/hdlc.h Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: hdlc.h,v 1.2 2009/01/31 08:48:11 steveu Exp $
+ * $Id: hdlc.h,v 1.3 2009/02/12 12:38:39 steveu Exp $
*/
#if !defined(_SPANDSP_PRIVATE_HDLC_H_)
@@ -39,8 +39,12 @@
size_t max_frame_len;
/*! \brief The callback routine called to process each good received frame. */
hdlc_frame_handler_t frame_handler;
- /*! \brief An opaque parameter passed to the callback routine. */
- void *user_data;
+ /*! \brief An opaque parameter passed to the frame callback routine. */
+ void *frame_user_data;
+ /*! \brief The callback routine called to report status changes. */
+ modem_rx_status_func_t status_handler;
+ /*! \brief An opaque parameter passed to the status callback routine. */
+ void *status_user_data;
/*! \brief TRUE if bad frames are to be reported. */
int report_bad_frames;
/*! \brief The number of consecutive flags which must be seen before framing is
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/private/t31.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/private/t31.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/private/t31.h Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t31.h,v 1.6 2009/01/16 15:13:16 steveu Exp $
+ * $Id: t31.h,v 1.7 2009/02/12 12:38:39 steveu Exp $
*/
#if !defined(_SPANDSP_PRIVATE_T31_H_)
@@ -103,6 +103,10 @@
int extra_bits;
} hdlc_tx;
+ /*! \brief TRUE if we are using ECM mode. This is used to select HDLC faking, necessary
+ with clunky class 1 modems. */
+ int ecm_mode;
+
/*! \brief Counter for trailing non-ECM bytes, used to flush out the far end's modem. */
int non_ecm_trailer_bytes;
Modified: freeswitch/trunk/libs/spandsp/src/spandsp/version.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/version.h (original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/version.h Fri Feb 20 12:25:22 2009
@@ -30,8 +30,8 @@
/* The date and time of the version are in UTC form. */
-#define SPANDSP_RELEASE_DATE 20090210
-#define SPANDSP_RELEASE_TIME 172413
+#define SPANDSP_RELEASE_DATE 20090212
+#define SPANDSP_RELEASE_TIME 142337
#endif
/*- End of file ------------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/src/super_tone_tx.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/super_tone_tx.c (original)
+++ freeswitch/trunk/libs/spandsp/src/super_tone_tx.c Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: super_tone_tx.c,v 1.29 2009/02/10 13:06:46 steveu Exp $
+ * $Id: super_tone_tx.c,v 1.30 2009/02/10 17:44:18 steveu Exp $
*/
/*! \file */
@@ -120,7 +120,7 @@
{
/* Follow nesting... */
if (s->nest)
- super_tone_tx_free(s->nest);
+ super_tone_tx_free_tone(s->nest);
t = s;
s = s->next;
free(t);
Modified: freeswitch/trunk/libs/spandsp/src/t31.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/t31.c (original)
+++ freeswitch/trunk/libs/spandsp/src/t31.c Fri Feb 20 12:25:22 2009
@@ -25,7 +25,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t31.c,v 1.140 2009/02/10 13:06:46 steveu Exp $
+ * $Id: t31.c,v 1.142 2009/02/12 14:14:58 steveu Exp $
*/
/*! \file */
@@ -82,6 +82,7 @@
#include "spandsp/at_interpreter.h"
#include "spandsp/fax_modems.h"
#include "spandsp/t31.h"
+#include "spandsp/t30_fcf.h"
#include "spandsp/private/logging.h"
#include "spandsp/private/t38_core.h"
@@ -115,9 +116,24 @@
typedef const char *(*at_cmd_service_t)(t31_state_t *s, const char *cmd);
-#define ETX 0x03
-#define DLE 0x10
-#define SUB 0x1A
+enum
+{
+ ETX = 0x03,
+ DLE = 0x10,
+ SUB = 0x1A
+};
+
+enum
+{
+ DISBIT1 = 0x01,
+ DISBIT2 = 0x02,
+ DISBIT3 = 0x04,
+ DISBIT4 = 0x08,
+ DISBIT5 = 0x10,
+ DISBIT6 = 0x20,
+ DISBIT7 = 0x40,
+ DISBIT8 = 0x80
+};
/* BEWARE: right now this must match up with a list in the AT interpreter code. */
enum
@@ -159,12 +175,17 @@
T38_TIMED_STEP_HDLC_MODEM_3 = 0x22,
T38_TIMED_STEP_HDLC_MODEM_4 = 0x23,
T38_TIMED_STEP_HDLC_MODEM_5 = 0x24,
- T38_TIMED_STEP_CED = 0x30,
- T38_TIMED_STEP_CED_2 = 0x31,
- T38_TIMED_STEP_CED_3 = 0x32,
- T38_TIMED_STEP_CNG = 0x40,
- T38_TIMED_STEP_CNG_2 = 0x41,
- T38_TIMED_STEP_PAUSE = 0x50
+ T38_TIMED_STEP_FAKE_HDLC_MODEM = 0x30,
+ T38_TIMED_STEP_FAKE_HDLC_MODEM_2 = 0x31,
+ T38_TIMED_STEP_FAKE_HDLC_MODEM_3 = 0x32,
+ T38_TIMED_STEP_FAKE_HDLC_MODEM_4 = 0x33,
+ T38_TIMED_STEP_FAKE_HDLC_MODEM_5 = 0x34,
+ T38_TIMED_STEP_CED = 0x40,
+ T38_TIMED_STEP_CED_2 = 0x41,
+ T38_TIMED_STEP_CED_3 = 0x42,
+ T38_TIMED_STEP_CNG = 0x50,
+ T38_TIMED_STEP_CNG_2 = 0x51,
+ T38_TIMED_STEP_PAUSE = 0x60
};
static int restart_modem(t31_state_t *s, int new_modem);
@@ -186,6 +207,30 @@
}
/*- End of function --------------------------------------------------------*/
+#if 0
+static void monitor_control_messages(t31_state_t *s, const uint8_t *buf, int len)
+{
+ /* Monitor the control messages, at the point where we have the whole message, so we can
+ see what is happening to things like training success/failure. */
+ span_log(&s->logging, SPAN_LOG_FLOW, "Monitoring %s\n", t30_frametype(buf[2]));
+ if (len < 3)
+ return;
+ /*endif*/
+ switch (buf[2])
+ {
+ case T30_DCS:
+ case T30_DCS | 1:
+ /* We need to know if ECM is about to be used, so we can fake HDLC stuff. */
+ s->t38_fe.ecm_mode = (len >= 7) && (buf[6] & DISBIT3);
+ break;
+ default:
+ break;
+ }
+ /*endswitch*/
+}
+/*- End of function --------------------------------------------------------*/
+#endif
+
static void front_end_status(t31_state_t *s, int status)
{
span_log(&s->logging, SPAN_LOG_FLOW, "Front end status %d\n", status);
@@ -980,6 +1025,9 @@
case T38_TIMED_STEP_HDLC_MODEM:
delay = stream_hdlc(s);
break;
+ //case T38_TIMED_STEP_FAKE_HDLC_MODEM:
+ // delay = stream_fake_hdlc(s);
+ // break;
case T38_TIMED_STEP_CED:
delay = stream_ced(s);
break;
@@ -2244,7 +2292,7 @@
}
/*- End of function --------------------------------------------------------*/
-static void t31_fax_modems_init(fax_modems_state_t *s, int use_tep, void *user_data)
+static fax_modems_state_t *t31_fax_modems_init(fax_modems_state_t *s, int use_tep, void *user_data)
{
s->use_tep = use_tep;
@@ -2273,6 +2321,7 @@
s->rx_user_data = NULL;
s->tx_handler = (span_tx_handler_t *) &silence_gen;
s->tx_user_data = &s->silence_gen;
+ return s;
}
/*- End of function --------------------------------------------------------*/
@@ -2458,7 +2507,6 @@
2,
NULL,
NULL);
-
return 0;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/src/t38_gateway.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/t38_gateway.c (original)
+++ freeswitch/trunk/libs/spandsp/src/t38_gateway.c Fri Feb 20 12:25:22 2009
@@ -23,7 +23,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: t38_gateway.c,v 1.154 2009/02/10 13:06:46 steveu Exp $
+ * $Id: t38_gateway.c,v 1.155 2009/02/12 12:38:39 steveu Exp $
*/
/*! \file */
@@ -747,7 +747,10 @@
}
/*- End of function --------------------------------------------------------*/
-static void monitor_control_messages(t38_gateway_state_t *s, int from_modem, uint8_t *buf, int len)
+static void monitor_control_messages(t38_gateway_state_t *s,
+ int from_modem,
+ const uint8_t *buf,
+ int len)
{
static const struct
{
@@ -1704,7 +1707,7 @@
{
t38_gateway_state_t *s;
- s = (t38_gateway_state_t *) t->user_data;
+ s = (t38_gateway_state_t *) t->frame_user_data;
span_log(&s->logging, SPAN_LOG_FLOW, "HDLC signal status is %s (%d)\n", signal_status_to_str(status), status);
switch (status)
{
@@ -1761,7 +1764,7 @@
t38_gateway_state_t *s;
t38_gateway_to_t38_state_t *u;
- s = (t38_gateway_state_t *) t->user_data;
+ s = (t38_gateway_state_t *) t->frame_user_data;
u = &s->core.to_t38;
if ((t->raw_bit_stream & 0x80))
{
@@ -1916,7 +1919,7 @@
return;
}
/*endif*/
- s = (t38_gateway_state_t *) t->user_data;
+ s = (t38_gateway_state_t *) t->frame_user_data;
u = &s->core.to_t38;
t->buffer[t->len] = (uint8_t) t->byte_in_progress;
/* Calculate the CRC progressively, before we start altering the frame */
Modified: freeswitch/trunk/libs/spandsp/tests/fax_tester.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/fax_tester.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/fax_tester.c Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: fax_tester.c,v 1.21 2009/01/28 03:41:27 steveu Exp $
+ * $Id: fax_tester.c,v 1.22 2009/02/12 12:38:39 steveu Exp $
*/
/*! \file */
@@ -146,7 +146,7 @@
}
/*- End of function --------------------------------------------------------*/
-static int modem_tx_status(void *user_data, int status)
+static void modem_tx_status(void *user_data, int status)
{
faxtester_state_t *s;
@@ -158,7 +158,6 @@
front_end_step_complete(s);
break;
}
- return 0;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/tests/fsk_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/fsk_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/fsk_tests.c Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: fsk_tests.c,v 1.53 2008/11/30 10:17:31 steveu Exp $
+ * $Id: fsk_tests.c,v 1.55 2009/02/12 14:21:16 steveu Exp $
*/
/*! \page fsk_tests_page FSK modem tests
@@ -69,17 +69,15 @@
int rx_bits = 0;
int cutoff_test_carrier = FALSE;
-static int rx_status(void *user_data, int status)
+static void rx_status(void *user_data, int status)
{
printf("FSK rx status is %s (%d)\n", signal_status_to_str(status), status);
- return 0;
}
/*- End of function --------------------------------------------------------*/
-static int tx_status(void *user_data, int status)
+static void tx_status(void *user_data, int status)
{
printf("FSK tx status is %s (%d)\n", signal_status_to_str(status), status);
- return 0;
}
/*- End of function --------------------------------------------------------*/
@@ -95,7 +93,7 @@
}
/*- End of function --------------------------------------------------------*/
-static int cutoff_test_rx_status(void *user_data, int status)
+static void cutoff_test_rx_status(void *user_data, int status)
{
printf("FSK rx status is %s (%d)\n", signal_status_to_str(status), status);
switch (status)
@@ -107,7 +105,6 @@
cutoff_test_carrier = FALSE;
break;
}
- return 0;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/tests/logging_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/logging_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/logging_tests.c Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: logging_tests.c,v 1.15 2008/11/30 13:44:35 steveu Exp $
+ * $Id: logging_tests.c,v 1.16 2009/02/12 12:38:39 steveu Exp $
*/
/*! \page logging_tests_page Logging tests
@@ -132,7 +132,7 @@
struct timespec delay;
/* Set up a logger */
- if (span_log_init(&log, 123, "TAG"))
+ if (span_log_init(&log, 123, "TAG") == NULL)
{
fprintf(stderr, "Failed to initialise log.\n");
exit(2);
Modified: freeswitch/trunk/libs/spandsp/tests/make_g168_css.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/make_g168_css.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/make_g168_css.c Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: make_g168_css.c,v 1.16 2008/11/30 12:38:27 steveu Exp $
+ * $Id: make_g168_css.c,v 1.17 2009/02/10 17:49:20 steveu Exp $
*/
/*! \page makecss_page CSS construction for G.168 testing
@@ -49,9 +49,6 @@
#else
#include <fftw.h>
#endif
-#if defined(HAVE_MATH_H)
-#define GEN_CONST
-#endif
//#if defined(WITH_SPANDSP_INTERNALS)
#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES
Modified: freeswitch/trunk/libs/spandsp/tests/super_tone_tx_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/super_tone_tx_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/super_tone_tx_tests.c Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: super_tone_tx_tests.c,v 1.24 2008/11/30 10:17:31 steveu Exp $
+ * $Id: super_tone_tx_tests.c,v 1.25 2009/02/10 17:44:18 steveu Exp $
*/
/*! \file */
@@ -202,7 +202,7 @@
super_tone_tx_init(&tone, tone_tree);
//printf("Len %p %p %d %d\n", (void *) tone.levels[0], (void *) tone_tree, tone_tree->length, tone_tree->tone);
play_tones(&tone, 99999999);
- super_tone_tx_free(tone_tree);
+ super_tone_tx_free_tone(tone_tree);
}
/*endif*/
cur = cur->next;
Modified: freeswitch/trunk/libs/spandsp/tests/v17_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/v17_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/v17_tests.c Fri Feb 20 12:25:22 2009
@@ -23,7 +23,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: v17_tests.c,v 1.98 2009/01/12 17:20:59 steveu Exp $
+ * $Id: v17_tests.c,v 1.100 2009/02/12 14:21:16 steveu Exp $
*/
/*! \page v17_tests_page V.17 modem tests
@@ -114,7 +114,7 @@
}
/*- End of function --------------------------------------------------------*/
-static int v17_rx_status(void *user_data, int status)
+static void v17_rx_status(void *user_data, int status)
{
v17_rx_state_t *rx;
int i;
@@ -132,7 +132,6 @@
printf("%3d (%15.5f, %15.5f) -> %15.5f\n", i, coeffs[i].re, coeffs[i].im, powerf(&coeffs[i]));
break;
}
- return 0;
}
/*- End of function --------------------------------------------------------*/
@@ -154,10 +153,9 @@
}
/*- End of function --------------------------------------------------------*/
-static int v17_tx_status(void *user_data, int status)
+static void v17_tx_status(void *user_data, int status)
{
printf("V.17 tx status is %s (%d)\n", signal_status_to_str(status), status);
- return 0;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/tests/v27ter_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/v27ter_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/v27ter_tests.c Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: v27ter_tests.c,v 1.99 2009/01/12 17:20:59 steveu Exp $
+ * $Id: v27ter_tests.c,v 1.101 2009/02/12 14:21:16 steveu Exp $
*/
/*! \page v27ter_tests_page V.27ter modem tests
@@ -110,10 +110,9 @@
}
/*- End of function --------------------------------------------------------*/
-static int v27ter_rx_status(void *user_data, int status)
+static void v27ter_rx_status(void *user_data, int status)
{
printf("V.27ter rx status is %s (%d)\n", signal_status_to_str(status), status);
- return 0;
}
/*- End of function --------------------------------------------------------*/
@@ -131,10 +130,9 @@
}
/*- End of function --------------------------------------------------------*/
-static int v27ter_tx_status(void *user_data, int status)
+static void v27ter_tx_status(void *user_data, int status)
{
printf("V.27ter tx status is %s (%d)\n", signal_status_to_str(status), status);
- return 0;
}
/*- End of function --------------------------------------------------------*/
Modified: freeswitch/trunk/libs/spandsp/tests/v29_tests.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/v29_tests.c (original)
+++ freeswitch/trunk/libs/spandsp/tests/v29_tests.c Fri Feb 20 12:25:22 2009
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: v29_tests.c,v 1.113 2009/01/12 17:20:59 steveu Exp $
+ * $Id: v29_tests.c,v 1.115 2009/02/12 14:21:16 steveu Exp $
*/
/*! \page v29_tests_page V.29 modem tests
@@ -109,7 +109,7 @@
}
/*- End of function --------------------------------------------------------*/
-static int v29_rx_status(void *user_data, int status)
+static void v29_rx_status(void *user_data, int status)
{
v29_rx_state_t *rx;
int i;
@@ -139,7 +139,6 @@
#endif
break;
}
- return 0;
}
/*- End of function --------------------------------------------------------*/
@@ -161,10 +160,9 @@
}
/*- End of function --------------------------------------------------------*/
-static int v29_tx_status(void *user_data, int status)
+static void v29_tx_status(void *user_data, int status)
{
printf("V.29 tx status is %s (%d)\n", signal_status_to_str(status), status);
- return 0;
}
/*- End of function --------------------------------------------------------*/
1
0