From 82eb176f6fc091835afeaf99d367d95e37a05c34 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 26 Mar 2009 16:06:25 +0000 Subject: [PATCH] MODENDP-207 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12792 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_sofia/sofia_presence.c | 3 ++- src/mod/endpoints/mod_sofia/sofia_reg.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 2d8579a087..645e82db2c 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -210,7 +210,8 @@ void sofia_presence_cancel(void) if ((sql = switch_mprintf( "select proto,sip_user,sip_host,sub_to_user,sub_to_host,event,contact,call_id,full_from," "full_via,expires,user_agent,accept,profile_name" - ",-1,'unavailable','unavailable' from sip_subscriptions where event='presence'"))) { + ",-1,'unavailable','unavailable' from sip_subscriptions where event='presence' and hostname='%q'", + mod_sofia_globals.hostname))) { switch_mutex_lock(mod_sofia_globals.hash_mutex); for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) { switch_hash_this(hi, NULL, NULL, &val); diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index a166c58c1f..1e3fb0422d 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -597,8 +597,11 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot) if (now) { - switch_snprintf(sql, sizeof(sql), "select call_id,sip_user,sip_host,contact,status,rpid,expires,user_agent,server_user,server_host,profile_name" - " from sip_registrations where status like '%%AUTO-NAT%%' or status like '%%UDP-NAT%%'"); + switch_snprintf(sql, sizeof(sql), "select call_id,sip_user,sip_host,contact,status,rpid," + "expires,user_agent,server_user,server_host,profile_name" + " from sip_registrations where (status like '%%AUTO-NAT%%' " + "or status like '%%UDP-NAT%%') and hostname='%s'", mod_sofia_globals.hostname); + sofia_glue_execute_sql_callback(profile, SWITCH_TRUE, NULL, sql, sofia_reg_nat_callback, profile); }