diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c index ffde301d57..feaf3cc820 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c @@ -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);