mod_spandsp_fax_process_fax(session, data, FUNCTION_RX);
}
+SWITCH_STANDARD_APP(spanfax_stop_function)
+{
+ mod_spandsp_fax_stop_fax(session);
+}
+
SWITCH_STANDARD_APP(dtmf_session_function)
{
spandsp_inband_dtmf_session(session);
SAF_SUPPORT_NOMEDIA | SAF_NO_LOOPBACK);
SWITCH_ADD_APP(app_interface, "txfax", "FAX Transmit Application", "FAX Transmit Application", spanfax_tx_function, SPANFAX_TX_USAGE,
SAF_SUPPORT_NOMEDIA | SAF_NO_LOOPBACK);
+ SWITCH_ADD_APP(app_interface, "stopfax", "Stop FAX Application", "Stop FAX Application", spanfax_stop_function, "", SAF_NONE);
SWITCH_ADD_APP(app_interface, "spandsp_stop_dtmf", "stop inband dtmf", "Stop detecting inband dtmf.", stop_dtmf_session_function, "", SAF_NONE);
SWITCH_ADD_APP(app_interface, "spandsp_start_dtmf", "Detect dtmf", "Detect inband dtmf on the session", dtmf_session_function, "", SAF_MEDIA_TAP);
void mod_spandsp_fax_event_handler(switch_event_t *event);
void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *data, mod_spandsp_fax_application_mode_t app_mode);
+void mod_spandsp_fax_stop_fax(switch_core_session_t *session);
switch_bool_t t38_gateway_start(switch_core_session_t *session, const char *app, const char *data);
switch_status_t spandsp_stop_inband_dtmf_session(switch_core_session_t *session);
return pvt;
}
+void mod_spandsp_fax_stop_fax(switch_core_session_t *session)
+{
+ pvt_t *pvt = switch_channel_get_private(switch_core_session_get_channel(session), "_fax_pvt");
+ if (pvt) {
+ pvt->done = 1;
+ }
+}
+
void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *data, mod_spandsp_fax_application_mode_t app_mode)
{
pvt_t *pvt;
pvt = pvt_init(session, app_mode);
-
+ switch_channel_set_private(channel, "_fax_pvt", pvt);
buf = switch_core_session_alloc(session, SWITCH_RECOMMENDED_BUFFER_SIZE);
int tx = 0;
switch_status_t status;
+ switch_ivr_parse_all_events(session);
+
/*
if we are in T.38 mode, we should: 1- initialize the ptv->t38_state stuff, if not done
and then set some callbacks when reading frames.