我有一个小问题。我正在使用Debian,并且得到了星号1.8,我想将CDR与mysql一起使用。
在Asterisk 1.8中,您显然必须使用cdr-adaptive模块而不是常规模块。那就是我所做的。现在,当我“模块重新加载cdr_adaptive_odbc.so”时出现1个错误,但我无法解决:
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/asterisk/cdr_adaptive_odbc.conf:
[adaptive-connection]
connection = MySQL-asterisk
table = cdr
alias start => calldate
/etc/asterisk/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
这就是我检查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查找表并执行您指定的任何映射时,您应该看到全屏显示。
关于mysql - 支持Asterisk 1.8 CDR的MySQL,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20496422/