From: Anthony Minessale Date: Wed, 2 Feb 2011 16:53:33 +0000 (-0600) Subject: FS-3024 X-Git-Tag: v1.2-rc1~187^2~23^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83dea0ee45a1eed53fe6c7bcac96410229c2fe3c;p=thirdparty%2Ffreeswitch.git FS-3024 --- diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index 35311c9b0f..2db2a0dd46 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -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';"