private_object_t *tech_pvt;
switch_core_session_t *bargee_session;
switch_channel_t *channel = switch_core_session_get_channel(session);
+
if (zstr(data)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Usage: <uuid>\n");
return;
}
+
+ switch_channel_answer(channel);
if ((bargee_session = switch_core_session_locate((char *)data))) {
if (bargee_session == session) {
}
if (!zstr(bridge_uuid) && switch_channel_test_flag(b_channel, CF_LEG_HOLDING)) {
+ const char *b_call_id = switch_channel_get_variable(b_channel, "sip_call_id");
+
+ if (b_call_id) {
+ char *sql = switch_mprintf("update sip_dialogs set call_info_state='idle' where call_id='%q'", b_call_id);
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "SQL: %s\n", sql);
+ sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
+
+ switch_channel_presence(b_channel, "unknown", "idle", NULL);
+
+ }
+
tech_pvt->caller_profile->destination_number = switch_core_sprintf(tech_pvt->caller_profile->pool,
"%sanswer,intercept:%s", codec_str, bridge_uuid);
} else {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
- if (!switch_channel_up_nosig(channel)) {
+ if (!strcasecmp(status, "idle") || !switch_channel_up_nosig(channel)) {
call_info_state = "idle";
} else if (!strcasecmp(status, "hold-private")) {
call_info_state = "held-private";