]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Tweaks to spandsp tests
authorSteve Underwood <steveu@coppice.org>
Mon, 13 Apr 2015 19:25:17 +0000 (03:25 +0800)
committerSteve Underwood <steveu@coppice.org>
Mon, 13 Apr 2015 19:25:17 +0000 (03:25 +0800)
15 files changed:
libs/spandsp/spandsp/fax-tests.dtd
libs/spandsp/spandsp/fax-tests.xml
libs/spandsp/spandsp/tsb85.xml
libs/spandsp/tests/ademco_contactid_tests.c
libs/spandsp/tests/awgn_tests.c
libs/spandsp/tests/fax_decode.c
libs/spandsp/tests/fax_tester.c
libs/spandsp/tests/g726_tests.c
libs/spandsp/tests/oki_adpcm_tests.c
libs/spandsp/tests/t42_tests.c
libs/spandsp/tests/t43_tests.c
libs/spandsp/tests/time_scale_tests.c
libs/spandsp/tests/tsb85_extra_tests.sh
libs/spandsp/tests/tsb85_tests.c
libs/spandsp/tests/tsb85_tests.sh

index 39f97febaaf0e1386ab182f187fa20073fe80dcb..8299ecbb3409d5db229574fae78d44e511386a29 100644 (file)
   name      CDATA   #IMPLIED
   >
 
-<!ELEMENT test (step|possible-step)* >
+<!ELEMENT test (repeat|step)* >
 <!ATTLIST test
   name      CDATA   #IMPLIED
   >
 
-<!ELEMENT possible-step (step)* >
+<!ELEMENT repeat (step)* >
+<!ATTLIST repeat
+  min       CDATA   #IMPLIED
+  max       CDATA   #IMPLIED
+  >
 
 <!ELEMENT step (check|EMPTY)* >
 <!ATTLIST step
@@ -49,5 +53,6 @@
 <!ATTLIST check
   name      CDATA   #IMPLIED
   desc      CDATA   #IMPLIED
+  cond      CDATA   #IMPLIED
   >
 
index fcb3b6be5fa56b6d0c3147a7d608756e5bad6457..9a514640883bf78a5df67a88e0d47c445c9ea0b4 100644 (file)
         <step dir="T" type="HDLC" tag="PPS-MPS" value="FF C8 7D 72 00 80 08"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 80 00 10"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="CED"/>
         <step type="WAIT" value="75"/>
+
         <step dir="T" type="PREAMBLE" modem="V.21"/>
         <step dir="T" type="HDLC" tag="DIS" value="FF C8 01 00 50 00"/>
         <step dir="T" type="POSTAMBLE"/>
         <step dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 10"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 10"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 10"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 10"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="DCN" value="FF C8 5F"/>
         <step dir="T" type="POSTAMBLE"/>
 
+        <step dir="T" type="CLEAR"/>
+        <step dir="R" type="CLEAR" timein="0" timeout="100"/>
+        <step type="STATUS" value="OK"/>
+    </test>
+    <test name="ECM-DCN-clipped">
+        <!-- Tester calls DUT and sends one 31k byte STAIRSTEP page and one 15k byte STAIRSTEP page. -->
+        <step type="CALL"/>
+
+        <!--<step dir="T" type="CNG"/>-->
+
+        <step dir="R" type="CED"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="DIS" value="FF C8 01 ..." timeout="60000"/>
+        <step dir="R" type="SILENCE"/>
+
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="PREAMBLE" modem="V.21"/>
+        <step dir="T" type="HDLC" tag="DCS" value="FF C8 41 00 50 1F 30"/>
+        <step dir="T" type="POSTAMBLE"/>
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="TCF" modem="V.27ter/4800" value="900"/>
+
+        <step dir="R" type="HDLC" modem="V.21" tag="CFR" value="FF C8 21"/>
+        <step dir="R" type="SILENCE"/>
+
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="PREAMBLE" modem="V.27ter/4800"/>
+        <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 08"/>
+        <step dir="T" type="POSTAMBLE"/>
+
+        <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
+        <step dir="R" type="SILENCE"/>
+
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="PREAMBLE" modem="V.27ter/4800"/>
+        <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 00 80 08"/>
+        <step dir="T" type="POSTAMBLE"/>
+
+        <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
+        <step dir="R" type="SILENCE"/>
+
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="PREAMBLE" modem="V.21"/>
+
+        <repeat min="2" max="2">
+            <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
+            <step dir="R" type="SILENCE"/>
+        </repeat>
+
+        <step dir="T" type="CLEAR"/>
+        <step dir="R" type="CLEAR" timein="0" timeout="100"/>
+        <step type="STATUS" value="OK"/>
+    </test>
+    <test name="Non-ECM-DCN-clipped">
+        <!-- Tester calls DUT and sends 2 WHITE pages. DUT should send CSI for this test procedure. -->
+        <step type="CALL"/>
+        <step dir="T" type="SET" tag="IDENT" value="+0123456789"/>
+
+        <!--<step dir="T" type="CNG"/>-->
+
+        <step dir="R" type="CED"/>
+        <step dir="R" type="HDLC" modem="V.21" tag="DIS" value="FF C8 01 ..." timeout="60000"/>
+        <step dir="R" type="SILENCE"/>
+
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="PREAMBLE" modem="V.21"/>
+        <step dir="T" type="HDLC" tag="DCS" value="FF C8 41 00 50 00"/>
+        <step dir="T" type="POSTAMBLE"/>
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="TCF" modem="V.27ter/4800" value="900"/>
+
+        <step dir="R" type="HDLC" modem="V.21" tag="CFR" value="FF C8 21"/>
+        <step dir="R" type="SILENCE"/>
+
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="MSG" modem="V.27ter/4800" value="etsi_300_242_a4_white.tif"/>
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="PREAMBLE" modem="V.21"/>
+        <step dir="T" type="HDLC" tag="EOP" value="FF C8 72"/>
+        <step dir="T" type="POSTAMBLE"/>
+
+        <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
+        <step dir="R" type="SILENCE"/>
+
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="PREAMBLE" modem="V.21"/>
+
+        <repeat min="2" max="2">
+            <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
+            <step dir="R" type="SILENCE"/>
+        </repeat>
+
         <step dir="T" type="CLEAR"/>
         <step dir="R" type="CLEAR" timein="0" timeout="100"/>
         <step type="STATUS" value="OK"/>
index a7111009168caa5da3e79fdf0b036f1ef565653b..c72a8631515fce50fb098a613e7c3ddb16e296ed 100644 (file)
@@ -26,7 +26,7 @@
         <!--<step dir="T" type="CNG"/>-->
 
         <step dir="R" type="CED">
-            <check name="MRGN01M01" desc="receipt of CED"/>
+            <check name="MRGN01M01" desc="receipt of CED" cond="Confirm receipt of CED. FAIL otherwise"/>
             <check name="MRGN01M02" desc="CED is 2.6s to 4s"/>
         </step>
         <step dir="R" type="HDLC" modem="V.21" tag="NSF" value="FF C0 04 ..." timeout="60000">
 
         <step type="WAIT" value="75"/>
         <step dir="T" type="MSG" modem="V.27ter/4800" value="etsi_300_242_a4_duration1.tif">
-            <check name="MRGN02M01" desc="Accept 4.9s long scan line"/>
+            <check name="MRGN03M01" desc="Accept 4.9s long scan line"/>
         </step>
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
 
         <step type="WAIT" value="75"/>
         <step dir="T" type="MSG" modem="V.27ter/4800" value="etsi_300_242_a4_duration2.tif">
-            <check name="MRGN02M02" desc="Reject 5.1s long scan line"/>
+            <check name="MRGN03M02" desc="Reject 5.1s long scan line"/>
         </step>
         <step type="WAIT" value="75"/>
         <step dir="T" type="PREAMBLE" modem="V.21"/>
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF or RTP" value="FF C8 31" xxx="FF C8 33">
-            <check name="MRGN02M01" desc="Accept 4.9% of scan lines in error"/>
+            <check name="MRGN04M01" desc="Accept 4.9% of scan lines in error"/>
         </step>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="RTN" value="FF C8 32">
-            <check name="MRGN02M01" desc="Reject 15.1% of scan lines in error"/>
+            <check name="MRGN04M02" desc="Reject 15.1% of scan lines in error"/>
         </step>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="TCF" modem="V.27ter/2400" value="450"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="FTT" value="FF C8 22">
-            <check name="MRGN07M01" desc="FTT returned for corrupted TCF pattern"/>
-            <check name="MRGN07M02" desc="FTT preamble between 850ms and 1150ms"/>
-            <check name="MRGN07M03" desc="FTT is 0xFF, 0xC8, FCF with MSB of zero, and no FIF bytes"/>
+            <check name="MRGN08M01" desc="FTT returned for corrupted TCF pattern"/>
+            <check name="MRGN08M02" desc="FTT preamble between 850ms and 1150ms"/>
+            <check name="MRGN08M03" desc="FTT is 0xFF, 0xC8, FCF with MSB of zero, and no FIF bytes"/>
         </step>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="TCF" modem="V.27ter/4800" value="900"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="CFR" value="FF C8 21">
-            <check name="MRGN07M04" desc="Accept TCF"/>
+            <check name="MRGN08M04" desc="Accept TCF"/>
         </step>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="HDLC" tag="PPS-MPS" value="FF C8 7D 72 00 80 08"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-MPS" value="FF C8 7D 72 80 00 08"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-MPS" value="FF C8 7D 72 80 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
 
         <step dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 10"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 10"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 10"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 10"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 00 FF"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 80 DC"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 07 ff ff ff ff"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 80 DC"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 07 ff ff ff ff"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 80 DC"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 07 ff ff ff ff"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-NULL" value="FF C8 7D 00 00 80 DC"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 07 ff ff ff ff"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-MPS" value="FF C8 7D 72 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-MPS" value="FF C8 7D 72 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-MPS" value="FF C8 7D 72 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-MPS" value="FF C8 7D 72 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <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 dir="T" type="HDLC" tag="PPS-MPS" value="FF C8 7D 72 00 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="PPS-EOP" value="FF C8 7D 74 80 00 6B"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <possible-step>
+        <repeat min="0">
             <step dir="R" type="HDLC" modem="V.21" tag="RNR" value="FF C8 37"/>
             <step dir="R" type="SILENCE"/>
 
             <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>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="MCF" value="FF C8 31"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
         <step dir="T" type="POSTAMBLE"/>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
+        <repeat min="23" max="30">
+            <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
 
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
-
-        <step dir="R" type="HDLC" modem="V.21" tag="RR+" value="FF C8 F6"/>
-
-        <step type="WAIT" value="500"/>
-        <step dir="T" type="PREAMBLE" modem="V.21"/>
-        <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
-        <step dir="T" type="POSTAMBLE"/>
+            <step type="WAIT" value="500"/>
+            <step dir="T" type="PREAMBLE" modem="V.21"/>
+            <step dir="T" type="HDLC" tag="RNR" value="FF C8 37"/>
+            <step dir="T" type="POSTAMBLE"/>
+        </repeat>
 
         <step dir="R" type="HDLC" modem="V.21" tag="DCN+" value="FF C8 DF"/>
 
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="MSG" modem="V.27ter/4800" value="etsi_300_242_a4_white.tif" timeout="60000">
-            <check name="MRGP01M10" desc="Polled, MSG1"/>
+            <check name="MRGP01M10" desc="Polled, transmit MSG1"/>
         </step>
         <step dir="R" type="HDLC" modem="V.21" tag="MPS" value="FF C8 72">
-            <check name="MRGP01M11" desc="Polled, MPS"/>
-            <check name="MRGP01M12" desc="Polled, MPS preamble"/>
-            <check name="MRGP01M13" desc="Polled, MPS framing"/>
+            <check name="MRGP01M11" desc="Polled, transmit MPS"/>
+            <check name="MRGP01M12" desc="Polled, MPS preamble" cond="Confirm MPS preamble length is not less than 850ms, and not more than 1150ms. WARNING otherwise."/>
+            <check name="MRGP01M13" desc="Polled, MPS framing" cond="Confirm MPS has HDLC address FF hex, HDLC control C8 hex, FCF MSB of zero, no FIF bytes and a valid FCS. FAIL otherwise."/>
         </step>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="MSG" modem="V.27ter/4800" timeout="60000">
-            <check name="MRGP01M14" desc="Polled, MSG1"/>
+            <check name="MRGP01M14" desc="Polled, transmit MSG2" cond="Confirm receipt of MSG2. FAIL otherwise."/>
         </step>
         <step dir="R" type="HDLC" modem="V.21" tag="EOP" value="FF C8 74">
-            <check name="MRGP01M15" desc="Polled, EOP"/>
-            <check name="MRGP01M16" desc="Polled, EOP preamble"/>
-            <check name="MRGP01M17" desc="Polled, EOP framing"/>
+            <check name="MRGP01M15" desc="Polled, EOP" cond="Confirm receipt of EOP. FAIL otherwise."/>
+            <check name="MRGP01M16" desc="Polled, EOP preamble" cond="Confirm EOP preamble length is not less than 850ms, and not more than 1150ms. WARNING otherwise."/>
+            <check name="MRGP01M17" desc="Polled, EOP framing" cond="Confirm EOP has HDLC address FF hex, HDLC control C8 hex, FCF MSB of zero, no FIF bytes and a valid FCS. FAIL otherwise."/>
         </step>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="DCN" value="FF C8 5F">
-            <check name="MRGP01M18" desc="Polled, DCN"/>
-            <check name="MRGP01M19" desc="Polled, DCN preamble"/>
-            <check name="MRGP01M20" desc="Polled, DCN framing"/>
-            <check name="MRGP01M21" desc="Polled, disconnect after DCN"/>
+            <check name="MRGP01M18" desc="Polled, DCN" cond="Confirm receipt of DCN. FAIL otherwise."/>
+            <check name="MRGP01M19" desc="Polled, DCN preamble" cond="Confirm DCN preamble length is not less than 850ms, and not more than 1150ms. WARNING otherwise."/>
+            <check name="MRGP01M20" desc="Polled, DCN framing" cond="Confirm DCN has HDLC address FF hex, HDLC control C8 hex, FCF MSB of zero, no FIF bytes and a valid FCS. FAIL otherwise."/>
+            <check name="MRGP01M21" desc="Polled, disconnect after DCN" cond="Confirm DUT disconnects. FAIL otherwise."/>
         </step>
         <step dir="R" type="SILENCE"/>
 
 
         <step dir="R" type="CED"/>
         <step dir="R" type="HDLC" modem="V.21" tag="DIS" value="FF C8 01 ..." timeout="60000">
-            <check name="MRGP02M01" desc="DIS exhibits T.4 transmitter ability with password"/>
+            <check name="MRGP02M01" desc="DIS exhibits T.4 transmitter ability with password" cond="Confirm DIS FIF bit 9 T.4 transmitter is 1. Confirm DIS FIF bit 50 is 1. Confirm DIS extend bits are set correctly. FAIL otherwise."/>
         </step>
         <step dir="R" type="SILENCE"/>
 
 
         <step dir="R" type="HDLC" modem="V.21" tag="TSI" value="FF C0 42 ..."/>
         <step dir="R" type="HDLC" tag="DCS" value="FF C8 41 ...">
-            <check name="MRGP02M02" desc="Polled, DUT accepts tester's password"/>
+            <check name="MRGP02M02" desc="Polled, DUT accepts tester's password" cond="Confirm outcome per execution sequence. FAIL otherwise."/>
         </step>
         <step dir="R" type="SILENCE"/>
         <step dir="R" type="TCF" modem="V.27ter/4800"/>
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="DCN" value="FF C8 5F">
-            <check name="MRGP03M01" desc="Polled, DUT rejects tester's password"/>
+            <check name="MRGP03M01" desc="Polled, DUT rejects tester's password" cond="Confirm outcome per execution sequence. FAIL otherwise."/>
         </step>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="DCN" value="FF C8 5F">
-            <check name="MRGP04M01" desc="Polled, DUT rejects DTC for lack of password"/>
+            <check name="MRGP04M01" desc="Polled, DUT rejects DTC for lack of password" cond="Confirm outcome per execution sequence. FAIL otherwise."/>
         </step>
         <step dir="R" type="SILENCE"/>
 
 
         <step dir="R" type="CED"/>
         <step dir="R" type="HDLC" modem="V.21" tag="DIS" value="FF C8 01 ..." timeout="60000">
-            <check name="MRGP05M01" desc="DIS not exhibit T.4 transmit capability"/>
+            <check name="MRGP05M01" desc="DIS not exhibit T.4 transmit capability" cond="Confirm DIS FI bit 9, T.4 transmitter is 0. FAIL otherwise."/>
         </step>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="DCN" value="FF C8 5F">
-            <check name="MRGP05M02" desc="Polled, DUT rejects DTC for no document available"/>
+            <check name="MRGP05M02" desc="Polled, DUT rejects DTC for no document available" cond="Confirm outcome per execution sequence. FAIL otherwise."/>
         </step>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="DCS+" value="FF C8 C1 ...">
-            <check name="MRGP06M01" desc="Polled, DUT accepts DIS in place of DTC"/>
+            <check name="MRGP06M01" desc="Polled, DUT accepts DIS in place of DTC" cond="Confirm outcome per execution sequence. FAIL otherwise."/>
         </step>
         <step dir="R" type="TCF" modem="V.27ter/4800" timeout="60000"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="DCN+" value="FF C8 DF">
-            <check name="MRGP07M01" desc="Polled, DUT rejects DIS in place of DTC for lackof password"/>
+            <check name="MRGP07M01" desc="Polled, DUT rejects DIS in place of DTC for lack of password" cond="Confirm outcome per execution sequence. FAIL otherwise."/>
         </step>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="DCN+" value="FF C8 DF">
-            <check name="MRGP08M01" desc="Polled, DUT rejects DIS in place of DTC for no document available"/>
+            <check name="MRGP08M01" desc="Polled, DUT rejects DIS in place of DTC for no document available" cond="Confirm outcome per execution sequence. FAIL otherwise."/>
         </step>
         <step dir="R" type="SILENCE"/>
 
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="DCS" value="FF C8 41 ...">
-            <check name="ORGP09M01" desc="Reception followed by invited polling transmission"/>
+            <check name="ORGP09M01" desc="Reception followed by invited polling transmission" cond="Confirm outcome per execution sequence. FAIL otherwise."/>
         </step>
         <step dir="R" type="TCF" modem="V.17/14400"/>
         <step dir="R" type="SILENCE"/>
         <step dir="T" type="POSTAMBLE"/>
 
         <step dir="R" type="HDLC" modem="V.21" tag="DCS" value="FF C8 41 ...">
-            <check name="ORGP10M01" desc="Reception followed by immediate polling transmission"/>
+            <check name="ORGP10M01" desc="Reception followed by immediate polling transmission" cond="Confirm outcome per execution sequence. FAIL otherwise."/>
         </step>
         <step dir="R" type="TCF" modem="V.17/14400"/>
         <step dir="R" type="SILENCE"/>
index b1c9c4f42d71ab1baf84f249cba4748abc7320eb..4071999d035931a1bff181f84af6985f85f5e247 100644 (file)
@@ -149,7 +149,7 @@ static void rx_callback(void *user_data, const ademco_contactid_report_t *report
     printf("    Event %X\n", report->xyz);
     printf("    Group/partition %X\n", report->gg);
     printf("    User/Zone information %X\n", report->ccc);
-    if (memcmp(&reports[reports_entry], report, sizeof (*report)))
+    if (memcmp(&reports[reports_entry], report, sizeof(*report)))
     {
         printf("Report mismatch\n");
         exit(2);
index c105a9b243a809823fc30b6d414d9938f9cbbc29..09e7884e3347b79cec53779a07eaa5eee83d8b76 100644 (file)
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
         total = 0.0;
         if ((noise_source = awgn_init_dbm0(NULL, idum, (float) j)) == NULL)
         {
-            printf("Failed to allocation AWGN source\n");
+            printf("Failed to allocate AWGN source\n");
             exit(2);
         }
         total_samples = 1000000;
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
     clip_low = 0;
     if ((noise_source = awgn_init_dbm0(NULL, idum, -15.0)) == NULL)
     {
-        printf("Failed to allocation AWGN source\n");
+        printf("Failed to allocate AWGN source\n");
         exit(2);
     }
     total_samples = 10000000;
index 7b624bd6f82ddac7f4cb655d0bce46615db6eb65..e67d32a120255b4aab954114ccdb074cb572c161 100644 (file)
@@ -232,7 +232,11 @@ static int check_rx_dcs(const uint8_t *msg, int len)
     image_width = widths[(dcs_frame[8] & DISBIT3)  ?  2  :  1][dcs_frame[5] & (DISBIT2 | DISBIT1)];
 
     /* Check which compression we will use. */
-    if ((dcs_frame[6] & DISBIT7))
+    if ((dcs_frame[12] & DISBIT7))
+        line_encoding = T4_COMPRESSION_T85_L0;
+    else if ((dcs_frame[12] & DISBIT6))
+        line_encoding = T4_COMPRESSION_T85;
+    else if ((dcs_frame[6] & DISBIT7))
         line_encoding = T4_COMPRESSION_T6;
     else if ((dcs_frame[4] & DISBIT8))
         line_encoding = T4_COMPRESSION_T4_2D;
index 4cd85d68a76be2c550172c97e41c9b65d8552aae..fb5dcc1ac1f0e986a6d7efe996b60a39ceb4e954 100644 (file)
@@ -33,6 +33,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <ctype.h>
 #if defined(HAVE_TGMATH_H)
 #include <tgmath.h>
 #endif
 
 #include "spandsp.h"
 
+#include "fax_utils.h"
 #include "fax_tester.h"
 
 #define HDLC_FRAMING_OK_THRESHOLD       5
 
+extern const char *output_tiff_file_name;
+
+struct xml_node_parms_s
+{
+    xmlChar *dir;
+    xmlChar *type;
+    xmlChar *modem;
+    xmlChar *value;
+    xmlChar *tag;
+    xmlChar *bad_rows;
+    xmlChar *crc_error;
+    xmlChar *pattern;
+    xmlChar *timein;
+    xmlChar *timeout;
+    xmlChar *min_bits;
+    xmlChar *frame_size;
+    xmlChar *block;
+    xmlChar *compression;
+};
+
+static struct
+{
+    const char *tag;
+    int code;
+} t30_status[] =
+{
+    {"OK", T30_ERR_OK},
+    {"CEDTONE", T30_ERR_CEDTONE},
+    {"T0_EXPIRED", T30_ERR_T0_EXPIRED},
+    {"T1_EXPIRED", T30_ERR_T1_EXPIRED},
+    {"T3_EXPIRED", T30_ERR_T3_EXPIRED},
+    {"HDLC_CARRIER", T30_ERR_HDLC_CARRIER},
+    {"CANNOT_TRAIN", T30_ERR_CANNOT_TRAIN},
+    {"OPER_INT_FAIL", T30_ERR_OPER_INT_FAIL},
+    {"INCOMPATIBLE", T30_ERR_INCOMPATIBLE},
+    {"RX_INCAPABLE", T30_ERR_RX_INCAPABLE},
+    {"TX_INCAPABLE", T30_ERR_TX_INCAPABLE},
+    {"NORESSUPPORT", T30_ERR_NORESSUPPORT},
+    {"NOSIZESUPPORT", T30_ERR_NOSIZESUPPORT},
+    {"UNEXPECTED", T30_ERR_UNEXPECTED},
+    {"TX_BADDCS", T30_ERR_TX_BADDCS},
+    {"TX_BADPG", T30_ERR_TX_BADPG},
+    {"TX_ECMPHD", T30_ERR_TX_ECMPHD},
+    {"TX_GOTDCN", T30_ERR_TX_GOTDCN},
+    {"TX_INVALRSP", T30_ERR_TX_INVALRSP},
+    {"TX_NODIS", T30_ERR_TX_NODIS},
+    {"TX_PHBDEAD", T30_ERR_TX_PHBDEAD},
+    {"TX_PHDDEAD", T30_ERR_TX_PHDDEAD},
+    {"TX_T5EXP", T30_ERR_TX_T5EXP},
+    {"RX_ECMPHD", T30_ERR_RX_ECMPHD},
+    {"RX_GOTDCS", T30_ERR_RX_GOTDCS},
+    {"RX_INVALCMD", T30_ERR_RX_INVALCMD},
+    {"RX_NOCARRIER", T30_ERR_RX_NOCARRIER},
+    {"RX_NOEOL", T30_ERR_RX_NOEOL},
+    {"RX_NOFAX", T30_ERR_RX_NOFAX},
+    {"RX_T2EXPDCN", T30_ERR_RX_T2EXPDCN},
+    {"RX_T2EXPD", T30_ERR_RX_T2EXPD},
+    {"RX_T2EXPFAX", T30_ERR_RX_T2EXPFAX},
+    {"RX_T2EXPMPS", T30_ERR_RX_T2EXPMPS},
+    {"RX_T2EXPRR", T30_ERR_RX_T2EXPRR},
+    {"RX_T2EXP", T30_ERR_RX_T2EXP},
+    {"RX_DCNWHY", T30_ERR_RX_DCNWHY},
+    {"RX_DCNDATA", T30_ERR_RX_DCNDATA},
+    {"RX_DCNFAX", T30_ERR_RX_DCNFAX},
+    {"RX_DCNPHD", T30_ERR_RX_DCNPHD},
+    {"RX_DCNRRD", T30_ERR_RX_DCNRRD},
+    {"RX_DCNNORTN", T30_ERR_RX_DCNNORTN},
+    {"FILEERROR", T30_ERR_FILEERROR},
+    {"NOPAGE", T30_ERR_NOPAGE},
+    {"BADTIFF", T30_ERR_BADTIFF},
+    {"BADPAGE", T30_ERR_BADPAGE},
+    {"BADTAG", T30_ERR_BADTAG},
+    {"BADTIFFHDR", T30_ERR_BADTIFFHDR},
+    {"NOMEM", T30_ERR_NOMEM},
+    {"RETRYDCN", T30_ERR_RETRYDCN},
+    {"CALLDROPPED", T30_ERR_CALLDROPPED},
+    {"NOPOLL", T30_ERR_NOPOLL},
+    {"IDENT_UNACCEPTABLE", T30_ERR_IDENT_UNACCEPTABLE},
+    {"SUB_UNACCEPTABLE", T30_ERR_SUB_UNACCEPTABLE},
+    {"SEP_UNACCEPTABLE", T30_ERR_SEP_UNACCEPTABLE},
+    {"PSA_UNACCEPTABLE", T30_ERR_PSA_UNACCEPTABLE},
+    {"SID_UNACCEPTABLE", T30_ERR_SID_UNACCEPTABLE},
+    {"PWD_UNACCEPTABLE", T30_ERR_PWD_UNACCEPTABLE},
+    {"TSA_UNACCEPTABLE", T30_ERR_TSA_UNACCEPTABLE},
+    {"IRA_UNACCEPTABLE", T30_ERR_IRA_UNACCEPTABLE},
+    {"CIA_UNACCEPTABLE", T30_ERR_CIA_UNACCEPTABLE},
+    {"ISP_UNACCEPTABLE", T30_ERR_ISP_UNACCEPTABLE},
+    {"CSA_UNACCEPTABLE", T30_ERR_CSA_UNACCEPTABLE},
+    {NULL, -1}
+};
+
 static void timer_update(faxtester_state_t *s, int len)
 {
     s->timer += len;
index 75d1a542cde0c0a8ff8e989ce385486fabddfa3a..45f64c228a02801fbac495af10f7e1452fe1b6a1 100644 (file)
@@ -90,7 +90,7 @@ uint8_t unpacked[MAX_TEST_VECTOR_LEN];
 uint8_t xlaw[MAX_TEST_VECTOR_LEN];
 
 /*
-Table 4 - Reset and homing sequences for u-law
+Table 4 - Reset and homing sequences for u-law
             Normal                              I-input     Overload
 Algorithm   Input   Intermediate    Output      Input       Output      Input   Intermediate    Output
             (PCM)   (ADPCM)         (PCM)       (ADPCM)     (PCM)       (PCM)   (ADPCM)         (PCM)
@@ -108,7 +108,7 @@ Algorithm   Input   Intermediate    Output      Input       Output      Input
                     HN40FM.I        HN40FM.O                HI40FM.O            HV40FM.I        HV40FM.O
 
 
-Table 5 - Reset and homing sequences for A-law
+Table 5 - Reset and homing sequences for A-law
             Normal                              I-input     Overload
 Algorithm   Input   Intermediate    Output      Input       Output      Input   Intermediate    Output
             (PCM)   (ADPCM)         (PCM)       (ADPCM)     (PCM)       (PCM)   (ADPCM)         (PCM)
index 84604b69beaa88b0690e61ad6f4467328e146703..a9eef7e1aee995c428ad22f0280fb4fa5a012a8a 100644 (file)
@@ -275,7 +275,6 @@ int main(int argc, char *argv[])
             }
         }
 
-
         oki_adpcm_free(oki_enc_state);
         if (sf_close_telephony(inhandle))
         {
index d9f80da5b586899c0a287d6f9635495653862c88..fd42133dfd9c232d14eecbca7f1c62adb07127a6 100644 (file)
@@ -43,7 +43,7 @@
 
 #include "spandsp.h"
 
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
 #include <tif_dir.h>
 #endif
 
@@ -157,7 +157,7 @@ int main(int argc, char *argv[])
     logging = span_log_init(NULL, SPAN_LOG_FLOW, "T.42");
 #endif
 
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
     TIFF_FX_init();
 #endif
 
index 3df17ea7f26307120d654e1f3758faf16ac8f6c3..dff6bc1978e9fde05aad5bdedf50b4cb2055d9af 100644 (file)
@@ -43,7 +43,7 @@
 
 #include "spandsp.h"
 
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
 #include <tif_dir.h>
 #endif
 
@@ -63,7 +63,7 @@ typedef struct
     int ptr;
 } packer_t;
 
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
 /* TIFF-FX related extensions to the tag set supported by libtiff */
 static const TIFFFieldInfo tiff_fx_tiff_field_info[] =
 {
@@ -184,7 +184,7 @@ int write_file(meta_t *meta, int page, const uint8_t buf[])
     uint8_t *out_buf;
     uint8_t *out_buf2;
     packer_t packer;
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
     toff_t diroff;
 #endif
 
@@ -222,7 +222,7 @@ int write_file(meta_t *meta, int page, const uint8_t buf[])
     TIFFSetField(tif, TIFFTAG_MAKE, "soft-switch.org");
     TIFFSetField(tif, TIFFTAG_MODEL, "spandsp");
     TIFFSetField(tif, TIFFTAG_HOSTCOMPUTER, "i7.coppice.org");
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
     /* Make space for this to be filled in later */
     TIFFSetField(tif, TIFFTAG_GLOBALPARAMETERSIFD, 0);
 #endif
@@ -310,7 +310,7 @@ int write_file(meta_t *meta, int page, const uint8_t buf[])
     if (!TIFFWriteDirectory(tif))
         printf("Failed to write directory.\n");
 
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
     if (!TIFFCreateCustomDirectory(tif, &tiff_fx_field_array))
     {
         TIFFSetField(tif, TIFFTAG_PROFILETYPE, PROFILETYPE_G3_FAX);
@@ -337,7 +337,7 @@ int write_file(meta_t *meta, int page, const uint8_t buf[])
 
 int read_file(meta_t *meta, int page)
 {
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
     static const char *tiff_fx_fax_profiles[] =
     {
         "???",
@@ -419,7 +419,7 @@ int read_file(meta_t *meta, int page)
         meta->bmax = 0.0f;
         break;
     }
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
     if (TIFFGetField(tif, TIFFTAG_DECODE, &parm16, &fl_parms))
     {
         meta->lmin = fl_parms[0];
@@ -432,7 +432,7 @@ int read_file(meta_t *meta, int page)
     }
 #endif
 
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
     printf("Trying to get global parameters\n");
     if (TIFFGetField(tif, TIFFTAG_GLOBALPARAMETERSIFD, &diroff))
     {
@@ -891,7 +891,7 @@ int main(int argc, char *argv[])
     meta_t meta;
     int output_compression;
     int page_no;
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
     toff_t diroff;
 #endif
 
@@ -900,7 +900,7 @@ int main(int argc, char *argv[])
     destination_file = OUT_FILE_NAME;
     output_compression = (argc > 2)  ?  atoi(argv[2]) : COMPRESSION_CCITT_T6;
 
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
     TIFF_FX_init();
 #endif
 
@@ -1305,7 +1305,7 @@ int main(int argc, char *argv[])
     TIFFSetField(tif, TIFFTAG_MAKE, "soft-switch.org");
     TIFFSetField(tif, TIFFTAG_MODEL, "spandsp");
     TIFFSetField(tif, TIFFTAG_HOSTCOMPUTER, "i7.coppice.org");
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
     /* Make space for this to be filled in later */
     TIFFSetField(tif, TIFFTAG_GLOBALPARAMETERSIFD, 0);
 #endif
@@ -1379,7 +1379,7 @@ int main(int argc, char *argv[])
     if (!TIFFWriteDirectory(tif))
         printf("Failed to write directory.\n");
 
-#if defined(SPANDSP_SUPPORT_TIFF_FX)
+#if defined(SPANDSP_SUPPORT_TIFF_FX)  &&  defined(HAVE_TIF_DIR_H)
     if (!TIFFCreateCustomDirectory(tif, &tiff_fx_field_array))
     {
         TIFFSetField(tif, TIFFTAG_PROFILETYPE, PROFILETYPE_G3_FAX);
index abd5300fdfaf242a2a2cfdeb03641cff4e84881c..4e902c2eaeb3bac286b540cea73614374e46f749 100644 (file)
@@ -65,6 +65,8 @@ int main(int argc, char *argv[])
     int out_frames;
     int count;
     int max;
+    int samples_in;
+    int samples_out;
     time_scale_state_t state;
     float rate;
     float sample_rate;
@@ -129,9 +131,19 @@ int main(int argc, char *argv[])
     max = time_scale_max_output_len(&state, BLOCK_LEN);
     printf("Rate is %f, longest output block is %d\n", rate, max);
     count = 0;
+    samples_in = 0;
+    samples_out = 0;
     while ((frames = sf_readf_short(inhandle, in, BLOCK_LEN)))
     {
+        samples_in += frames;
         new_frames = time_scale(&state, out, in, frames);
+        if (new_frames > max)
+        {
+            printf("Generated signal has more than the expected maximum samples - %d vs %d\n", new_frames, max);
+            printf("Tests failed\n");
+            exit(2);
+        }
+        samples_out += new_frames;
         out_frames = sf_writef_short(outhandle, out, new_frames);
         if (out_frames != new_frames)
         {
@@ -152,7 +164,27 @@ int main(int argc, char *argv[])
             count = 0;
         }
     }
+    new_frames = time_scale_flush(&state, out);
+    if (new_frames > max)
+    {
+        printf("Generated signal has more than the expected maximum samples - %d vs %d\n", new_frames, max);
+        printf("Tests failed\n");
+        exit(2);
+    }
+    samples_out += new_frames;
+    out_frames = sf_writef_short(outhandle, out, new_frames);
+    if (out_frames != new_frames)
+    {
+        fprintf(stderr, "    Error writing audio file\n");
+        exit(2);
+    }
     time_scale_release(&state);
+    if ((int) (rate*samples_in) < samples_out - 1  ||  (int) (rate*samples_in) > samples_out + 1)
+    {
+        printf("%d samples became %d samples\n", (int) (rate*samples_in), samples_out);
+        printf("Tests failed\n");
+        exit(2);
+    }
     if (sf_close(inhandle))
     {
         printf("    Cannot close audio file '%s'\n", in_file_name);
index 7b6a52d46f56508a0c8f208e935d930184949d8f..8e401d41ad7f52641646afb544ddc481abaaa02f 100755 (executable)
@@ -17,7 +17,7 @@
 
 run_tsb85_test()
 {
-    rm -f fax_tests_1.tif
+    rm -f tsb85_tests.tif
     echo ./tsb85_tests ${TEST}
     ./tsb85_tests -x ../spandsp/fax-tests.xml ${TEST} 2>xyzzy2
     RETVAL=$?
@@ -28,7 +28,7 @@ run_tsb85_test()
     fi
 }
 
-for TEST in PPS-MPS-lost-PPS V17-12000-V29-9600 Phase-D-collision Modem-change-at-CTC
+for TEST in PPS-MPS-lost-PPS V17-12000-V29-9600 Phase-D-collision Modem-change-at-CTC ECM-DCN-clipped Non-ECM-DCN-clipped
 do
     run_tsb85_test
 done
index 4c1559c5dc49b43702014564f8d461fa1029be9c..624dcb1f6cfa8ec3a6c4a294cc1ad4d0e2bfb2f0 100644 (file)
@@ -60,8 +60,8 @@
 #include "spandsp.h"
 #include "spandsp-sim.h"
 
-#include "fax_tester.h"
 #include "fax_utils.h"
+#include "fax_tester.h"
 
 #define OUTPUT_TIFF_FILE_NAME   "tsb85.tif"
 
index ed39b1c524e04ddbad3d7cdf7c45e9e175947cad..f20bbfaa97a325466d3127c521927530d36829dc 100755 (executable)
@@ -17,7 +17,7 @@
 
 run_tsb85_test()
 {
-    rm -f fax_tests_1.tif
+    rm -f tsb85_tests.tif
     echo ./tsb85_tests ${TEST}
     ./tsb85_tests ${TEST} 2>xyzzy2
     RETVAL=$?
@@ -33,11 +33,6 @@ do
     run_tsb85_test
 done
 
-#MRGN14 fails because we don't adequately distinguish between receiving a
-#bad image signal and receiving none at all.
-#MRGN16 fails because we don't adequately distinguish between receiving a
-#bad image signal and receiving none at all.
-
 for TEST in MRGN09 MRGN10 MRGN11 MRGN12 MRGN13 MRGN14 MRGN15 MRGN16 MRGN17
 do
     run_tsb85_test
@@ -53,10 +48,6 @@ do
     run_tsb85_test
 done
 
-# MRGX03 is failing because the V.27ter modem says it trained on HDLC
-# MRGX05 is failing because we don't distinguish MPS immediately after MCF from MPS after
-# a corrupt image signal.
-
 for TEST in MRGX01 MRGX02 MRGX03 MRGX04 MRGX05 MRGX06 MRGX07 MRGX08
 do
     run_tsb85_test