我遇到了一个小问题。我使用的是Debian,我得到了星号1.8,我想把CDR和mysql一起使用。在Asterisk 1.8中,您显然必须使用cdr自适应模块,而不是常规模块。我就是这么做的。现在,当我"模块重新加载cdr_adaptive_odbc.so"时,我有一个错误,我无法解决:
WARNING[23172]: cdr_adaptive_odbc.c:123 load_config: No such connection 'MySQL-asterisk' in the 'adaptive-connection' section of cdr_adaptive_odbc.conf. Check res_odbc.conf.
现在这里是所有相关的文件,我不明白哪里出了问题:
/etc/odbc.ini:
[MySQL]
Description = MySQL ODBC MyODBC Driver
Driver = /usr/lib/libmyodbc3.so
FileUsage = 1
[Text]
Description = ODBC for Text Files
Driver = /usr/lib/libodbctxt.so
Setup = /usr/lib/libodbctxtS.so
FileUsage = 1
CPTimeout =
CPReuse =
[PostgreSQL]
Description = PostgreSQL driver for Linux & Win32
Driver = /usr/lib/libodbcpsql.so
Setup = /usr/lib/libodbcpsqlS.so
FileUsage = 1
[DB2]
Description = DB2 Driver
Driver = /opt/IBM/db2/V8.1/lib64/libdb2.so
FileUsage = 1
DontDLClose = 1
DMEnvAttr = SQL_ATTR_UNIXODBC_ENVATTR={DB2INSTANCE=db2inst1}
[MySQL-asterisk]
Description = MySQL asterisk database
Driver = MySQL
Socket = /var/run/mysqld/mysqld.sock
Server = localhost
User = root
Password = XXXXX
Database = ics
Option = 3
/etc/aster/cdr_adaptive_obc.conf:
[adaptive-connection]
connection = MySQL-asterisk
table = cdr
alias start => calldate
/etc/aster/res_odbc.conf:
[Asterisk]
enabled => yes
dsn => MySQL-asterisk
username => root
password => XXX
;pooling => no
;limit => 0
pre-connect => yes
这是我检查cdd状态时得到的:
Call Detail Record (CDR) settings
----------------------------------
Logging: Enabled
Mode: Simple
Log unanswered calls: No
* Registered Backends
-------------------
Adaptive ODBC
cdr-custom
ODBC
csv
radius
res_config_sqlite
这就是我检查de odcb 时得到的结果
ODBC DSN Settings
-----------------
Name: Asterisk
DSN: MySQL-asterisk
我搞不清楚出了什么问题。有人有主意吗?
我想您现在已经解决了这个问题。我遇到了类似的问题,问题源于文档。它引用cdr_adaptive_odbc.conf中的connection=
作为DSN名称。这是您想要的名称,而不是DSN。所以在你的情况下:
connection = Asterisk
然后在命令行进行
CLI> module reload cdr_adaptive_odbc.so
当Asterisk查找表并执行您指定的任何映射时,您应该会看到一个完整的屏幕。