Хранение voicemessage в MYSQL
Добавлено: 02 сен 2013, 11:34
Помогите, пожалуйста, все вроде настроено правильно, но в MYSQL записи не попадают:
ОС: FreeBSD, asterisk ставил из портов (asterisk18-1.8.23.0), также из портов поставил unixODBC
asterisk собран со следующими параметрами:
[x] CURL Data transfer support via cURL
[x] DAHDI DAHDI support
[ ] EXCHANGE Exchange calendar support
[x] FREETDS FreeTDS library support
[x] GSM GSM codec support
[x] H323 H.323 support
[ ] JABBER Jabber support
[ ] LDAP LDAP support
[x] LUA Lua scripting language support
[x] MYSQL MySQL database support
[x] NEWG711 New G711 Codec
[x] OOH323 ooh323 support
[ ] PGSQL PostgreSQL database support
[ ] RADIUS RADIUS protocol support
[x] SNMP SNMP protocol support
[x] SPANDSP Spandsp faxing support
[ ] SQLITE SQLite database support
[ ] SRTP SecureRTP support
[x] VORBIS Ogg Vorbis audio codec support
[ ] IODBC ODBC backend via iODBC
[x] UNIXODBC ODBC backend via unixODBC
Конфиги:
res_odbc.conf:
[asterisk]
enabled => yes
dsn => mysql_asterisk
username => user
password => ***
pre-connect => yes
voicemail.conf:
[general]
format=wav49
odbcstorage=mysql_asterisk
odbctable=voicemessages
odbc.ini:
[mysql_asterisk]
Driver = /usr/local/lib/libmyodbc5.so
Description = Connector/ODBC Driver DSN
ServerName = localhost
Port = 3306
UserName = user
Password = ***
Database = asterisk
Option = 3
odbcinst.ini:
[MySQL_ODBC]
Description = MySQL ODBC MyODBC Driver
Driver = /usr/local/lib/libmyodbc5.so
Setup = /usr/local/lib/libodbc.so
FileUsage = 1
Таблица в Базе:
-- ----------------------------
-- Table structure for voicemessages
-- ----------------------------
DROP TABLE IF EXISTS `voicemessages`;
CREATE TABLE `voicemessages` (
`msgnum` int(11) NOT NULL DEFAULT '0',
`dir` varchar(80) NOT NULL DEFAULT '',
`context` varchar(80) DEFAULT '',
`macrocontext` varchar(80) DEFAULT '',
`callerid` varchar(40) DEFAULT '',
`origtime` varchar(40) DEFAULT '',
`duration` varchar(20) DEFAULT '',
`flag` varchar(128) DEFAULT '',
`mailboxuser` varchar(80) DEFAULT '',
`mailboxcontext` varchar(80) DEFAULT '',
`recording` longblob,
`msg_id` varchar(40) DEFAULT NULL,
PRIMARY KEY (`dir`),
KEY `dir` (`dir`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
диалплан:
demo 102 1 Dial SIP/102,10
demo 102 2 VoiceMail 102@demo
делаю reload:
[Sep 2 11:03:09] NOTICE[1640]: res_odbc.c:1531 odbc_obj_connect: Connecting asterisk
[Sep 2 11:03:09] NOTICE[1640]: res_odbc.c:1563 odbc_obj_connect: res_odbc: Connected to asterisk [mysql_asterisk]
[Sep 2 11:03:09] NOTICE[1640]: res_odbc.c:920 load_odbc_config: Registered ODBC class 'asterisk' dsn->[mysql_asterisk]
ОС: FreeBSD, asterisk ставил из портов (asterisk18-1.8.23.0), также из портов поставил unixODBC
asterisk собран со следующими параметрами:
[x] CURL Data transfer support via cURL
[x] DAHDI DAHDI support
[ ] EXCHANGE Exchange calendar support
[x] FREETDS FreeTDS library support
[x] GSM GSM codec support
[x] H323 H.323 support
[ ] JABBER Jabber support
[ ] LDAP LDAP support
[x] LUA Lua scripting language support
[x] MYSQL MySQL database support
[x] NEWG711 New G711 Codec
[x] OOH323 ooh323 support
[ ] PGSQL PostgreSQL database support
[ ] RADIUS RADIUS protocol support
[x] SNMP SNMP protocol support
[x] SPANDSP Spandsp faxing support
[ ] SQLITE SQLite database support
[ ] SRTP SecureRTP support
[x] VORBIS Ogg Vorbis audio codec support
[ ] IODBC ODBC backend via iODBC
[x] UNIXODBC ODBC backend via unixODBC
Конфиги:
res_odbc.conf:
[asterisk]
enabled => yes
dsn => mysql_asterisk
username => user
password => ***
pre-connect => yes
voicemail.conf:
[general]
format=wav49
odbcstorage=mysql_asterisk
odbctable=voicemessages
odbc.ini:
[mysql_asterisk]
Driver = /usr/local/lib/libmyodbc5.so
Description = Connector/ODBC Driver DSN
ServerName = localhost
Port = 3306
UserName = user
Password = ***
Database = asterisk
Option = 3
odbcinst.ini:
[MySQL_ODBC]
Description = MySQL ODBC MyODBC Driver
Driver = /usr/local/lib/libmyodbc5.so
Setup = /usr/local/lib/libodbc.so
FileUsage = 1
Таблица в Базе:
-- ----------------------------
-- Table structure for voicemessages
-- ----------------------------
DROP TABLE IF EXISTS `voicemessages`;
CREATE TABLE `voicemessages` (
`msgnum` int(11) NOT NULL DEFAULT '0',
`dir` varchar(80) NOT NULL DEFAULT '',
`context` varchar(80) DEFAULT '',
`macrocontext` varchar(80) DEFAULT '',
`callerid` varchar(40) DEFAULT '',
`origtime` varchar(40) DEFAULT '',
`duration` varchar(20) DEFAULT '',
`flag` varchar(128) DEFAULT '',
`mailboxuser` varchar(80) DEFAULT '',
`mailboxcontext` varchar(80) DEFAULT '',
`recording` longblob,
`msg_id` varchar(40) DEFAULT NULL,
PRIMARY KEY (`dir`),
KEY `dir` (`dir`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
диалплан:
demo 102 1 Dial SIP/102,10
demo 102 2 VoiceMail 102@demo
делаю reload:
[Sep 2 11:03:09] NOTICE[1640]: res_odbc.c:1531 odbc_obj_connect: Connecting asterisk
[Sep 2 11:03:09] NOTICE[1640]: res_odbc.c:1563 odbc_obj_connect: res_odbc: Connected to asterisk [mysql_asterisk]
[Sep 2 11:03:09] NOTICE[1640]: res_odbc.c:920 load_odbc_config: Registered ODBC class 'asterisk' dsn->[mysql_asterisk]