]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10675: [mod_fifo] Wrap Up + fifo_caller_exit_key in mod_fifo #resolve
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 18 Sep 2017 22:23:45 +0000 (17:23 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 18 Sep 2017 22:23:45 +0000 (17:23 -0500)
src/mod/applications/mod_fifo/mod_fifo.c

index 2b00f0d7d391300e59a3c7db0452f32463f3f75a..2820eab07056e8ff459f375cb81a735c153c095b 100644 (file)
@@ -3575,36 +3575,37 @@ SWITCH_STANDARD_APP(fifo_function)
 
                                if (fifo_consumer_wrapup_time) {
                                        wrapup_time_started = switch_micro_time_now();
-                               }
 
-                               if (!zstr(fifo_consumer_wrapup_key) && strcmp(buf, fifo_consumer_wrapup_key)) {
-                                       while (switch_channel_ready(channel)) {
-                                               char terminator = 0;
+                                       if (!zstr(fifo_consumer_wrapup_key) && strcmp(buf, fifo_consumer_wrapup_key)) {
+                                               while (switch_channel_ready(channel)) {
+                                                       char terminator = 0;
+
+                                                       if (fifo_consumer_wrapup_time) {
+                                                               wrapup_time_elapsed = (switch_micro_time_now() - wrapup_time_started) / 1000;
+                                                               if (wrapup_time_elapsed > fifo_consumer_wrapup_time) {
+                                                                       break;
+                                                               } else {
+                                                                       wrapup_time_remaining = fifo_consumer_wrapup_time - wrapup_time_elapsed + 100;
+                                                               }
+                                                       }
 
-                                               if (fifo_consumer_wrapup_time) {
+                                                       switch_ivr_collect_digits_count(session, buf, sizeof(buf) - 1, 1, fifo_consumer_wrapup_key, &terminator, 0, 0,
+                                                                                                                       (uint32_t) wrapup_time_remaining);
+                                                       if ((terminator == *fifo_consumer_wrapup_key) || !(switch_channel_ready(channel))) {
+                                                               break;
+                                                       }
+                                               }
+                                       } else if ((zstr(fifo_consumer_wrapup_key) || !strcmp(buf, fifo_consumer_wrapup_key))) {
+                                               while (switch_channel_ready(channel)) {
                                                        wrapup_time_elapsed = (switch_micro_time_now() - wrapup_time_started) / 1000;
                                                        if (wrapup_time_elapsed > fifo_consumer_wrapup_time) {
                                                                break;
-                                                       } else {
-                                                               wrapup_time_remaining = fifo_consumer_wrapup_time - wrapup_time_elapsed + 100;
                                                        }
+                                                       switch_yield(500);
                                                }
-
-                                               switch_ivr_collect_digits_count(session, buf, sizeof(buf) - 1, 1, fifo_consumer_wrapup_key, &terminator, 0, 0,
-                                                                                                               (uint32_t) wrapup_time_remaining);
-                                               if ((terminator == *fifo_consumer_wrapup_key) || !(switch_channel_ready(channel))) {
-                                                       break;
-                                               }
-                                       }
-                               } else if (fifo_consumer_wrapup_time && (zstr(fifo_consumer_wrapup_key) || !strcmp(buf, fifo_consumer_wrapup_key))) {
-                                       while (switch_channel_ready(channel)) {
-                                               wrapup_time_elapsed = (switch_micro_time_now() - wrapup_time_started) / 1000;
-                                               if (wrapup_time_elapsed > fifo_consumer_wrapup_time) {
-                                                       break;
-                                               }
-                                               switch_yield(500);
                                        }
                                }
+
                                switch_channel_set_variable(channel, "fifo_status", "WAITING");
                        }