]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add t38_gateway_rx_fillin
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 16 Jun 2010 16:49:13 +0000 (11:49 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 16 Jun 2010 16:49:13 +0000 (11:49 -0500)
src/mod/applications/mod_spandsp/mod_spandsp_fax.c

index ffde301d57b60ca14f8e13c2ac72faac50c875c5..feaf3cc820a3274100d09bae0ed8f04ce07cac6b 100644 (file)
@@ -1160,7 +1160,6 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
             break;
         }
 
-               /* Skip CNG frames (auto-generated by FreeSWITCH, usually) */
                if (switch_test_flag(read_frame, SFF_CNG)) {
                        /* We have no real signal data for the FAX software, but we have a space in time if we have a CNG indication.
                           Do a fill-in operation in the FAX machine, to keep things rolling along. */
@@ -1572,10 +1571,11 @@ static switch_status_t t38_gateway_on_consume_media(switch_core_session_t *sessi
                        goto end_unlock;
                }
 
-
-               /* Skip CNG frames (auto-generated by FreeSWITCH, usually) */
-               if (!switch_test_flag(read_frame, SFF_CNG)) {
-
+        if (switch_test_flag(read_frame, SFF_CNG)) {
+                       /* We have no real signal data for the FAX software, but we have a space in time if we have a CNG indication.
+                          Do a fill-in operation in the FAX machine, to keep things rolling along. */
+            t38_gateway_rx_fillin(pvt->t38_gateway_state, read_impl.samples_per_packet);
+        } else {
             if (read_fd != FAX_INVALID_SOCKET) {
                 switch_ssize_t rv;
                 do { rv = write(read_fd, read_frame->data, read_frame->datalen); } while (rv == -1 && errno == EINTR);