I have Asterisk 1.4.32 and I would like save all VoiceMail to MSSQL 2008
database. I configured ODBC, but I receive this errors.
[Jun 18 14:00:37] NOTICE[19914] res_odbc.c: Connecting sqlserver
[Jun 18 14:00:37] NOTICE[19914] res_odbc.c: res_odbc: Connected to
sqlserver [kupalaodbc]
[Jun 18 14:00:37] WARNING[19914] app_voicemail.c: SQL Prepare
failed![SELECT COUNT(*) FROM pbx_VoiceMail WHERE dir
'/var/spool/asterisk/voicemail/default/390/INBOX']
[Jun 18 14:00:37] WARNING[19914] res_odbc.c: SQL Prepare failed.
Attempting a reconnect...
[Jun 18 14:00:37] WARNING[19914] res_odbc.c: Unable to deallocate
database handle? 0 errno=0 [unixODBC][Driver Manager]Function sequence error
I have configured in voicemail.conf
[general]
format=wav49
odbcstorage=sqlserver
odbctable=pbx_VoiceMail
odbc.ini
[kupalaodbc]
Description = ODBC connection
Driver = ms-sql
Servername = ms-sql
UID = TestDatabaseDemo
database = TestDatabaseDemo
Port = 1364
odbcinst.ini
[ms-sql]
Description = TDS connection
Driver = /usr/lib/odbc/libtdsodbc.so
Setup = /usr/lib/odbc/libtdsS.so
UsageCount = 1
FileUsage = 1
freetds.conf
[ms-sql]
host = 192.168.1.10
port = 1364
tds version = 8.0
dump file = /var/log/freetds.log
I reloaded module and restarted asterisk also, but with no success.
What can be wrong?
Regards Andra?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20100619/29723e9d/attachment.htm
Ok, this issue I resolved, I just changed the TDS version to 7.0. But now I receive different error, I can't insert into database. [Jun 19 14:30:25] WARNING[6212] app_voicemail.c: SQL Prepare failed![INSERT INTO pbx_VoiceMail (dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext) VALUES (?,?, ? , ?,?,?,?,?,?,?)] [Jun 19 14:30:25] WARNING[6212] res_odbc.c: SQL Prepare failed. Attempting a reconnect... [Jun 19 14:30:25] NOTICE[6212] res_odbc.c: Connecting sqlserver [Jun 19 14:30:25] NOTICE[6212] res_odbc.c: res_odbc: Connected to sqlserver [kupalaodbc] -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100619/9917c954/attachment.htm
Seems to me that the SQL statement is not complete and asterisk is
complaining about it. Do you prepare this statement in your dialplan or
asterisk makes it automatically?
Zeeshan A Zakaria
--
www.ilovetovoip.com
On 2010-06-19 9:10 AM, "Andra?" <atletek at gmail.com> wrote:
Ok, this issue I resolved, I just changed the TDS version to 7.0. But now I
receive different error, I can't insert into database.
[Jun 19 14:30:25] WARNING[6212] app_voicemail.c: SQL Prepare failed![INSERT
INTO pbx_VoiceMail
(dir,msgnum,recording,context,macrocontext,callerid,origtime,duration,mailboxuser,mailboxcontext)
VALUES (?,?, ? , ?,?,?,?,?,?,?)]
[Jun 19 14:30:25] WARNING[6212] res_odbc.c: SQL Prepare failed. Attempting
a reconnect...
[Jun 19 14:30:25] NOTICE[6212] res_odbc.c: Connecting sqlserver
[Jun 19 14:30:25] NOTICE[6212] res_odbc.c: res_odbc: Connected to sqlserver
[kupalaodbc]
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20100619/497e56e8/attachment.htm