ODBC配置星号

时间:2016-01-22 09:42:39

标签: odbc asterisk freetds

我已经配置了我的ODBC:

cat /etc/odbcinst.ini :
[FreeTDS]
Description = FreeTDS ODBC driver for MSSQL
Driver = /usr/lib/libtdsodbc.so
Setup = /usr/lib64/libtdsS.so
FileUsage = 1 

cat /etc/odbc.ini
[MSSQL]
description = Asterisk ODBC for MSSQL
driver = FreeTDS
server = 192.168.0.206
port = 49187
username = sa
password = password
database = aster
tds_version = 7.0
language = us_english

cat /etc/asterisk/res_odbc.conf :
[MSSQL]
enabled => yes
dsn => MSSQL
share_connections => no
limit => 5
username => sa
password => password
pre-connect => yes`


cat /etc/asterisk/cdr_odbc.conf :

[global]
dsn=MSSQL
username=sa
password=password
loguniqueid=yes

cat /usr/local/etc/freetds.conf :
[MSSQLcon]
host = 192.168.0.206
port = 49187
tds version = 7.0
#user = sa
#password = password
client charset = UTF-8

我可以通过freetds连接:     #tsql -S MSSQLcon -U sa 和星号也发送cdr-s到mssql服务器,但我不能这样连接:     #tsql -S MSSQL -U sa (来自odbc)

odbcinst -j
unixODBC 2.3.4
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /etc/odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
Segmentation fault (core dumped)

*CLI> odbc show all

ODBC DSN Settings 
 -----------------
Name:   MSSQL
DSN:    MSSQL
Last connection attempt: 2016-01-22 13:02:34
Pooled: Yes
Limit:  5
Connections in use: 0

它也连接起来:     isql -v MSSQL sa密码

1 个答案:

答案 0 :(得分:0)

此错误来自freetds.conf文件配置

TDS正在从/root/.freetds.conf中读取配置,而不是从/usr/local/etc/freetds.conf中读取

当我配置/root/.freetds.conf时,我连接到SQL

感谢收看:))