switch_media_bug_flag_t bflags = 0;
const char *var;
switch_codec_implementation_t read_impl = { 0 };
+ switch_bool_t set_private = SWITCH_TRUE;
+
switch_core_session_get_read_impl(session, &read_impl);
if (timeout) {
}
if (cont) {
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Max Tones Reached!\n");
- return SWITCH_STATUS_FALSE;
+ //switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Max Tones Reached!\n");
+ set_private = SWITCH_FALSE;
+ cont = NULL;
}
if (!cont && !(cont = switch_core_session_alloc(session, sizeof(*cont)))) {
cont->bug_running = 0;
return status;
}
-
- switch_channel_set_private(channel, "_fax_tone_detect_", cont);
+
+ if (set_private)
+ switch_channel_set_private(channel, "_fax_tone_detect_", cont);
return SWITCH_STATUS_SUCCESS;
}
if (term->type == MG_TERM_TDM) {
switch_core_session_execute_application_async(session, "spandsp_start_fax_detect", "mg_notify cng 120 cng");
+ switch_core_session_execute_application_async(session, "spandsp_start_fax_detect", "mg_notify ced 120 ced");
}
}
switch_status_t mg_send_t38_cng_notify(megaco_profile_t* mg_profile, const char* term_name);
+switch_status_t mg_send_t38_ans_notify(megaco_profile_t* mg_profile, const char* term_name);
+switch_status_t mg_send_t38_v21flag_notify(megaco_profile_t* mg_profile, const char* term_name);
switch_status_t sng_mgco_cfg(megaco_profile_t* profile);
if (!strcmp(data, "cng")) {
mg_send_t38_cng_notify(term->profile, term->name);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sent CNG notify\n");
- switch_channel_set_variable(channel, "mg_cng_detected", "true");
+ } else if (!strcmp(data, "ced")) {
+ mg_send_t38_ans_notify(term->profile, term->name);
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sent CED notify\n");
}
}