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 {
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)) {
}
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 {
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;
}