summaryrefslogtreecommitdiff
path: root/misc/mon_ami/mon_ami_main.py
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-05-13 12:17:44 +0200
committerspag <spag@golwen.net>2013-05-13 12:17:44 +0200
commit6a1961283914a6b87400bf0b7b492fa9f8692c03 (patch)
tree4a12b4b48ddbb50e104d12eda063ef3a92ec8e3d /misc/mon_ami/mon_ami_main.py
parentf5e9590b7ed69ba5d029d5d8724b7690316df9c9 (diff)
use mysql library
Diffstat (limited to 'misc/mon_ami/mon_ami_main.py')
-rw-r--r--misc/mon_ami/mon_ami_main.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/misc/mon_ami/mon_ami_main.py b/misc/mon_ami/mon_ami_main.py
index 72220e5..fe43618 100644
--- a/misc/mon_ami/mon_ami_main.py
+++ b/misc/mon_ami/mon_ami_main.py
@@ -9,7 +9,7 @@ from signal import signal, SIGHUP, SIGTERM, SIGINT
from optparse import OptionParser
from freeswitch import FreeswitchEventSocket
from mon_ami_server import MonAMIServer
-from sqliter import SQLiteR
+from mysqlr import MySQLR
def signal_handler(signal_number, frame):
global event_socket
@@ -40,7 +40,7 @@ def user_password_authentication(user_name, password):
return True
return False
- db = SQLiteR(configuration_options.user_db_name)
+ db = MySQLR(configuration_options.user_db_name, configuration_options.user_db_user, configuration_options.user_db_password)
if not db.connect():
lerror('cound not connect to user database "%s"' % configuration_options.user_db_name)
return False
@@ -53,6 +53,7 @@ def user_password_authentication(user_name, password):
return True
linfo('user-password authentication failed - user: %s, password: %s' % (user_name, '*' * len(str(password))))
+
return False
def main():
@@ -76,7 +77,9 @@ def main():
option_parser.add_option("-p", "--port", "--ami-port", action="store", type="int", dest="ami_port", default=5038)
# User database
- option_parser.add_option("--user-db-name", action="store", type="string", dest="user_db_name", default='/opt/GS5/db/development.sqlite3')
+ option_parser.add_option("--user-db-name", action="store", type="string", dest="user_db_name", default='gemeinschaft')
+ option_parser.add_option("--user-db-user", action="store", type="string", dest="user_db_user", default='gemeinschaft')
+ option_parser.add_option("--user-db-password", action="store", type="string", dest="user_db_password", default='gemeinschaft')
option_parser.add_option("--user-db-table", action="store", type="string", dest="user_db_table", default='sip_accounts')
option_parser.add_option("--user-db-name-row", action="store", type="string", dest="user_db_name_row", default='auth_name')
option_parser.add_option("--user-db-password-row", action="store", type="string", dest="user_db_password_row", default='password')