From f91686b2bc2770162a28995c22c7369808fffb9f Mon Sep 17 00:00:00 2001 From: paulc Date: Wed, 14 Sep 2011 12:47:43 +0000 Subject: [PATCH] Fixed sample query to log out disabled accounts. git-svn-id: http://voip.null.ro/svn/yate@4601 acf43c95-373e-0410-b603-e72c3f656dc1 --- conf.d/register.conf.sample | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/conf.d/register.conf.sample b/conf.d/register.conf.sample index d67c82b2..725a00cf 100644 --- a/conf.d/register.conf.sample +++ b/conf.d/register.conf.sample @@ -147,10 +147,14 @@ ; Queries for registering as client to other servers ; query executed only once to create client registrations at startup -;initquery=SELECT enabled,protocol,username,password,server FROM accounts WHERE enabled IS TRUE +;initquery=SELECT protocol,username,password,server FROM accounts WHERE enabled IS TRUE ; poll on timer to update registrations if database was changed externally -;timerquery=BEGIN; SELECT enabled,protocol,username,password,server FROM accounts WHERE modified IS TRUE; UPDATE accounts SET modified=FALSE; COMMIT +;timerquery=BEGIN; \ +; SELECT (CASE WHEN enabled IS FALSE THEN 'logout' ELSE 'login' END) AS operation,\ +; protocol,username,password,server FROM accounts WHERE modified IS TRUE; \ +; UPDATE accounts SET modified=FALSE; \ +; COMMIT ; update account status after receiving an user.notify ;statusquery=UPDATE accounts SET status='${status}' WHERE account='${internalaccount}'