]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
group_confirm_cancel_timeout=true to stop timers once a group_confirm is triggered...
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 14 Jul 2009 17:19:14 +0000 (17:19 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 14 Jul 2009 17:19:14 +0000 (17:19 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14247 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_originate.c

index 1d31565c8fe0017e4efbcacafbb7b992dbfb5e9c..43ed9422a5b9e9a0e0caa6ca519b8ab87083cd04 100644 (file)
@@ -109,6 +109,7 @@ typedef struct {
        uint8_t ignore_ring_ready;
        int monitor_early_media_ring_count;
        int monitor_early_media_ring_total;
+       int cancel_timeout;
 } originate_global_t;
 
 
@@ -228,6 +229,10 @@ static int check_per_channel_timeouts(originate_global_t *oglobals,
        int x = 0,i;
        time_t elapsed = switch_epoch_time_now(NULL) - start;
 
+       if (oglobals->cancel_timeout > 0) {
+               return 0;
+       }
+
        for (i = 0; i < max; i++) {
                if (originate_status[i].peer_channel && originate_status[i].per_channel_delay_start && elapsed > originate_status[i].per_channel_delay_start) {
                        switch_channel_clear_flag(originate_status[i].peer_channel, CF_BLOCK_STATE);
@@ -508,6 +513,10 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat
                        if (!switch_strlen_zero(oglobals->key)) {
                                struct key_collect *collect;
 
+                               if (oglobals->cancel_timeout < 0) {
+                                       oglobals->cancel_timeout = 1;
+                               }
+
                                if ((collect = switch_core_session_alloc(originate_status[i].peer_session, sizeof(*collect)))) {
                                        switch_channel_set_flag(originate_status[i].peer_channel, CF_TAGGED);
                                        if (!switch_strlen_zero(oglobals->key)) {
@@ -1047,6 +1056,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                        ok = 1;
                                } else if (!strcasecmp((char *) hi->name, "group_confirm_file")) {
                                        ok = 1;
+                               } else if (!strcasecmp((char *) hi->name, "group_confirm_clear_timeout")) {
+                                       ok = 1;
                                } else if (!strcasecmp((char *) hi->name, "forked_dial")) {
                                        ok = 1;
                                } else if (!strcasecmp((char *) hi->name, "fail_on_single_reject")) {
@@ -1123,6 +1134,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                oglobals.early_ok = 0;
        }
 
+       if (switch_true(switch_event_get_header(var_event, "group_confirm_cancel_timeout"))) {
+               oglobals.cancel_timeout = -1;
+       }
+
        if ((var = switch_event_get_header(var_event, "group_confirm_key"))) {
                switch_copy_string(oglobals.key, var, sizeof(oglobals.key));
                if ((var = switch_event_get_header(var_event, "group_confirm_file"))) {