我是Asterisk的新手,我试图将星号连接到MS SQL服务器,因为我知道Asterisk + DB会非常强大。我按照Asterisk™中的相同步骤:The Definitive Guide(Asterisk book) http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/installing_configuring_odbc.html#Database_id246915
/etc/odbcinst.ini
[FreeTDS]
Description = ODBC for MSSQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
UsageCount = 1
Fileusage = 1
Threading = 2
/etc/odbc.ini
[MSSQL]
Description = MSSQL Database
Driver = FreeTDS
Database = asterisk
Server = 192.168.14.193
Username = sa
Password = iti
Trace = no
TDS_Version = 8.0
Port = 1433
当我使用这个陈述时
echo "select 1" | isql -v MSSQL
我得到了
[s1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[s1000][unixODBC][FreeTDS][SQL Server]Login failed for user ''.
[ISQL]ERROR: Could not SQLConnect
但当我使用此echo "select 1" | isql -v MSSQL sa iti
时
它起作用了
继续教程
我重新编译了Asterisk,以便在安装unixODBC后感受到这些变化 我修改了res_odbc.conf文件
/etc/asterisk/res_odbc.conf
[asterisk]
enabled => yes
dsn => MSSQL
username => sa
password => iti
pooling => no
pre-connect => yes
我还修改了Freetds.conf
/etc/freetds/freetds.conf
[MSSQL]
Server = 192.168.14.193
TDS_Version = 8.0
Port = 1433
当我使用odbc show时我得到了这个
*CLI> odbc show
ODBC DSN Settings
-----------------
*CLI>
我在菜单选择
时检查了res_odbc,func_odbc
我正在使用我的机器上安装的MS SQL Server 2014和Ubuntu 16桌面
请帮我解决问题并提前致谢
答案 0 :(得分:0)
您在星号目录中的res_config_odbc.conf中设置了连接(这样的接缝错过了这一步)
您可以通过
进行测试def multiprocess_handler(cls):
class MultiProcessHandler(cls):
def createLock(self):
self.lock = multiprocessing.RLock()
return MultiProcessHandler
MFileHandler = multiprocess_handler(logging.FileHandler)
MRotatingFileHandler = multiprocess_handler(logging.handlers.RotatingFileHandler)
# etc.
答案 1 :(得分:0)
在odbc.ini文件中,用户名密钥应该是UID而不是用户名。
请参阅:http://www.freetds.org/userguide/odbcconnattr.htm
尝试然后验证:
echo "select 1" | isql -v MSSQL