[Freeswitch-svn] [commit] r9768 - in freeswitch/trunk/libs/spandsp: . spandsp src src/spandsp tests

Freeswitch SVN anthm at freeswitch.org
Tue Sep 30 23:54:17 EDT 2008


Author: anthm
Date: Tue Sep 30 23:54:17 2008
New Revision: 9768

Modified:
   freeswitch/trunk/libs/spandsp/.update
   freeswitch/trunk/libs/spandsp/config-h.in
   freeswitch/trunk/libs/spandsp/configure.ac
   freeswitch/trunk/libs/spandsp/spandsp/tsb85.xml
   freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_rx.h
   freeswitch/trunk/libs/spandsp/src/spandsp/v29rx.h
   freeswitch/trunk/libs/spandsp/src/spandsp/version.h
   freeswitch/trunk/libs/spandsp/src/v27ter_rx.c
   freeswitch/trunk/libs/spandsp/src/v29rx.c
   freeswitch/trunk/libs/spandsp/tests/fax_tester.c
   freeswitch/trunk/libs/spandsp/tests/fax_tester.h
   freeswitch/trunk/libs/spandsp/tests/t31_tests.c
   freeswitch/trunk/libs/spandsp/tests/tsb85_tests.c

Log:
update to snapshot spandsp-20080913.tar.gz

Modified: freeswitch/trunk/libs/spandsp/.update
==============================================================================
--- freeswitch/trunk/libs/spandsp/.update	(original)
+++ freeswitch/trunk/libs/spandsp/.update	Tue Sep 30 23:54:17 2008
@@ -1 +1 @@
-Tue Sep 30 23:52:21 EDT 2008
+Tue Sep 30 23:53:44 EDT 2008

Modified: freeswitch/trunk/libs/spandsp/config-h.in
==============================================================================
--- freeswitch/trunk/libs/spandsp/config-h.in	(original)
+++ freeswitch/trunk/libs/spandsp/config-h.in	Tue Sep 30 23:54:17 2008
@@ -212,9 +212,6 @@
 /* Define to 1 if you have the <tiffio.h> header file. */
 #undef HAVE_TIFFIO_H
 
-/* Define to 1 if you have the <unicall.h> header file. */
-#undef HAVE_UNICALL_H
-
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 

Modified: freeswitch/trunk/libs/spandsp/configure.ac
==============================================================================
--- freeswitch/trunk/libs/spandsp/configure.ac	(original)
+++ freeswitch/trunk/libs/spandsp/configure.ac	Tue Sep 30 23:54:17 2008
@@ -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: configure.ac,v 1.56 2008/07/10 12:44:54 steveu Exp $
+# $Id: configure.ac,v 1.57 2008/09/12 14:41:55 steveu Exp $
 
 # @start 1
 
@@ -180,7 +180,6 @@
 AC_CHECK_HEADERS([fftw3.h], , [AC_CHECK_HEADERS([fftw.h])])
 AC_CHECK_HEADERS([tiffio.h])
 AC_CHECK_HEADERS([pthread.h])
-AC_CHECK_HEADERS([unicall.h])
 if test "${build}" == "${host}"
 then
   AC_CHECK_HEADERS([X11/X.h])
@@ -273,7 +272,6 @@
     AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], TESTLIBS="$TESTLIBS -lfftw3", [AC_CHECK_LIB([fftw], [fftw_create_plan], TESTLIBS="$TESTLIBS -lfftw")])
     AC_CHECK_LIB([pthread], [pthread_attr_init], TESTLIBS="$TESTLIBS -lpthread")
     AC_CHECK_LIB([dl], [dlopen], TESTLIBS="$TESTLIBS -ldl")
-    AC_CHECK_LIB([unicall], [uc_start], TESTLIBS="$TESTLIBS -lunicall",, -ltiff -ldl)
     AC_CHECK_LIB([Xft], [XftFontOpen], TESTLIBS="$TESTLIBS -lXft",, $TESTLIBS)
     AC_CHECK_LIB([Xext], [XextCreateExtension], TESTLIBS="$TESTLIBS -lXext",, $TESTLIBS)
     AC_CHECK_LIB([X11], [XOpenDisplay], TESTLIBS="$TESTLIBS -lX11",, $TESTLIBS)

Modified: freeswitch/trunk/libs/spandsp/spandsp/tsb85.xml
==============================================================================
--- freeswitch/trunk/libs/spandsp/spandsp/tsb85.xml	(original)
+++ freeswitch/trunk/libs/spandsp/spandsp/tsb85.xml	Tue Sep 30 23:54:17 2008
@@ -1,7 +1,10 @@
 <?xml version="1.0"?>
 <!DOCTYPE fax-tests SYSTEM "./fax-tests.dtd">
 <fax-tests>
-<!-- $Id: tsb85.xml,v 1.20 2008/09/11 15:13:42 steveu Exp $ -->
+<!-- $Id: tsb85.xml,v 1.21 2008/09/12 14:41:55 steveu Exp $ -->
+<config>
+    <path type="IMAGE" value="../test-data/etsi/fax"/>
+</config>
 <messages>
     <!-- TCF = 2700 bytes at 14400, 2250 at 12000, 1800 at 9600, 1350 at 7200, 900 at 4800 or 450 at 2400 -->
     <!-- Bad TCF == 10101010.... -->
@@ -1330,25 +1333,26 @@
         <step dir="R" type="HDLC" modem="V.21" tag="CFR" value="FF C8 21"/>
         <step dir="R" type="SILENCE"/>
 
+        <!-- First page -->
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.17/14400"/>
         <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif" min_bits="141" crc_error="0"/>
         <step dir="T" type="POSTAMBLE"/>
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 6B"/>
+        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 FF"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FF FF FF FF FF"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"/>
         <step dir="R" type="SILENCE"/>
 
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.17/14400"/>
-        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif"/>
+        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif" min_bits="141"/>
         <step dir="T" type="POSTAMBLE"/>
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 6B"/>
+        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 FF"/>
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
@@ -1356,19 +1360,19 @@
 
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.17/14400"/>
-        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif" crc_error="100"/>
+        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif" min_bits="141" block="1" crc_error="356"/>
         <step dir="T" type="POSTAMBLE"/>
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="PPS-MPS" value="FF C8 7D 72 00 80 6B"/>
+        <step dir="T" type="HDLC" tag="PPS-MPS" value="FF C8 7D 72 00 80 3B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FF FF FF FF FF"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07 FF FF FF FF"/>
         <step dir="R" type="SILENCE"/>
 
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.17/14400"/>
-        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif"/>
+        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif" min_bits="141" block="1"/>
         <step dir="T" type="POSTAMBLE"/>
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
@@ -1378,6 +1382,7 @@
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
 
+        <!-- Second page -->
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.17/14400"/>
         <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif" crc_error="214"/>
@@ -1412,39 +1417,6 @@
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
 
         <step type="WAIT" value="75"/>
-        <step dir="T" type="PREAMBLE" modem="V.17/14400"/>
-        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif" crc_error="0"/>
-        <step dir="T" type="POSTAMBLE"/>
-        <step type="WAIT" value="75"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 40 00 6B"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FF FF FF FF FF"/>
-        <step dir="R" type="SILENCE"/>
-
-        <step type="WAIT" value="75"/>
-        <step dir="T" type="PREAMBLE" modem="V.17/14400"/>
-        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif"/>
-        <step dir="T" type="POSTAMBLE"/>
-        <step type="WAIT" value="75"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 40 00 6B"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <possible-step>
-            <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
-            <step dir="R" type="SILENCE"/>
-
-            <step type="WAIT" value="75"/>
-            <step dir="T" type="PREAMBLE" modem="V.21"/>
-            <step dir="T" type="HDLC" tag="RR" value="FF C8 76"/>
-            <step dir="T" type="POSTAMBLE"/>
-        </possible-step>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
-
-        <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
         <step dir="T" type="HDLC" tag="DCN" value="FF C8 5F"/>
         <step dir="T" type="POSTAMBLE"/>
@@ -1629,7 +1601,7 @@
             <step dir="T" type="POSTAMBLE"/>
         </possible-step>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FF FF FF FF FF"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"/>
         <step dir="R" type="SILENCE"/>
 
         <step type="WAIT" value="75"/>
@@ -1651,7 +1623,7 @@
             <step dir="T" type="POSTAMBLE"/>
         </possible-step>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FF FF FF FF FF"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"/>
         <step dir="R" type="SILENCE"/>
 
         <step type="WAIT" value="75"/>
@@ -1673,7 +1645,7 @@
             <step dir="T" type="POSTAMBLE"/>
         </possible-step>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FF FF FF FF FF"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"/>
         <step dir="R" type="SILENCE"/>
 
         <step type="WAIT" value="75"/>
@@ -1695,7 +1667,7 @@
             <step dir="T" type="POSTAMBLE"/>
         </possible-step>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FF FF FF FF FF"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"/>
         <step dir="R" type="SILENCE"/>
 
         <step type="WAIT" value="75"/>
@@ -1759,7 +1731,7 @@
         <step dir="T" type="POSTAMBLE"/>
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 6B"/>
+        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 FF"/>
         <step dir="T" type="POSTAMBLE"/>
 
         <possible-step>
@@ -1781,7 +1753,7 @@
         <step dir="T" type="POSTAMBLE"/>
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 6B"/>
+        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 FF"/>
         <step dir="T" type="POSTAMBLE"/>
 
         <possible-step>
@@ -1794,7 +1766,7 @@
             <step dir="T" type="POSTAMBLE"/>
         </possible-step>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FF FF FF FF FF"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"/>
         <step dir="R" type="SILENCE"/>
 
         <step type="WAIT" value="75"/>
@@ -1803,7 +1775,7 @@
         <step dir="T" type="POSTAMBLE"/>
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 6B"/>
+        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 FF"/>
         <step dir="T" type="POSTAMBLE"/>
 
         <possible-step>
@@ -1816,7 +1788,7 @@
             <step dir="T" type="POSTAMBLE"/>
         </possible-step>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FF FF FF FF FF"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"/>
         <step dir="R" type="SILENCE"/>
 
         <step type="WAIT" value="75"/>
@@ -1825,7 +1797,7 @@
         <step dir="T" type="POSTAMBLE"/>
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 6B"/>
+        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 FF"/>
         <step dir="T" type="POSTAMBLE"/>
 
         <possible-step>
@@ -1838,7 +1810,7 @@
             <step dir="T" type="POSTAMBLE"/>
         </possible-step>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FF FF FF FF FF"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"/>
         <step dir="R" type="SILENCE"/>
 
         <step type="WAIT" value="75"/>
@@ -1847,7 +1819,7 @@
         <step dir="T" type="POSTAMBLE"/>
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 6B"/>
+        <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 FF"/>
         <step dir="T" type="POSTAMBLE"/>
 
         <possible-step>
@@ -1860,7 +1832,7 @@
             <step dir="T" type="POSTAMBLE"/>
         </possible-step>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 FF FF FF FF FF"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="PPR" value="FF C8 3D 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"/>
         <step dir="R" type="SILENCE"/>
 
         <step type="WAIT" value="75"/>

Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_rx.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_rx.h	(original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/v27ter_rx.h	Tue Sep 30 23:54:17 2008
@@ -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: v27ter_rx.h,v 1.48 2008/09/08 12:54:32 steveu Exp $
+ * $Id: v27ter_rx.h,v 1.49 2008/09/13 14:59:31 steveu Exp $
  */
 
 /*! \file */
@@ -128,10 +128,17 @@
     int32_t carrier_phase_rate;
     /*! \brief The carrier update rate saved for reuse when using short training. */
     int32_t carrier_phase_rate_save;
+#if defined(SPANDSP_USE_FIXED_POINTx)
+    /*! \brief The proportional part of the carrier tracking filter. */
+    float carrier_track_p;
+    /*! \brief The integral part of the carrier tracking filter. */
+    float carrier_track_i;
+#else
     /*! \brief The proportional part of the carrier tracking filter. */
     float carrier_track_p;
     /*! \brief The integral part of the carrier tracking filter. */
     float carrier_track_i;
+#endif
 
     /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */    
     power_meter_t power;
@@ -139,10 +146,6 @@
     int32_t carrier_on_power;
     /*! \brief The power meter level at which carrier off is declared. */
     int32_t carrier_off_power;
-    /*! \brief The scaling factor accessed by the AGC algorithm. */
-    float agc_scaling;
-    /*! \brief The previous value of agc_scaling, needed to reuse old training. */
-    float agc_scaling_save;
 
     /*! \brief The position of the current symbol in the constellation, used for
                differential decoding. */
@@ -159,6 +162,11 @@
     int baud_half;
 
 #if defined(SPANDSP_USE_FIXED_POINTx)
+    /*! \brief The scaling factor accessed by the AGC algorithm. */
+    float agc_scaling;
+    /*! \brief The previous value of agc_scaling, needed to reuse old training. */
+    float agc_scaling_save;
+
     /*! \brief The current delta factor for updating the equalizer coefficients. */
     float eq_delta;
     /*! \brief The adaptive equalizer coefficients. */
@@ -168,6 +176,11 @@
     /*! \brief The equalizer signal buffer. */
     complexi16_t eq_buf[V27TER_EQUALIZER_MASK + 1];
 #else
+    /*! \brief The scaling factor accessed by the AGC algorithm. */
+    float agc_scaling;
+    /*! \brief The previous value of agc_scaling, needed to reuse old training. */
+    float agc_scaling_save;
+
     /*! \brief The current delta factor for updating the equalizer coefficients. */
     float eq_delta;
     /*! \brief The adaptive equalizer coefficients. */

Modified: freeswitch/trunk/libs/spandsp/src/spandsp/v29rx.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/spandsp/v29rx.h	(original)
+++ freeswitch/trunk/libs/spandsp/src/spandsp/v29rx.h	Tue Sep 30 23:54:17 2008
@@ -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: v29rx.h,v 1.59 2008/09/08 12:45:02 steveu Exp $
+ * $Id: v29rx.h,v 1.60 2008/09/13 14:10:31 steveu Exp $
  */
 
 /*! \file */
@@ -196,10 +196,17 @@
     int32_t carrier_phase_rate;
     /*! \brief The carrier update rate saved for reuse when using short training. */
     int32_t carrier_phase_rate_save;
+#if defined(SPANDSP_USE_FIXED_POINT)
+    /*! \brief The proportional part of the carrier tracking filter. */
+    int32_t carrier_track_p;
+    /*! \brief The integral part of the carrier tracking filter. */
+    int32_t carrier_track_i;
+#else
     /*! \brief The proportional part of the carrier tracking filter. */
     float carrier_track_p;
     /*! \brief The integral part of the carrier tracking filter. */
     float carrier_track_i;
+#endif
 
     /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */    
     power_meter_t power;
@@ -207,10 +214,6 @@
     int32_t carrier_on_power;
     /*! \brief The power meter level at which carrier off is declared. */
     int32_t carrier_off_power;
-    /*! \brief The scaling factor accessed by the AGC algorithm. */
-    float agc_scaling;
-    /*! \brief The previous value of agc_scaling, needed to reuse old training. */
-    float agc_scaling_save;
 
     /*! \brief The position of the current symbol in the constellation, used for
                differential decoding. */
@@ -227,6 +230,11 @@
     int baud_half;
 
 #if defined(SPANDSP_USE_FIXED_POINT)
+    /*! \brief The scaling factor accessed by the AGC algorithm. */
+    int32_t agc_scaling;
+    /*! \brief The previous value of agc_scaling, needed to reuse old training. */
+    int32_t agc_scaling_save;
+
     /*! \brief The current delta factor for updating the equalizer coefficients. */
     int16_t eq_delta;
     /*! \brief The adaptive equalizer coefficients. */
@@ -245,6 +253,11 @@
     /*! Baud phase for symbol sync. */
     int32_t baud_phase;
 #else
+    /*! \brief The scaling factor accessed by the AGC algorithm. */
+    float agc_scaling;
+    /*! \brief The previous value of agc_scaling, needed to reuse old training. */
+    float agc_scaling_save;
+
     /*! \brief The current delta factor for updating the equalizer coefficients. */
     float eq_delta;
     /*! \brief The adaptive equalizer coefficients. */

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	Tue Sep 30 23:54:17 2008
@@ -30,8 +30,8 @@
 
 /* The date and time of the version are in UTC form. */
 
-#define SPANDSP_RELEASE_DATE    20080911
-#define SPANDSP_RELEASE_TIME    151652
+#define SPANDSP_RELEASE_DATE    20080913
+#define SPANDSP_RELEASE_TIME    155039
 
 #endif
 /*- End of file ------------------------------------------------------------*/

Modified: freeswitch/trunk/libs/spandsp/src/v27ter_rx.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/v27ter_rx.c	(original)
+++ freeswitch/trunk/libs/spandsp/src/v27ter_rx.c	Tue Sep 30 23:54:17 2008
@@ -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: v27ter_rx.c,v 1.101 2008/09/08 13:13:29 steveu Exp $
+ * $Id: v27ter_rx.c,v 1.102 2008/09/13 14:59:30 steveu Exp $
  */
 
 /*! \file */
@@ -323,16 +323,17 @@
     /* For small errors the imaginary part of the difference between the actual and the target
        positions is proportional to the phase error, for any particular target. However, the
        different amplitudes of the various target positions scale things. */
-#if defined(SPANDSP_USE_FIXED_POINTx)
     error = z->im*target->re - z->re*target->im;
+
+#if defined(SPANDSP_USE_FIXED_POINTx)
     error /= (float) FP_FACTOR;
+    s->carrier_phase_rate += (int32_t) (s->carrier_track_i*error);
+    s->carrier_phase += (int32_t) (s->carrier_track_p*error);
 #else
-    error = z->im*target->re - z->re*target->im;
-#endif
-    
     s->carrier_phase_rate += (int32_t) (s->carrier_track_i*error);
     s->carrier_phase += (int32_t) (s->carrier_track_p*error);
     //span_log(&s->logging, SPAN_LOG_FLOW, "Im = %15.5f   f = %15.5f\n", error, dds_frequencyf(s->carrier_phase_rate));
+#endif
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -676,8 +677,13 @@
             s->constellation_state = (s->bit_rate == 4800)  ?  4  :  2;
             s->training_count = 0;
             s->training_stage = TRAINING_STAGE_TEST_ONES;
+#if defined(SPANDSP_USE_FIXED_POINTx)
+            s->carrier_track_i = 400;
+            s->carrier_track_p = 1000000;
+#else
             s->carrier_track_i = 400.0f;
             s->carrier_track_p = 1000000.0f;
+#endif
         }
         break;
     case TRAINING_STAGE_TEST_ONES:
@@ -1076,8 +1082,13 @@
 #endif
 
     s->carrier_phase = 0;
+#if defined(SPANDSP_USE_FIXED_POINTx)
+    s->carrier_track_i = 200000;
+    s->carrier_track_p = 10000000;
+#else
     s->carrier_track_i = 200000.0f;
     s->carrier_track_p = 10000000.0f;
+#endif
     power_meter_init(&(s->power), 4);
 
     s->constellation_state = 0;

Modified: freeswitch/trunk/libs/spandsp/src/v29rx.c
==============================================================================
--- freeswitch/trunk/libs/spandsp/src/v29rx.c	(original)
+++ freeswitch/trunk/libs/spandsp/src/v29rx.c	Tue Sep 30 23:54:17 2008
@@ -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: v29rx.c,v 1.135 2008/09/09 16:13:12 steveu Exp $
+ * $Id: v29rx.c,v 1.138 2008/09/13 15:48:04 steveu Exp $
  */
 
 /*! \file */
@@ -362,7 +362,11 @@
 static __inline__ void track_carrier(v29_rx_state_t *s, const complexf_t *z, const complexf_t *target)
 #endif
 {
+#if defined(SPANDSP_USE_FIXED_POINT)
+    int32_t error;
+#else
     float error;
+#endif
 
     /* The initial coarse carrier frequency and phase estimation should have
        got us in the right ballpark. Now we need to fine tune fairly quickly,
@@ -377,19 +381,19 @@
        different amplitudes of the various target positions scale things. This isn't all bad,
        as the angular error for the larger amplitude constellation points is probably
        a more reliable indicator, and we are weighting it as such. */
-#if defined(SPANDSP_USE_FIXED_POINT)
     error = z->im*target->re - z->re*target->im;
-    error /= (float) FP_FACTOR;
-#else
-    error = z->im*target->re - z->re*target->im;
-#endif
 
     /* Use a proportional-integral approach to tracking the carrier. The PI
        parameters are coarser at first, until we get precisely on target. Then,
        the filter will be damped more to keep us on target. */
+#if defined(SPANDSP_USE_FIXED_POINT)
+    s->carrier_phase_rate += ((s->carrier_track_i*error) >> FP_SHIFT_FACTOR);
+    s->carrier_phase += ((s->carrier_track_p*error) >> FP_SHIFT_FACTOR);
+#else
     s->carrier_phase_rate += (int32_t) (s->carrier_track_i*error);
     s->carrier_phase += (int32_t) (s->carrier_track_p*error);
     //span_log(&s->logging, SPAN_LOG_FLOW, "Im = %15.5f   f = %15.5f\n", error, dds_frequencyf(s->carrier_phase_rate));
+#endif
 }
 /*- End of function --------------------------------------------------------*/
 
@@ -521,7 +525,7 @@
     s->symbol_sync_dc_filter[0] = v;
     /* A little integration will now filter away much of the noise */
     s->baud_phase -= p;
-    if (abs(s->baud_phase) > 50*FP_FACTOR)
+    if (abs(s->baud_phase) > 100*FP_FACTOR)
     {
         if (s->baud_phase > 0)
             i = (s->baud_phase > 1000*FP_FACTOR)  ?  5  :  1;
@@ -543,7 +547,7 @@
     s->symbol_sync_dc_filter[0] = v;
     /* A little integration will now filter away much of the noise */
     s->baud_phase -= p;
-    if (fabsf(s->baud_phase) > 50.0f)
+    if (fabsf(s->baud_phase) > 100.0f)
     {
         if (s->baud_phase > 0.0f)
             i = (s->baud_phase > 1000.0f)  ?  5  :  1;
@@ -620,8 +624,13 @@
             s->training_stage = TRAINING_STAGE_LOG_PHASE;
             s->angles[0] =
             s->start_angles[0] = arctan2(z.im, z.re);
+#if defined(SPANDSP_USE_FIXED_POINT)
+            if (s->agc_scaling_save == 0)
+                s->agc_scaling_save = s->agc_scaling;
+#else
             if (s->agc_scaling_save == 0.0f)
                 s->agc_scaling_save = s->agc_scaling;
+#endif
         }
         break;
     case TRAINING_STAGE_LOG_PHASE:
@@ -664,7 +673,11 @@
             {
                 span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (sequence failed)\n");
                 /* Park this modem */
+#if defined(SPANDSP_USE_FIXED_POINT)
+                s->agc_scaling_save = 0;
+#else
                 s->agc_scaling_save = 0.0f;
+#endif
                 s->training_stage = TRAINING_STAGE_PARKED;
                 report_status_change(s, SIG_STATUS_TRAINING_FAILED);
                 break;
@@ -700,7 +713,11 @@
                of a real training sequence. */
             span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (sequence failed)\n");
             /* Park this modem */
+#if defined(SPANDSP_USE_FIXED_POINT)
+            s->agc_scaling_save = 0;
+#else
             s->agc_scaling_save = 0.0f;
+#endif
             s->training_stage = TRAINING_STAGE_PARKED;
             report_status_change(s, SIG_STATUS_TRAINING_FAILED);
         }
@@ -717,8 +734,13 @@
         {
             s->training_stage = TRAINING_STAGE_TRAIN_ON_CDCD_AND_TEST;
             s->training_error = 0.0f;
+#if defined(SPANDSP_USE_FIXED_POINT)
+            s->carrier_track_i = 200;
+            s->carrier_track_p = 1000000;
+#else
             s->carrier_track_i = 200.0f;
             s->carrier_track_p = 1000000.0f;
+#endif
         }
         break;
     case TRAINING_STAGE_TRAIN_ON_CDCD_AND_TEST:
@@ -755,7 +777,11 @@
             {
                 span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (convergence failed)\n");
                 /* Park this modem */
+#if defined(SPANDSP_USE_FIXED_POINT)
+                s->agc_scaling_save = 0;
+#else
                 s->agc_scaling_save = 0.0f;
+#endif
                 s->training_stage = TRAINING_STAGE_PARKED;
                 report_status_change(s, SIG_STATUS_TRAINING_FAILED);
             }
@@ -799,7 +825,11 @@
                 /* Training has failed */
                 span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %f)\n", s->training_error);
                 /* Park this modem */
+#if defined(SPANDSP_USE_FIXED_POINT)
+                s->agc_scaling_save = 0;
+#else
                 s->agc_scaling_save = 0.0f;
+#endif
                 s->training_stage = TRAINING_STAGE_PARKED;
                 report_status_change(s, SIG_STATUS_TRAINING_FAILED);
             }
@@ -839,7 +869,6 @@
     complexi16_t zz;
     complexi16_t sample;
     int32_t v;
-    float y;
 #else
     complexf_t z;
     complexf_t zz;
@@ -930,8 +959,7 @@
         v = (int32_t) rx_pulseshaper[step][0].re*(int32_t) s->rrc_filter[s->rrc_filter_step];
         for (j = 1;  j < V29_RX_FILTER_STEPS;  j++)
             v += (int32_t) rx_pulseshaper[step][j].re*(int32_t) s->rrc_filter[j + s->rrc_filter_step];
-        y = v*s->agc_scaling;
-        sample.re = y;
+        sample.re = (v*s->agc_scaling) >> 15;
 #else
         v = rx_pulseshaper[step][0].re*s->rrc_filter[s->rrc_filter_step];
         for (j = 1;  j < V29_RX_FILTER_STEPS;  j++)
@@ -965,8 +993,8 @@
         {
             /* Only AGC until we have locked down the setting. */
 #if defined(SPANDSP_USE_FIXED_POINT)
-            if (s->agc_scaling_save == 0.0f)
-                s->agc_scaling = (float) FP_FACTOR*(1.0f/RX_PULSESHAPER_GAIN)*5.0f*0.25f/sqrtf(power);
+            if (s->agc_scaling_save == 0)
+                s->agc_scaling = (float) FP_FACTOR*32768.0f*(1.0f/RX_PULSESHAPER_GAIN)*5.0f*0.25f/sqrtf(power);
 #else
             if (s->agc_scaling_save == 0.0f)
                 s->agc_scaling = (1.0f/RX_PULSESHAPER_GAIN)*5.0f*0.25f/sqrtf(power);
@@ -983,7 +1011,7 @@
             v = (int32_t) rx_pulseshaper[step][0].im*(int32_t) s->rrc_filter[s->rrc_filter_step];
             for (j = 1;  j < V29_RX_FILTER_STEPS;  j++)
                 v += (int32_t) rx_pulseshaper[step][j].im*(int32_t) s->rrc_filter[j + s->rrc_filter_step];
-            sample.im = v*s->agc_scaling;
+            sample.im = (v*s->agc_scaling) >> 15;
             z = dds_lookup_complexi16(s->carrier_phase);
             zz.re = ((int32_t) sample.re*(int32_t) z.re - (int32_t) sample.im*(int32_t) z.im) >> 15;
             zz.im = ((int32_t) -sample.re*(int32_t) z.im - (int32_t) sample.im*(int32_t) z.re) >> 15;
@@ -1070,16 +1098,22 @@
     else
     {
         s->carrier_phase_rate = dds_phase_ratef(CARRIER_NOMINAL_FREQ);
-        s->agc_scaling_save = 0.0f;
 #if defined(SPANDSP_USE_FIXED_POINT)
-        s->agc_scaling = (float) FP_FACTOR*0.0017f/RX_PULSESHAPER_GAIN;
+        s->agc_scaling_save = 0;
+        s->agc_scaling = (float) FP_FACTOR*32768.0f*0.0017f/RX_PULSESHAPER_GAIN;
 #else
+        s->agc_scaling_save = 0.0f;
         s->agc_scaling = 0.0017f/RX_PULSESHAPER_GAIN;
 #endif
         equalizer_reset(s);
     }
+#if defined(SPANDSP_USE_FIXED_POINT)
+    s->carrier_track_i = 8000;
+    s->carrier_track_p = 8000000;
+#else
     s->carrier_track_i = 8000.0f;
     s->carrier_track_p = 8000000.0f;
+#endif
     s->last_sample = 0;
     s->eq_skip = 0;
 

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	Tue Sep 30 23:54:17 2008
@@ -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.16 2008/09/09 14:05:55 steveu Exp $
+ * $Id: fax_tester.c,v 1.17 2008/09/12 14:41:55 steveu Exp $
  */
 
 /*! \file */
@@ -217,10 +217,16 @@
 }
 /*- End of function --------------------------------------------------------*/
 
-void faxtester_set_ecm_image_buffer(faxtester_state_t *s, const uint8_t *buf, int len, int frame_size, int crc_hit)
+void faxtester_set_ecm_image_buffer(faxtester_state_t *s, const uint8_t *buf, int len, int block, int frame_size, int crc_hit)
 {
+    int start;
+
+    start = 256*frame_size*block;
+    if (len > start + 256*frame_size)
+        len = start + 256*frame_size;
+
     s->ecm_frame_size = frame_size;
-    s->image_ptr = 0;
+    s->image_ptr = start;
     s->image_bit_ptr = 8;
     s->image_len = len;
     s->image_buffer = buf;

Modified: freeswitch/trunk/libs/spandsp/tests/fax_tester.h
==============================================================================
--- freeswitch/trunk/libs/spandsp/tests/fax_tester.h	(original)
+++ freeswitch/trunk/libs/spandsp/tests/fax_tester.h	Tue Sep 30 23:54:17 2008
@@ -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.h,v 1.8 2008/08/13 00:11:30 steveu Exp $
+ * $Id: fax_tester.h,v 1.9 2008/09/12 14:41:55 steveu Exp $
  */
 
 /*! \file */
@@ -179,7 +179,7 @@
 
 void faxtester_set_non_ecm_image_buffer(faxtester_state_t *s, const uint8_t *buf, int len);
 
-void faxtester_set_ecm_image_buffer(faxtester_state_t *s, const uint8_t *buf, int len, int frame_size, int crc_hit);
+void faxtester_set_ecm_image_buffer(faxtester_state_t *s, const uint8_t *buf, int len, int block, int frame_size, int crc_hit);
 
 /*! Initialise a FAX context.
     \brief Initialise a FAX context.

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	Tue Sep 30 23:54:17 2008
@@ -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.62 2008/08/29 09:28:13 steveu Exp $
+ * $Id: t31_tests.c,v 1.63 2008/09/13 14:32:53 steveu Exp $
  */
 
 /*! \file */
@@ -35,6 +35,10 @@
 #include "config.h"
 #endif
 
+#if defined(HAVE_FL_FL_H)  &&  defined(HAVE_FL_FL_CARTESIAN_H)  &&  defined(HAVE_FL_FL_AUDIO_METER_H)
+#define ENABLE_GUI
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <fcntl.h>

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	Tue Sep 30 23:54:17 2008
@@ -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.23 2008/09/10 16:55:15 steveu Exp $
+ * $Id: tsb85_tests.c,v 1.24 2008/09/12 14:41:55 steveu Exp $
  */
 
 /*! \file */
@@ -84,6 +84,8 @@
 uint8_t awaited[1000];
 int awaited_len = 0;
 
+char image_path[1024];
+
 t30_exchanged_info_t expected_rx_info;
 
 char next_tx_file[1000];
@@ -629,15 +631,18 @@
     xmlChar *timeout;
     xmlChar *min_bits;
     xmlChar *frame_size;
+    xmlChar *block;
     xmlChar *compression;
     uint8_t buf[1000];
     uint8_t mask[1000];
+    char path[1024];
     int i;
     int j;
     int hdlc;
     int short_train;
     int min_row_bits;
     int ecm_frame_size;
+    int ecm_block;
     int compression_type;
     int timer;
     int len;
@@ -678,6 +683,7 @@
     timeout = xmlGetProp(s->cur, (const xmlChar *) "timeout");
     min_bits = xmlGetProp(s->cur, (const xmlChar *) "min_bits");
     frame_size = xmlGetProp(s->cur, (const xmlChar *) "frame_size");
+    block = xmlGetProp(s->cur, (const xmlChar *) "block");
     compression = xmlGetProp(s->cur, (const xmlChar *) "compression");
 
     s->cur = s->cur->next;
@@ -878,7 +884,7 @@
             }
             else if (strcasecmp((const char *) tag, "TXFILE") == 0)
             {
-                strcpy(next_tx_file, (const char *) value);
+                sprintf(next_tx_file, "%s/%s", image_path, (const char *) value);
 printf("Push '%s'\n", next_tx_file);
             }
             return 0;
@@ -893,7 +899,10 @@
             /* Avoid libtiff 3.8.2 and earlier bug on complex 2D lines. */
             t30_set_rx_encoding(t30, T4_COMPRESSION_ITU_T4_1D);
             if (value)
-                t30_set_tx_file(t30, (const char *) value, -1, -1);
+            {
+                sprintf(path, "%s/%s", image_path, (const char *) value);
+                t30_set_tx_file(t30, path, -1, -1);
+            }
             return 0;
         }
         else if (strcasecmp((const char *) type, "ANSWER") == 0)
@@ -905,7 +914,10 @@
             /* Avoid libtiff 3.8.2 and earlier bug on complex 2D lines. */
             t30_set_rx_encoding(t30, T4_COMPRESSION_ITU_T4_1D);
             if (value)
-                t30_set_tx_file(t30, (const char *) value, -1, -1);
+            {
+                sprintf(path, "%s/%s", image_path, (const char *) value);
+                t30_set_tx_file(t30, path, -1, -1);
+            }
             return 0;
         }
         else if (strcasecmp((const char *) type, "CNG") == 0)
@@ -966,11 +978,9 @@
         else if (strcasecmp((const char *) type, "MSG") == 0)
         {
             /* A non-ECM page */
-            if (min_bits)
-                min_row_bits = atoi((const char *) min_bits);
-            else
-                min_row_bits = 0;
-            if (t4_tx_init(&t4_state, (const char *) value, -1, -1) == NULL)
+            min_row_bits = (min_bits)  ?  atoi((const char *) min_bits)  :  0;
+            sprintf(path, "%s/%s", image_path, (const char *) value);
+            if (t4_tx_init(&t4_state, path, -1, -1) == NULL)
             {
                 span_log(&s->logging, SPAN_LOG_FLOW, "Failed to init T.4 send\n");
                 exit(2);
@@ -1003,22 +1013,12 @@
         }
         else if (strcasecmp((const char *) type, "PP") == 0)
         {
-            if (min_bits)
-                min_row_bits = atoi((const char *) min_bits);
-            else
-                min_row_bits = 0;
-            /*endif*/
-            if (frame_size)
-                ecm_frame_size = atoi((const char *) frame_size);
-            else
-                ecm_frame_size = 64;
-            /*endif*/
-            if (crc_error)
-                i = atoi((const char *) crc_error);
-            else
-                i = -1;
-            /*endif*/
-            if (t4_tx_init(&t4_state, (const char *) value, -1, -1) == NULL)
+            min_row_bits = (min_bits)  ?  atoi((const char *) min_bits)  :  0;
+            ecm_block = (block)  ?  atoi((const char *) block)  :  0;
+            ecm_frame_size = (frame_size)  ?  atoi((const char *) frame_size)  :  64;
+            i = (crc_error)  ?  atoi((const char *) crc_error)  :  -1;
+            sprintf(path, "%s/%s", image_path, (const char *) value);
+            if (t4_tx_init(&t4_state, path, -1, -1) == NULL)
             {
                 span_log(&s->logging, SPAN_LOG_FLOW, "Failed to init T.4 send\n");
                 exit(2);
@@ -1049,7 +1049,7 @@
             /*endif*/
             t4_tx_end(&t4_state);
             span_log(&s->logging, SPAN_LOG_FLOW, "ECM image is %d bytes\n", len);
-            faxtester_set_ecm_image_buffer(s, image, len, ecm_frame_size, i);
+            faxtester_set_ecm_image_buffer(s, image, len, ecm_block, ecm_frame_size, i);
         }
         else
         {
@@ -1149,6 +1149,36 @@
 }
 /*- End of function --------------------------------------------------------*/
 
+static int parse_config(faxtester_state_t *s, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur)
+{
+    xmlChar *x;
+    xmlChar *y;
+
+    while (cur)
+    {
+        if (xmlStrcmp(cur->name, (const xmlChar *) "path") == 0)
+        {
+            if ((x = xmlGetProp(cur, (const xmlChar *) "type"))
+                &&
+                (y = xmlGetProp(cur, (const xmlChar *) "value")))
+            {
+                if (strcasecmp((const char *) x, "IMAGE") == 0)
+                {
+                    span_log(&s->logging, SPAN_LOG_FLOW, "Found '%s' '%s'\n", (char *) x, (char *) y);
+                    strcpy(image_path, (const char *) y);
+                }
+                /*endif*/
+            }
+            /*endif*/
+        }
+        /*endif*/
+        cur = cur->next;
+    }
+    /*endwhile*/
+    return -1;
+}
+/*- End of function --------------------------------------------------------*/
+
 static int parse_test_group(faxtester_state_t *s, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, const char *test)
 {
     xmlChar *x;
@@ -1225,6 +1255,11 @@
     /*endif*/
     while (cur)
     {
+        if (xmlStrcmp(cur->name, (const xmlChar *) "config") == 0)
+        {
+            parse_config(s, doc, ns, cur->xmlChildrenNode);
+        }
+        /*endif*/
         if (xmlStrcmp(cur->name, (const xmlChar *) "test-group") == 0)
         {
             if (parse_test_group(s, doc, ns, cur->xmlChildrenNode, test) == 0)
@@ -1254,6 +1289,7 @@
     if (argc > 1)
         test_name = argv[1];
 
+    strcpy(image_path, ".");
     faxtester_init(&state, TRUE);
     memset(&expected_rx_info, 0, sizeof(expected_rx_info));
     span_log_set_level(&state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW);



More information about the Freeswitch-svn mailing list