[Freeswitch-users] ODBC error STATE: HY000 CODE 21 ERROR

Erik Dekkers erik.dekkers at wvds.nl
Sun Feb 20 21:41:10 MSK 2011

Hi guys,

At the moment I'm doing some testing with mod_cidlookup. My intention is to match the incoming numbers against a local database. Right now im trying to set it up with SQLite.

I've installed SQLite, unixODBC and created a DSN (freeswitch is also compiled with odbc support). When testing the connection to the SQLite database with the isql utility everything works:

| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |

Unfortunately when starting freeswitch I get this error in the console:

2011-02-20 19:28:44.203665 [ERR] switch_odbc.c:365 STATE: HY000 CODE 21 ERROR: [unixODBC][SQLite]connect failed

2011-02-20 19:28:44.203672 [CRIT] switch_core_sqldb.c:386 Failure!
2011-02-20 19:28:44.203677 [CRIT] mod_cidlookup.c:137 Cannot Open ODBC Database!

Here's my config from /conf/autoload_configs/cidlookup.conf.xml:

<configuration name="cidlookup.conf" description="cidlookup Configuration">
    <param name="cache" value="false"/>
    <!-- expire is in seconds -->
    <param name="cache-expire" value="86400"/>
    <param name="odbc-dsn" value="mysqlitedb"/>

    <!-- comment out sql to not setup a database (directory) lookup -->
    <param name="sql" value="
     SELECT name||' ('||type||')' AS name
      FROM phonebook p JOIN numbers n ON p.id = n.phonebook_id
      WHERE n.number='${caller_id_number}'
      LIMIT 1

I someone could point me into the right direction that would be great.

Kind regards,

Erik Dekkers (wvds-nl)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110220/d88c870c/attachment.html 

More information about the FreeSWITCH-users mailing list