]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSCORE-527
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 14 Jan 2010 21:31:40 +0000 (21:31 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 14 Jan 2010 21:31:40 +0000 (21:31 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16314 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_ivr_originate.c

index 80b3f313332a21735a0356b5c62084fbb7690b14..21a79f63932f2f2681f5dab59248e4dc793271af 100644 (file)
@@ -235,7 +235,8 @@ static void launch_collect_thread(struct key_collect *collect)
 static int check_per_channel_timeouts(originate_global_t *oglobals,
                                                                          originate_status_t *originate_status, 
                                                                          int max,
-                                                                         time_t start)
+                                                                         time_t start,
+                                                                         switch_call_cause_t *force_reason)
 {
        int x = 0,i,delayed_channels=0,active_channels=0;
        uint32_t early_exit_time=0, delayed_min=0;
@@ -304,6 +305,7 @@ static int check_per_channel_timeouts(originate_global_t *oglobals,
                                  )
                                ) {
                                switch_channel_hangup(originate_status[i].peer_channel, SWITCH_CAUSE_PROGRESS_TIMEOUT);
+                               *force_reason = SWITCH_CAUSE_PROGRESS_TIMEOUT;
                                x++;
                        }
                        if (originate_status[i].per_channel_timelimit_sec && elapsed > originate_status[i].per_channel_timelimit_sec) {
@@ -2444,13 +2446,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                                !oglobals.progress && (progress_timelimit_sec && elapsed > (time_t) progress_timelimit_sec)) {
                                                to++;
                                                oglobals.idx = IDX_TIMEOUT;
+                                               force_reason = SWITCH_CAUSE_PROGRESS_TIMEOUT;
                                                goto notready;
                                        }
                                        
                                        switch_cond_next();
                                }
 
-                               check_per_channel_timeouts(&oglobals, originate_status, and_argc, start);
+                               check_per_channel_timeouts(&oglobals, originate_status, and_argc, start, &force_reason);
 
 
                                if (valid_channels == 0) {
@@ -2498,7 +2501,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                        goto notready;
                                }
 
-                               check_per_channel_timeouts(&oglobals, originate_status, and_argc, start);
+                               check_per_channel_timeouts(&oglobals, originate_status, and_argc, start, &force_reason);
 
                                if (oglobals.session) {
                                        switch_ivr_parse_all_events(oglobals.session);