Убрать не могу т.к. редактор этого не видитVlad1983 писал(а):и что за левые символы в начале файла?\357\273\277[MySQL-asteriskcdrdb]
Убрать не могу т.к. редактор этого не видитVlad1983 писал(а):и что за левые символы в начале файла?\357\273\277[MySQL-asteriskcdrdb]
Код: Выделить всё
root@VOIP-SRV:~# cat /etc/odbc.ini
[MySQL-asteriskcdrdb]
Description = MySQL connection to 'asterisk' database
Driver = MySQL
Database = asteriskcdrdb
Server = localhost
UserName = asteriskuser
Password = amp109
Port = 3306
[test]
Driver = MySQL
SERVER = localhost
PORT = 3306
DATABASE = asteriskcdrdb
USER = asteriskuser
PASSWORD = amp109
Socket = /var/run/mysqld/mysqld.sockroot@VOIP-SRV:~# cat /etc/odbc.ini
[MySQL-asteriskcdrdb]
Description = MySQL connection to 'asterisk' database
Driver = MySQL
Database = asteriskcdrdb
Server = localhost
UserName = asteriskuser
Password = amp109
Port = 3306
[test]
Driver = MySQL
SERVER = localhost
PORT = 3306
DATABASE = asteriskcdrdb
USER = asteriskuser
PASSWORD = amp109
Socket = /var/run/mysqld/mysqld.sockroot@VOIP-SRV:~# isql test -v
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
Код: Выделить всё
root@asterisk:/etc/asterisk# iusql asterisk
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
Код: Выделить всё
root@asterisk:/etc# cat odbc.ini
[ODBC Data Sources]
asterisk = MySQL
[asterisk]
Driver = /usr/lib/libmyodbc5w.so
Server = localhost
Socket = /var/run/mysqld/mysql.sock
Database = asterisk
User = root
Код: Выделить всё
asterisk*CLI> module reload cdr_adaptive_odbc.so
-- Reloading module 'cdr_adaptive_odbc.so' (Adaptive ODBC CDR backend)
== Parsing '/etc/asterisk/cdr_adaptive_odbc.conf': == Found
[Feb 10 09:51:55] NOTICE[10683]: res_odbc.c:1531 odbc_obj_connect: Connecting MySQL
[Feb 10 09:51:55] WARNING[10683]: res_odbc.c:1556 odbc_obj_connect: res_odbc: Error SQLConnect=-1 errno=2002
[Feb 10 09:51:55] WARNING[10683]: res_odbc.c:1371 _ast_odbc_request_obj2: Failed to connect to MySQL
[Feb 10 09:51:55] WARNING[10683]: cdr_adaptive_odbc.c:123 load_config: No such connection 'MySQL' in the 'cdr_adaptive_connection' section of cdr_adaptive_odbc.conf. Check res_odbc.conf.
asterisk*CLI>
Код: Выделить всё
root@asterisk:/etc/asterisk# cat cdr_adaptive_odbc.conf
[cdr_adaptive_connection]
connection=MySQL
table=cdr
alias start=>calldate
Код: Выделить всё
root@asterisk:/etc/asterisk# cat res_odbc.conf
[MySQL]
enabled => yes
dsn => asterisk
username => root
pre-connect => yes