@@ -0,0 +1,2054 @@
+# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.%0A# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.%0A#%0A# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.%0A#%0A# SIPPY is free software; you can redistribute it and/or modify%0A# it under the terms of the GNU General Public License as published by%0A# the Free Software Foundation; either version 2 of the License, or%0A# (at your option) any later version.%0A#%0A# For a license to use the SIPPY software under conditions%0A# other than those described here, or to purchase support for this%0A# software, please contact Sippy Software, Inc. by e-mail at the%0A# following addresses: sales@sippysoft.com.%0A#%0A# SIPPY is distributed in the hope that it will be useful,%0A# but WITHOUT ANY WARRANTY; without even the implied warranty of%0A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A# GNU General Public License for more details.%0A#%0A# You should have received a copy of the GNU General Public License%0A# along with this program; if not, write to the Free Software%0A# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.%0A%0Afrom SQLTransactionManager import SQLTransactionManager%0Afrom time import time%0A%0Aclass IVoiSysAuthorisation(object):%0A    def __init__(self, global_config):%0A        dsn = 'mysql://sbcfront:gb19!lDLn2#)F$NFbd2*@sbcdb1.pennytel.com/sbc'%0A        self.sql_tm = SQLTransactionManager(dsn, nworkers = 4, lazy_connect = True)%0A%0A    def do_auth(self, username, res_cb, *cb_args):%0A        self.sql_tm.sendQuery(('SELECT password, outbound_proxy, domain FROM SBC_Reg_Config ' %5C%0A          'WHERE account_number = %5C'%25s%5C'' %25 username), self._process_result, 0, False, None,%0A          res_cb, cb_args)%0A%0A    def _process_result(self, results, exceptions, res_cb, cb_args):%0A        print results, exceptions%0A        if exceptions%5B0%5D != None or len(results%5B0%5D) == 0:%0A            res_cb(None, *cb_args)%0A        else:%0A            password, outbound_proxy, domain = results%5B0%5D%5B0%5D%0A            res_cb((password, (outbound_proxy, 5060), domain), *cb_args)%0A

Add class specific for IVoiSys to do DB auth.