]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Some tweaks to spandsp
authorSteve Underwood <steveu@x100e.coppice.org>
Sat, 8 Sep 2012 17:08:15 +0000 (01:08 +0800)
committerSteve Underwood <steveu@x100e.coppice.org>
Sat, 8 Sep 2012 17:08:15 +0000 (01:08 +0800)
libs/spandsp/src/fax_modems.c
libs/spandsp/src/t38_gateway.c
libs/spandsp/tests/t31_tests.c
libs/spandsp/tests/t4_tests.c

index d2510a4909a822864879c60ba0243f34c2d3251a..f1658ccf56442c45b6e259c38eb95b60e3578657 100644 (file)
@@ -262,7 +262,6 @@ SPAN_DECLARE(void) fax_modems_start_slow_modem(fax_modems_state_t *s, int which)
     case FAX_MODEM_V21_RX:
         fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) hdlc_rx_put_bit, &s->hdlc_rx);
         fsk_rx_signal_cutoff(&s->v21_rx, -39.09f);
-        //fax_modems_set_rx_handler(s, (span_rx_handler_t) &fsk_rx, &s->v21_rx, (span_rx_fillin_handler_t) &fsk_rx_fillin, &s->v21_rx);
         s->rx_frame_received = FALSE;
         break;
     case FAX_MODEM_V21_TX:
index e3993609cc0c74f648d6b601efa4ba42f51ae828..3572b36c1eb7f030723d257d3e3c21e9716cefd1 100644 (file)
@@ -1977,6 +1977,7 @@ static int restart_rx_modem(t38_gateway_state_t *s)
         fax_modems_start_fast_modem(t, s->core.fast_rx_modem, s->core.fast_bit_rate, s->core.short_train, FALSE);
         s->core.fast_rx_active = s->core.fast_rx_modem;
         break;
+    case FAX_MODEM_V21_RX:
     default:
         //fax_modems_start_slow_modem(t, FAX_MODEM_V21_RX);
         fax_modems_set_rx_handler(t, (span_rx_handler_t) &fsk_rx, &t->v21_rx, (span_rx_fillin_handler_t) &fsk_rx_fillin, &t->v21_rx);
index a5a12931677bb1d6b5235bb9f6e2cb4dd3249a87..82e1597dd05b7af2e44f2f3db73d404f17e3bf84 100644 (file)
@@ -120,7 +120,7 @@ static const struct command_response_s fax_send_test_seq[] =
     //<TSI frame data>
     EXCHANGE("\xFF\x03\x43\x32\x32\x32\x32\x32\x32\x32\x32\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x10\x03", "\r\nCONNECT\r\n"),
     //<DCS frame data>
-    EXCHANGE("\xFF\x13\x83\x01\xC6\x80\x80\x80\x80\x01\xFD\x13\x10\x03", "\r\nOK\r\n"),
+    EXCHANGE("\xFF\x13\x83\x01\xC6\x80\x80\x80\x80\x01\x10\x03", "\r\nOK\r\n"),
     //Do a wait for timed silence at this point, or there won't be one in the tests
     EXCHANGE("AT+FRS=7\r", "\r\nOK\r\n"),
     //EXCHANGE("AT+FTS=8;+FTM=96\r", "\r\nCONNECT\r\n"),
index b53c8f65be2527f6ea2703dcba6ee266d15cf130..db9581aaee4851f60179ef52d87e0baf25355418 100644 (file)
@@ -484,7 +484,7 @@ int main(int argc, char *argv[])
                 }
                 end_of_page = t4_rx_put(&receive_state, block, i);
             }
-            else if (strlen(buf) > 2  &&  sscanf(buf, "T.30 Rx:  %x %x", (unsigned int *) &bit, (unsigned int *) &bit) == 2)
+            else if (strlen(buf) > 2  &&  sscanf(buf, "T.30 Rx:  %x %x %x %x", (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &pkt_no) == 4)
             {
                 /* Useful for breaking up ECM logs */
                 if (pkt_no != last_pkt_no + 1)
@@ -575,7 +575,7 @@ int main(int argc, char *argv[])
                 if (compression < 0  ||  (block_size == 0  &&  compression_step >= 3))
                     break;
             }
-            t4_tx_set_tx_encoding(&send_state, compression);
+            t4_tx_set_tx_encoding(&send_state, compression, T4_COMPRESSION_NONE);
             t4_rx_set_rx_encoding(&receive_state, compression);
 
             rows_read = 0;
@@ -716,7 +716,7 @@ int main(int argc, char *argv[])
                         compression = compression_sequence[compression_step++];
                     }
                 }
-                t4_tx_set_tx_encoding(&send_state, compression);
+                t4_tx_set_tx_encoding(&send_state, compression, T4_COMPRESSION_NONE);
                 t4_rx_set_rx_encoding(&receive_state, compression);
 
                 if (t4_tx_start_page(&send_state))