]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODAPP-395
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 2 Mar 2010 17:45:19 +0000 (17:45 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 2 Mar 2010 17:45:19 +0000 (17:45 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16864 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c
src/switch_ivr.c

index 1a6d7c45bfb6fd22219ca6d917f4114cbc00c5de..06e6c4bb7abdf384fa5129313796808e7c813849 100644 (file)
@@ -5136,7 +5136,7 @@ void sofia_handle_sip_i_refer(nua_t *nua, sofia_profile_t *profile, nua_handle_t
                                                        sofia_clear_flag_locked(b_tech_pvt, TFLAG_SIP_HOLD);
                                                        switch_channel_clear_flag(channel_b, CF_LEG_HOLDING);
                                                        sofia_clear_flag_locked(tech_pvt, TFLAG_HOLD_LOCK);
-                                                       switch_channel_set_variable(channel_b, "park_timeout", "2");
+                                                       switch_channel_set_variable(channel_b, "park_timeout", "2:attended_transfer");
                                                        switch_channel_set_state(channel_b, CS_PARK);
 
                                                } else {
index 3d21777ef8d049683ec5c2f2d3cb75203badd080..addcac373f4a9078929f7e3de28c6740d5cc26bc 100644 (file)
@@ -689,6 +689,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
        int timeout = 0;
        time_t expires = 0;
        switch_codec_implementation_t read_impl = { 0 };
+       switch_call_cause_t timeout_cause = SWITCH_CAUSE_NORMAL_CLEARING;
 
 
        if (switch_channel_test_flag(channel, CF_CONTROLLED)) {
@@ -701,6 +702,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
        }
 
        if ((to = switch_channel_get_variable(channel, "park_timeout"))) {
+               char *cause_str;
+
+               if ((cause_str = strstr(to, ':'))) {
+                       timeout_cause = switch_channel_str2cause(cause_str + 1);
+               }
+               
                if ((timeout = atoi(to)) < 0) {
                        timeout = 0;
                } else {
@@ -737,7 +744,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session,
                        break;
                } else {
                        if (expires && switch_epoch_time_now(NULL) >= expires) {
-                               switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
+                               switch_channel_hangup(channel, timeout_cause);
                                break;
                        }