Revision
15396
Author
anthm
Date
2009-11-07 11:59:01 -0600 (Sat, 07 Nov 2009)

Log Message

fix sql stmt for blf subs

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c (15395 => 15396)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	2009-11-06 23:29:36 UTC (rev 15395)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	2009-11-07 17:59:01 UTC (rev 15396)
@@ -1628,7 +1628,15 @@
 		switch_snprintf(exp_delta_str, sizeof(exp_delta_str), "%ld", exp_delta);
 		
 		if (sofia_test_pflag(profile, PFLAG_MULTIREG)) {
-			sql = switch_mprintf("delete from sip_subscriptions where call_id='%q' or (contact='%q' and event='%q')", call_id, contact_str, event);
+			//sql = switch_mprintf("delete from sip_subscriptions where call_id='%q' or (contact='%q' and event='%q')", call_id, contact_str, event);
+
+			sql = switch_mprintf("delete from sip_subscriptions where call_id='%q' "
+								 "or (proto='%q' and sip_user='%q' and sip_host='%q' "
+								 "and sub_to_user='%q' and sub_to_host='%q' and event='%q' and hostname='%q' "
+								 "and contact='%q')",
+								 call_id, proto, from_user, from_host, to_user, to_host, event, mod_sofia_globals.hostname,
+								 contact_str);
+
 		} else {
 			sql = switch_mprintf("delete from sip_subscriptions where "
 								 "proto='%q' and sip_user='%q' and sip_host='%q' and sub_to_user='%q' and sub_to_host='%q' and event='%q' and hostname='%q'",