[asterisk-users] func_odbc insert with mssql

Myles Wakeham myles at techsol.org
Tue Aug 11 12:29:48 CDT 2009


David wrote:
> When I do an odbc show, it shows that I am connected to the db. If I use isql, I can write to the db, however, when I use func_odbc, a record will not write.  I'm using asterisk 1.4.9. Any idea what might be wrong?

Sounds sneakingly like a permissions problem in your database for the 
login account that you are using through ODBC.  But if not, the INSERT 
SQL statement may not be correctly established for your database.

Personally I don't use ODBC for this sort of thing.  Its not really a 
'Linux' type thing, and relies on a lot of middle-ware layers between 
the Asterisk server and the database.  Not that you have too many 
choices, but what we do that works brilliantly well here is to use 
PHP-AGI to construct a PHP script that does all the DB connection, 
inserting, etc. and just have the Asterisk dialplan call that.

This way I have total visibility to the SQL and I have apply some 
transforms to the data in PHP if needed.  It also means that if I want 
to swap out the DB to another brand, I can do that with only one place 
to change the code.

FWIW...

Myles
-- 
=======================
Myles Wakeham
Director of Engineering
Tech Solutions USA, Inc.
Scottsdale, Arizona  USA
http://www.techsolusa.com
Phone +1-480-451-7440




More information about the asterisk-users mailing list