From: Anthony Minessale Date: Wed, 19 Oct 2011 12:47:37 +0000 (-0500) Subject: FS-3619 --resolve approach 1 X-Git-Tag: v1.2-rc1~27^2~327 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90a6e78d15aca4964fc78954976c2a27924ddea2;p=thirdparty%2Ffreeswitch.git FS-3619 --resolve approach 1 --- diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c index 23cb9031bf..499b16e0d3 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c @@ -2018,17 +2018,22 @@ switch_status_t spandsp_fax_stop_detect_session(switch_core_session_t *session) } switch_status_t spandsp_fax_detect_session(switch_core_session_t *session, - const char *flags, time_t timeout, + const char *flags, int timeout, int hits, const char *app, const char *data, switch_tone_detect_callback_t callback) { switch_channel_t *channel = switch_core_session_get_channel(session); switch_status_t status; + time_t to = 0; spandsp_fax_tone_container_t *cont = switch_channel_get_private(channel, "_fax_tone_detect_"); switch_media_bug_flag_t bflags = 0; const char *var; switch_codec_implementation_t read_impl = { 0 }; switch_core_session_get_read_impl(session, &read_impl); + if (timeout) { + to = switch_epoch_time_now(NULL) + timeout; + } + if (cont) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Max Tones Reached!\n"); return SWITCH_STATUS_FALSE; @@ -2089,7 +2094,7 @@ switch_status_t spandsp_fax_detect_session(switch_core_session_t *session, if ((status = switch_core_media_bug_add(session, "fax_tone_detect", "", - tone_detect_callback, cont, timeout, bflags, &cont->bug)) != SWITCH_STATUS_SUCCESS) { + tone_detect_callback, cont, to, bflags, &cont->bug)) != SWITCH_STATUS_SUCCESS) { cont->bug_running = 0; return status; }