Damon,<br>
<br>
You may be querying the wrong table, because the following fields in your Select statement do not exit<br>
in the table, voicemail_users, that you created:<br>
<br>
category,<br>
var_name,<br>
var_val,<br>
cat_metric,<br>
filename,<br>
commented<br>
<br>
Every item mentioned in a Select query must exist in the table that is being queried.<br>
<br>
Rollin Weeks<br>
<br>
<br>
<br><br><div><span class="gmail_quote">On 8/10/05, <b class="gmail_sendername">Damon Estep</b> <<a href="mailto:damon@suburbanbroadband.net">damon@suburbanbroadband.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>> I'm having a few issues with the MySQL realtime configuration in<br>> CVS-HEAD. I tested it initially with realtime extensions (realtime_ext<br>> => mysql,asterisk,extensions) and a realtime switch in extensions.conf
<br>> and that works fine, So I though I'd go back and test a static<br>> configuration mapping.<br>><br>> I used the table structure from the asterisk guru postgres howto to<br>> create something similar in MySQL (shown below) and included the
<br>> following in extconfig;<br>><br>> voicemail.conf => mysql,asterisk,voicemail_users<br>><br>> The result is that app_voicemail fails to load and it appears from the<br>> debug that it is not happy with the table structure... however the
<br>names<br>> it has for the fields seem strange (to me that is :))<br>><br>> If anyone has gone through the process of creating the correct tables<br>in<br>> MySQL and doesn't mind sharing I would be most appreciative.
<br>><br>> Regards,<br>><br>> Nathan.<br>><br>><br>> ####MySQL Table####<br>> CREATE TABLE voicemail_users (<br>> id int NOT NULL auto_increment,<br>> customer_id varchar(255) NOT NULL default '0',
<br>> context varchar(255) NOT NULL default '',<br>> mailbox varchar(255) NOT NULL default '',<br>> password varchar(4) NOT NULL default '0',<br>> fullname varchar(50) NOT NULL default '',<br>> email varchar(50) NOT NULL default '',
<br>> pager varchar(50) NOT NULL default '',<br>> stamp datetime NOT NULL default '0000-00-00 00:00:00',<br>> PRIMARY KEY (`id`)<br>> );<br>> #######<br>><br>> ####res_mysql.conf####<br>> [general]
<br>> dbhost = localhost<br>> dbname = asterisk<br>> dbuser = asterisk<br>> dbpass = ********<br>> dbport = 3306<br>> dbsock = /var/run/mysqld/mysqld.sock<br>> ####<br>><br>> ####Debug Log####<br>
> Aug 11 01:16:23 DEBUG[1028] res_config_mysql.c: MySQL RealTime: Static<br>> SQL: SELECT category, var_name, var_val, cat_metric FROM<br>voicemail_users<br>> WHERE filename='voicemail.conf' and commented=0 ORDER BY filename,
<br>> cat_metric desc, var_metric asc, category, var_name, var_val, id<br>> Aug 11 01:16:23 DEBUG[1028] res_config_mysql.c: MySQL RealTime:<br>> Everything is fine.<br>> Aug 11 01:16:23 DEBUG[1028] res_config_mysql.c: MySQL RealTime: Query:
<br>> SELECT category, var_name, var_val, cat_metric FROM voicemail_users<br>> WHERE filename='voicemail.conf' and commented=0 ORDER BY filename,<br>> cat_metric desc, var_metric asc, category, var_name, var_val, id
<br>> Aug 11 01:16:23 DEBUG[1028] res_config_mysql.c: MySQL RealTime: Query<br>> Failed because: Unknown column 'category' in 'field list'<br>> ####<br>> _______________________________________________<br><br>
This works for voicemail in CVS-HEAD<br><br>CREATE TABLE `voicemail` (<br> `uniqueid` int(11) NOT NULL auto_increment,<br> `customer_id` int(11) NOT NULL default '0',<br> `context` varchar(50) NOT NULL default '',<br> `mailbox` varchar(10) NOT NULL default '0',
<br> `password` varchar(4) NOT NULL default '0',<br> `fullname` varchar(50) NOT NULL default '',<br> `email` varchar(50) NOT NULL default '',<br> `pager` varchar(50) NOT NULL default '',<br> `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update
<br>CURRENT_TIMESTAMP,<br> PRIMARY KEY (`uniqueid`),<br> KEY `mailbox_context` (`mailbox`,`context`)<br>) ENGINE=MyISAM DEFAULT CHARSET=latin1;<br>_______________________________________________<br>Asterisk-Users mailing list
<br><a href="mailto:Asterisk-Users@lists.digium.com">Asterisk-Users@lists.digium.com</a><br><a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br>