add last_bridge_to var to keep uuid of last bridged channel and fix race in show calls on hangup of bypass_media channels

This commit is contained in:
Anthony Minessale committed 2010-08-20 13:53:08 -05:00
1 parent 3867828816
commit 77e2dccf72
3 files changed
+20 -2

No files matched your search

+13 -2
View File
@@ -1052,8 +1052,19 @@ static void core_event_handler(switch_event_t *event)
}
break;
case SWITCH_EVENT_CHANNEL_DESTROY:
new_sql() = switch_mprintf("delete from channels where uuid='%q' and hostname='%q'",
switch_event_get_header_nil(event, "unique-id"), switch_core_get_variable("hostname"));
{
const char *uuid = switch_event_get_header(event, "unique-id");
const char *sig = switch_event_get_header(event, "signal_bridge");
if (uuid) {
new_sql() = switch_mprintf("delete from channels where uuid='%q' and hostname='%q'",
uuid, switch_core_get_variable("hostname"));
if (switch_true(sig)) {
new_sql() = switch_mprintf("delete from calls where caller_uuid='%q' and hostname='%q'",
uuid, switch_core_get_variable("hostname"));
}
}
}
break;
case SWITCH_EVENT_CHANNEL_UUID:
{