Mosiuoa Tsietsi
2006-Nov-05 04:34 UTC
[asterisk-users] Reading Voicemail Config from MySQL
Hi all, I have been trying to get my asterisk (v1.2.10) to lookup voicemail config data from my mysql database as opposed to voicemail.conf + sip.conf for my users. Users register with SER and get passed through to asterisk when they dial out. I followed the instructions as per http://www.voip-info.org/wiki/view/Asterisk+voicemail+database so basically I have 1) Build asterisk-addons-1.2.5 and added the USE_MYSQL_VM_INTERFACE=1 to the asterisk/apps folder and built asterisk again 2) I configured my voicemail.conf appropriately: dbuser=username dbpass=password dbhost=localhost dbname=asterisk_vm and have a database called asterisk_vm with a table called users with the fields needed by asterisk 3) Populated my database with some values When I try to leave a voicemail, I get the following error in the CLI: -- Called 7521@myserver -- SIP/myserver-08c5ef80 is ringing -- Nobody picked up in 20000 ms -- Executing VoiceMail("SIP/myserver-08c731a0", "u7521") in new stack Nov 5 13:30:55 WARNING[18146]: app_voicemail.c:2412 leave_voicemail: No entry in voicemail config file for '7521' I was able (thanks to some guys on this list) to get my Prepaid application to read from the database but voicemail won't. Please help me with this error. Thanks.
Mosiuoa Tsietsi
2006-Nov-05 15:31 UTC
[asterisk-users] Reading Voicemail Config from MySQL [+ ODBC]
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@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@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. On Sun, 2006-11-05 at 13:39 +0200, Mosiuoa Tsietsi wrote:> Hi all, > > I have been trying to get my asterisk (v1.2.10) to lookup voicemail > config data from my mysql database as opposed to voicemail.conf + > sip.conf for my users. Users register with SER and get passed through > to asterisk when they dial out. I followed the instructions as per > http://www.voip-info.org/wiki/view/Asterisk+voicemail+database > > so basically I have > 1) Build asterisk-addons-1.2.5 and added the USE_MYSQL_VM_INTERFACE=1 to > the asterisk/apps folder and built asterisk again > 2) I configured my voicemail.conf appropriately: > > dbuser=username > dbpass=password > dbhost=localhost > dbname=asterisk_vm > > and have a database called asterisk_vm with a table called users with > the fields needed by asterisk > 3) Populated my database with some values > > When I try to leave a voicemail, I get the following error in the CLI: > > -- Called 7521@myserver > -- SIP/myserver-08c5ef80 is ringing > -- Nobody picked up in 20000 ms > -- Executing VoiceMail("SIP/myserver-08c731a0", "u7521") in new > stack > Nov 5 13:30:55 WARNING[18146]: app_voicemail.c:2412 leave_voicemail: No > entry in voicemail config file for '7521' > > I was able (thanks to some guys on this list) to get my Prepaid > application to read from the database but voicemail won't. > > Please help me with this error. Thanks. > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- The Law of Unintended Consequences: for every action, there is an excellent chance of producing an opposite and totally disproportionate reaction. - Clyde Haberman