[asterisk-users] Dynamic realtime + queues

Leandro Dardini
Thu, 18 Apr 2013 21:04:16 -0000

You need a "name" column. This is my queue table:

CREATE TABLE IF NOT EXISTS `queue` (
  `name` varchar(128) NOT NULL,
  `musiconhold` varchar(128) DEFAULT NULL,
  `announce` varchar(128) DEFAULT NULL,
  `context` varchar(128) DEFAULT NULL,
  `timeout` int(11) DEFAULT NULL,
  `monitor_join` tinyint(1) DEFAULT NULL,
  `monitor_format` varchar(128) DEFAULT NULL,
  `queue_youarenext` varchar(128) DEFAULT NULL,
  `queue_thereare` varchar(128) DEFAULT NULL,
  `queue_callswaiting` varchar(128) DEFAULT NULL,
  `queue_holdtime` varchar(128) DEFAULT NULL,
  `queue_minutes` varchar(128) DEFAULT NULL,
  `queue_seconds` varchar(128) DEFAULT NULL,
  `queue_lessthan` varchar(128) DEFAULT NULL,
  `queue_thankyou` varchar(128) DEFAULT NULL,
  `queue_reporthold` varchar(128) DEFAULT NULL,
  `announce_frequency` int(11) DEFAULT NULL,
  `announce_round_seconds` int(11) DEFAULT NULL,
  `announce_holdtime` varchar(128) DEFAULT NULL,
  `retry` int(11) DEFAULT NULL,
  `wrapuptime` int(11) DEFAULT NULL,
  `maxlen` int(11) DEFAULT NULL,
  `servicelevel` int(11) DEFAULT NULL,
  `strategy` varchar(128) DEFAULT NULL,
  `joinempty` varchar(128) DEFAULT NULL,
  `leavewhenempty` varchar(128) DEFAULT NULL,
  `eventmemberstatus` tinyint(1) DEFAULT NULL,
  `eventwhencalled` tinyint(1) DEFAULT NULL,
  `reportholdtime` tinyint(1) DEFAULT NULL,
  `memberdelay` int(11) DEFAULT NULL,
  `weight` int(11) DEFAULT NULL,
  `timeoutrestart` tinyint(1) DEFAULT NULL,
  `periodic_announce` varchar(50) DEFAULT NULL,
  `periodic_announce_frequency` int(11) DEFAULT NULL,
  `ringinuse` tinyint(1) DEFAULT NULL,
  `setinterfacevar` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;



2013/4/18 Tommy Cooper <tomcooper83 at yahoo.com>

> Hi,******
>  ****
> 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: http://ofps.oreilly.com/titles/9781449332426/asterisk-DB.html **
> **
> ** **
> I have a database called asterisk which contains 2 main tables: Queues and
queue_member_table,
> both tables have sample data.****
> ** **
> mysql> select * from queue_member_table;****
> +----------+------------+------------+-----------+---------+--------+****
> | uniqueid | membername | queue_name | interface | penalty | paused |****
> +----------+------------+------------+-----------+---------+--------+****
> |        1 | SIP/1000   | support    | SIP/1000  |    NULL |           0 |
> ****
> +----------+------------+------------+-----------+---------+--------+****
> ** **
> ** **
> SQL> select QueueID,name,strategy from Queues;****
> ** **
> |QueueID|          name                                    strategy      *
> ***
>  1                     support                                 rrmemory
> ****
> ** **
> There are more fields but these are the most important****
> ** **
> I keep getting this error:****
> ** **
> node1*CLI> queue show ****
> No queues.****
> [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)****
> [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]...****
> [Apr 18 22:41:06] WARNING[18599]: res_odbc.c:761 ast_odbc_sanity_check:
> Connection is down attempting to reconnect...****
> [Apr 18 22:41:06] NOTICE[18599]: res_odbc.c:1527 odbc_obj_connect:
> Connecting asterisk****
> [Apr 18 22:41:06] NOTICE[18599]: res_odbc.c:1559 odbc_obj_connect:
> res_odbc: Connected to asterisk [asterisk-connector]****
> [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)****
> [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]...****
> [Apr 18 22:41:06] WARNING[18599]: res_odbc.c:761 ast_odbc_sanity_check:
> Connection is down attempting to reconnect...****
> [Apr 18 22:41:06] NOTICE[18599]: res_odbc.c:1527 odbc_obj_connect:
> Connecting asterisk****
> [Apr 18 22:41:06] NOTICE[18599]: res_odbc.c:1559 odbc_obj_connect:
> res_odbc: Connected to asterisk [asterisk-connector]****
>  ****
> ** **
> ** **
> extensions.conf:   ****
> ** **
> ** **
>                                                       ****
> [general]****
> autofallthrough=yes****
> ** **
> [default]****
> exten => 1000,1, Dial (SIP/1000)****
> exten => 1001,1, Dial (SIP/1001)****
> ** **
> ** **
> [Queues]****
> ** **
> ** **
> exten => 1000,1,Verbose(1,Call entering queue named ${support)****
> same => n,Set(QueueParameters=${GET_QUEUE_DETAILS(support)})****
> same => n,Queue(${QueueParameters})****
> ** **
> [LocalSets]****
> ** **
> include => Queues****
> ** **
> [sip-phone]****
> ;This is the context setup for outgoing calls****
> ** **
> exten => _3XXXX.,1,Dial(SIP/myprovider/${EXTEN:1},60) ;working
config****
> ** **
> ** **
> [from-myprovider]****
> ;This is the context setup for incoming calls****
> ** **
> exten => *mynumber*,1,Answer****
> exten => *mynumber*,2,Queue(support)****
> exten => *mynumber*,4,Hangup****
> ** **
> queues.conf****
> ** **
> [general]****
> autofill=yes            ; distribute all waiting callers to available
> members****
> shared_lastcall=yes     ; respect the wrapup time for members logged into
> more****
>                         ; than one queue****
> ** **
> realtime_family = queue, Queues****
>
>
> Thank you and sorry for the long post
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.digium.com/pipermail/asterisk-users/attachments/20130418/d72a42b4/attachment.htm>