<div dir="ltr">You need a "name" column. This is my queue table:<div><br></div><div><div>CREATE TABLE IF NOT EXISTS `queue` (</div><div> `name` varchar(128) NOT NULL,</div><div> `musiconhold` varchar(128) DEFAULT NULL,</div>
<div> `announce` varchar(128) DEFAULT NULL,</div><div> `context` varchar(128) DEFAULT NULL,</div><div> `timeout` int(11) DEFAULT NULL,</div><div> `monitor_join` tinyint(1) DEFAULT NULL,</div><div> `monitor_format` varchar(128) DEFAULT NULL,</div>
<div> `queue_youarenext` varchar(128) DEFAULT NULL,</div><div> `queue_thereare` varchar(128) DEFAULT NULL,</div><div> `queue_callswaiting` varchar(128) DEFAULT NULL,</div><div> `queue_holdtime` varchar(128) DEFAULT NULL,</div>
<div> `queue_minutes` varchar(128) DEFAULT NULL,</div><div> `queue_seconds` varchar(128) DEFAULT NULL,</div><div> `queue_lessthan` varchar(128) DEFAULT NULL,</div><div> `queue_thankyou` varchar(128) DEFAULT NULL,</div>
<div> `queue_reporthold` varchar(128) DEFAULT NULL,</div><div> `announce_frequency` int(11) DEFAULT NULL,</div><div> `announce_round_seconds` int(11) DEFAULT NULL,</div><div> `announce_holdtime` varchar(128) DEFAULT NULL,</div>
<div> `retry` int(11) DEFAULT NULL,</div><div> `wrapuptime` int(11) DEFAULT NULL,</div><div> `maxlen` int(11) DEFAULT NULL,</div><div> `servicelevel` int(11) DEFAULT NULL,</div><div> `strategy` varchar(128) DEFAULT NULL,</div>
<div> `joinempty` varchar(128) DEFAULT NULL,</div><div> `leavewhenempty` varchar(128) DEFAULT NULL,</div><div> `eventmemberstatus` tinyint(1) DEFAULT NULL,</div><div> `eventwhencalled` tinyint(1) DEFAULT NULL,</div><div>
`reportholdtime` tinyint(1) DEFAULT NULL,</div><div> `memberdelay` int(11) DEFAULT NULL,</div><div> `weight` int(11) DEFAULT NULL,</div><div> `timeoutrestart` tinyint(1) DEFAULT NULL,</div><div> `periodic_announce` varchar(50) DEFAULT NULL,</div>
<div> `periodic_announce_frequency` int(11) DEFAULT NULL,</div><div> `ringinuse` tinyint(1) DEFAULT NULL,</div><div> `setinterfacevar` tinyint(1) DEFAULT NULL,</div><div> PRIMARY KEY (`name`)</div><div>) ENGINE=MyISAM DEFAULT CHARSET=latin1;</div>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/18 Tommy Cooper <span dir="ltr"><<a href="mailto:tomcooper83@yahoo.com" target="_blank">tomcooper83@yahoo.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">Hi,<u></u><u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"> <u></u><u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">I am trying to store queues.conf to a MySQL database using dynamic realtime. I have a working ODBC connection and the queueing system already works but I want to store the queues.conf file to a database. I am following the guide from Asterisk the definitive guide, the ebook can be found at: <a href="http://ofps.oreilly.com/titles/9781449332426/asterisk-DB.html" target="_blank">http://ofps.oreilly.com/titles/9781449332426/asterisk-DB.html</a> <u></u><u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><u></u> <u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">I have a database called asterisk which contains 2 main tables: Queues and </span><span style="FONT-FAMILY:'Arial','sans-serif';COLOR:#333333;FONT-SIZE:10pt" lang="EN">queue_member_table, both tables have sample data.<u></u><u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="FONT-FAMILY:'Arial','sans-serif';COLOR:#333333;FONT-SIZE:10pt" lang="EN"><u></u> <u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">mysql> select * from queue_member_table;<u></u><u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">+----------+------------+------------+-----------+---------+--------+<u></u><u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">| uniqueid | membername | queue_name | interface | penalty | paused |<u></u><u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">+----------+------------+------------+-----------+---------+--------+<u></u><u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">|<span> </span>1 | SIP/1000<span> </span>| support<span> </span>| SIP/1000<span> </span>|<span> </span>NULL |<span> </span><span> </span><span> </span>0 |<u></u><u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">+----------+------------+------------+-----------+---------+--------+<u></u><u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><u></u> <u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><u></u> <u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">SQL> select QueueID,name,strategy from Queues;<u></u><u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><u></u> <u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">|QueueID|<span> </span>name<span> </span><span> </span><span> </span><span> </span>strategy<span> </span><u></u><u></u></span></div>
<div style="TEXT-ALIGN:justify"><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><span> </span>1<span> </span><span> </span>support<span> </span><span> </span><span> </span><span> </span>rrmemory<span> </span><u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><u></u> <u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">There are more fields but these are the most important<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><u></u> <u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">I keep getting this error:<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><u></u> <u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">node1*CLI> queue show <u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">No queues.<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">[Apr 18 22:41:06] WARNING[18599]: res_odbc.c:645 ast_odbc_prepare_and_execute: SQL Execute returned an error -1: 42000: [MySQL][ODBC 5.1 Driver][mysqld-5.1.67]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''\' ORDER BY name' at line 1 (202)<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">[Apr 18 22:41:06] WARNING[18599]: res_odbc.c:657 ast_odbc_prepare_and_execute: SQL Execute error -1! Verifying connection to asterisk [asterisk-connector]...<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">[Apr 18 22:41:06] WARNING[18599]: res_odbc.c:761 ast_odbc_sanity_check: Connection is down attempting to reconnect...<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">[Apr 18 22:41:06] NOTICE[18599]: res_odbc.c:1527 odbc_obj_connect: Connecting asterisk<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">[Apr 18 22:41:06] NOTICE[18599]: res_odbc.c:1559 odbc_obj_connect: res_odbc: Connected to asterisk [asterisk-connector]<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">[Apr 18 22:41:06] WARNING[18599]: res_odbc.c:645 ast_odbc_prepare_and_execute: SQL Execute returned an error -1: 42000: [MySQL][ODBC 5.1 Driver][mysqld-5.1.67]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''\' ORDER BY name' at line 1 (202)<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">[Apr 18 22:41:06] WARNING[18599]: res_odbc.c:657 ast_odbc_prepare_and_execute: SQL Execute error -1! Verifying connection to asterisk [asterisk-connector]...<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">[Apr 18 22:41:06] WARNING[18599]: res_odbc.c:761 ast_odbc_sanity_check: Connection is down attempting to reconnect...<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">[Apr 18 22:41:06] NOTICE[18599]: res_odbc.c:1527 odbc_obj_connect: Connecting asterisk<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">[Apr 18 22:41:06] NOTICE[18599]: res_odbc.c:1559 odbc_obj_connect: res_odbc: Connected to asterisk [asterisk-connector]<u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"> <u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><u></u> <u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><u></u> <u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US">extensions.conf: <u></u><u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><u></u> <u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"><u></u> <u></u></span></div>
<div><span style="font-size:10pt;font-family:'Arial','sans-serif'" lang="EN-US"> <u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 10pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">[general]<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 10pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">autofallthrough=yes<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 10pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 10pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">[default]<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">exten => 1000,1, Dial (SIP/1000)<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">exten => 1001,1, Dial (SIP/1001)<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">[Queues]<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">exten => 1000,1,Verbose(1,Call entering queue named ${support)<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">same => n,Set(QueueParameters=${GET_QUEUE_DETAILS(support)})<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">same => n,Queue(${QueueParameters})<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">[LocalSets]<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">include => Queues<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">[sip-phone]<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">;This is the context setup for outgoing calls<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">exten => _3XXXX.,1,Dial(SIP/myprovider/${EXTEN:1},60) ;working config<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">[from-myprovider]<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">;This is the context setup for incoming calls<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">exten => *mynumber*,1,Answer<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">exten => *mynumber*,2,Queue(support)<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">exten => *mynumber*,4,Hangup<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">queues.conf<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">[general]<u></u><u></u></span></div>
<div style="line-height:normal;font-size:13px;font-style:normal;background-color:transparent;font-family:'Arial','sans-serif';margin:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">autofill=yes<span> </span>; distribute all waiting callers to available members<u></u><u></u></span></div>
<div style="line-height:normal;font-size:13px;font-style:normal;background-color:transparent;font-family:'Arial','sans-serif';margin:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">shared_lastcall=yes<span> </span>; respect the wrapup time for members logged into more<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><span> </span><span> </span>; than one queue<u></u><u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt"><u></u> <u></u></span></div>
<div style="LINE-HEIGHT:normal;MARGIN:0cm 0cm 0pt" class="MsoNormal"><span style="FONT-FAMILY:'Arial','sans-serif';FONT-SIZE:10pt">realtime_family = queue, Queues<u></u><u></u></span></div>
<div> </div>
<div> </div>
<div>Thank you and sorry for the long post<var></var></div></div></div><br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br></div>