From: Anthony Minessale Date: Tue, 2 Mar 2010 17:45:19 +0000 (+0000) Subject: MODAPP-395 X-Git-Tag: v1.0.6~276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8e1221e006e2a7d993b4f8a889531a0e3b0ef58;p=thirdparty%2Ffreeswitch.git MODAPP-395 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16864 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 1a6d7c45bf..06e6c4bb7a 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -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 { diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 3d21777ef8..addcac373f 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -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; }