This commit is contained in:
Anthony Minessale 2011-02-02 10:53:33 -06:00
parent 10d696ebac
commit 83dea0ee45
1 changed files with 7 additions and 3 deletions

View File

@ -1409,9 +1409,13 @@ static void core_event_handler(switch_event_t *event)
}
break;
case SWITCH_EVENT_CHANNEL_UNBRIDGE:
new_sql() = switch_mprintf("delete from calls where (caller_uuid='%s' or callee_uuid='%q') and hostname='%q'",
switch_event_get_header_nil(event, "caller-unique-id"), switch_core_get_variable("hostname"));
break;
{
char *uuid = switch_event_get_header_nil(event, "caller-unique-id");
new_sql() = switch_mprintf("delete from calls where (caller_uuid='%q' or callee_uuid='%q') and hostname='%q'",
uuid, uuid, switch_core_get_variable("hostname"));
break;
}
case SWITCH_EVENT_SHUTDOWN:
new_sql() = switch_mprintf("delete from channels where hostname='%q';"
"delete from interfaces where hostname='%q';"