[asterisk-users] Reading Voicemail Config from MySQL [+ ODBC]

RR ranjtech at gmail.com
Tue Nov 7 10:13:28 MST 2006


On 11/6/06, Mosiuoa Tsietsi <g06t6632 at campus.ru.ac.za> wrote:
> Hi,
>
> After some more searching I decided to try USING unix ODBC for the
> connection.  I have both the unixODBC and unixODBC-devel packages on my
> fedora box:
>
> [root at myserver /]# rpm -qa | grep -i unixodbc
> unixODBC-2.2.11-7.1
> unixODBC-devel-2.2.11-7.1
>
> Here are my odbcinsi.ini and odbc.ini files respectively:
>
> [MySQL]
> Description     = ODBC for MySQL
> Driver          = /usr/lib/libmyodbc.so
> Setup           = /usr/lib/libodbcmyS.so
> FileUsage       = 1
>
> ---
> [MYSQL-asterisk]
> Driver = MySQL
> Description = Data source for dynamic asterisk voicemail configuration
> Trace = Yes
> TraceFile = stderr
> SERVER = localhost
> USER = root
> PASSWORD = rootroot9
> PORT = 3306
> DATABASE = asterisk
> -----
>
> Below are my res_odbc.conf and extconfig.conf files for supplying
> details of the DSN name and and database/table for asterisk
>
> [mysql1]
> enabled => yes
> dsn => MySQL-asterisk
> username => root
> password => ***
> pre-connect => yes
>
> ---
> [settings]
> voicemail => odbc,mysql1,users
> ---
> I am able to execute:
> [root at myserver /]# isql -v MySQL-asterisk
> +---------------------------------------+
> | Connected!                            |
> |                                       |
> | sql-statement                         |
> | help [tablename]                      |
> | quit                                  |
> |                                       |
> +---------------------------------------+
> SQL>
>
> which shows I can connect to the database on the command line using my
> DSN name.
>
> In the asterisk CLI however, the command:
>
> asterisk*CLI> odbc show
> No such command 'odbc' (type 'help' for help)
>
> fails which is supposed to show connections to MySQL from the CLI.  ANd
> lastly the command:
>
> asterisk*CLI> realtime load voicemail mailbox 7521
> No rows found matching search criteria.
> Nov  6 00:33:10 WARNING[2965]: config.c:920 find_engine: Realtime
> mapping for 'voicemail' found to engine 'odbc', but the engine is not
> available
>
> also fails.  Where are I going wrong?
> Thanks.
>

Mate, doesn't sound like you have the res_odbc.so module loaded. Make
sure in /etc/asterisk/modules.conf you have a load => res_odbc.so or
on the CLI type load res_odbc.so and then give it a whirl.


More information about the asterisk-users mailing list