From d18c3a8a60bac15869fcf76cb3a93c238fa7f071 Mon Sep 17 00:00:00 2001
From: Anthony Minessale <anthm@freeswitch.org>
Date: Wed, 8 Sep 2010 15:09:09 -0500
Subject: [PATCH] fix sql stmt

---
 src/mod/endpoints/mod_sofia/sofia_reg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c
index eb9b03d958..c78ed90fe3 100644
--- a/src/mod/endpoints/mod_sofia/sofia_reg.c
+++ b/src/mod/endpoints/mod_sofia/sofia_reg.c
@@ -673,8 +673,8 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot)
 	if (now && sofia_test_pflag(profile, PFLAG_NAT_OPTIONS_PING)) {
 		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);
+						" from sip_registrations where (status like '%%NAT%%' "
+						"or contact like '%%fs_nat=true%%') and hostname='%s'", mod_sofia_globals.hostname);
 
 		sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_nat_callback, profile);
 	}