]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fixed issue handling modem renegotiation when a T.30 CTC message is received.
authorSteve Underwood <steveu@x240.coppice.org>
Mon, 23 Jun 2014 00:51:41 +0000 (08:51 +0800)
committerSteve Underwood <steveu@x240.coppice.org>
Mon, 23 Jun 2014 00:51:41 +0000 (08:51 +0800)
 Please enter the commit message for your changes. Lines starting

libs/spandsp/spandsp/fax-tests.xml
libs/spandsp/src/t30.c
libs/spandsp/tests/tsb85_extra_tests.sh

index 87574175cd92f18d80117b95c719aaf337d2b433..fcb3b6be5fa56b6d0c3147a7d608756e5bad6457 100644 (file)
         <step dir="R" type="CLEAR" timein="800" timeout="1200"/>
         <step type="STATUS" value="OK"/>
     </test>
+    <test name="Modem-change-at-CTC">
+        <!-- Similar test to TSB85/OREN03, but there is a modem change at the CTC -->
+        <!-- Tester calls DUT and sends 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 type="WAIT" value="75"/>
+        <step dir="T" type="PREAMBLE" modem="V.21"/>
+        <step dir="T" type="HDLC" tag="DCS" value="FF C8 41 00 60 1F 20"/>
+        <step dir="T" type="POSTAMBLE"/>
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="TCF" modem="V.29/9600" value="1800"/>
+
+        <step dir="R" type="HDLC" modem="V.21" tag="CFR" value="FF C8 21"/>
+
+        <step type="WAIT" value="75"/>
+        <step dir="T" type="PREAMBLE" modem="V.29/9600"/>
+        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif" frame_size="64" 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 00 00 10"/>
+        <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="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.29/9600"/>
+        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif" frame_size="64" 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 00 00 10"/>
+        <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="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.29/9600"/>
+        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif" frame_size="64" 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 00 00 10"/>
+        <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="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.29/9600"/>
+        <step dir="T" type="PP" value="etsi_300_242_a4_stairstep.tif" frame_size="64" 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 00 00 10"/>
+        <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="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.21"/>
+        <step dir="T" type="HDLC" tag="CTC + V.27ter/4800" value="FF C8 48 00 10"/>
+        <step dir="T" type="POSTAMBLE"/>
+
+        <step dir="R" type="HDLC" modem="V.21" tag="CTR" value="FF C8 23"/>
+        <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" frame_size="64"/>
+        <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 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 dir="R" type="SILENCE"/>
+
+        <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"/>
+
+        <step dir="T" type="CLEAR"/>
+        <step dir="R" type="CLEAR" timein="0" timeout="100"/>
+        <step type="STATUS" value="OK"/>
+    </test>
 </test-group>
 </fax-tests>
index 996d9cfbcad8dcd5b1213701c4b3585f6e8dc2a3..539e760e27712a74ad946b340fe0056627f2cf97 100644 (file)
@@ -3865,8 +3865,14 @@ static void process_state_f_doc_and_post_doc_ecm(t30_state_t *s, const uint8_t *
         process_rx_pps(s, msg, len);
         break;
     case T30_CTC:
+        if ((msg[4] & (DISBIT6 | DISBIT5 | DISBIT4 | DISBIT3)) != fallback_sequence[s->current_fallback].dcs_code)
+        {
+            span_log(&s->logging, SPAN_LOG_FLOW, "Modem changed in CTC.\n");
+            if ((s->current_fallback = find_fallback_entry(msg[4] & (DISBIT6 | DISBIT5 | DISBIT4 | DISBIT3))) < 0)
+                span_log(&s->logging, SPAN_LOG_FLOW, "Remote asked for a modem standard we do not support\n");
+        }
         s->image_carrier_attempted = false;
-        /* T.30 says we change back to long training here */
+        /* T.30 says we change back to long training here, whether or not the far end changed the modem type. */
         s->short_train = false;
         queue_phase(s, T30_PHASE_D_TX);
         set_state(s, T30_STATE_F_DOC_ECM);
index 08d8336eee357cbb7a7435ba628e1a2cb35ba129..7b6a52d46f56508a0c8f208e935d930184949d8f 100755 (executable)
@@ -28,7 +28,7 @@ run_tsb85_test()
     fi
 }
 
-for TEST in PPS-MPS-lost-PPS V17-12000-V29-9600 Phase-D-collision
+for TEST in PPS-MPS-lost-PPS V17-12000-V29-9600 Phase-D-collision Modem-change-at-CTC
 do
     run_tsb85_test
 done