From: Anthony Minessale Date: Fri, 4 Feb 2011 02:12:36 +0000 (-0600) Subject: dont run execute_on_fsk when there was no data collected X-Git-Tag: v1.2-rc1~187^2~13^2~3^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdf678e401a8077aab06b9c04004c92ef6631e26;p=thirdparty%2Ffreeswitch.git dont run execute_on_fsk when there was no data collected --- diff --git a/src/mod/applications/mod_fsk/mod_fsk.c b/src/mod/applications/mod_fsk/mod_fsk.c index 9802353075..0291707c62 100644 --- a/src/mod/applications/mod_fsk/mod_fsk.c +++ b/src/mod/applications/mod_fsk/mod_fsk.c @@ -220,6 +220,7 @@ static switch_bool_t fsk_detect_callback(switch_media_bug_t *bug, void *user_dat char *sp; switch_event_t *event; const char *app_var; + int total = 0; switch_event_create_plain(&event, SWITCH_EVENT_CHANNEL_DATA); @@ -255,6 +256,7 @@ static switch_bool_t fsk_detect_callback(switch_media_bug_t *bug, void *user_dat } if (varname && val) { + total++; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_DEBUG, "%s setting FSK var [%s][%s]\n", switch_channel_get_name(channel), varname, val); switch_channel_set_variable(channel, varname, val); @@ -270,7 +272,7 @@ static switch_bool_t fsk_detect_callback(switch_media_bug_t *bug, void *user_dat } } - if ((app_var = switch_channel_get_variable(channel, "execute_on_fsk"))) { + if (total && (app_var = switch_channel_get_variable(channel, "execute_on_fsk"))) { char *app_arg; switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(pvt->session), SWITCH_LOG_DEBUG, "%s processing execute_on_fsk [%s]\n",