The queue application supports dynamic realtime. With dynamic realtime, the queue definition and member list will be reloaded each time a caller joins the queue. Thus queues can be updated in the database and the changes will be immediately visible without the need for an explicit reload.
It is possible to mix statically and dynamically defined queues. If a queue is defined in both static and dynamic realtime, the static version is used. The agent login feature currently only works for static queues though (a similar effect can be achieved with dynamic queues simply by inserting an appropriate row for a new member).
queues => mysql,asterisk,queue_table
queue_members => mysql,asterisk,queue_member_table
This example uses MySQL, but other realtime drivers (eg. ODBC) also work. The database containing the queue definitions is asterisk in this example, and the tables are called queue_table and queue_member_table.
Here are suitable MySQL table definitions for realtime queues. First the table defining each queue, with one row per queue.
This table has a column for each possible queue parameter. Except for the mandatory name column, all columns are optional, and only the columns actually used need be included. Likewise, more columns may be added if the queue application is later extended with more parameters. A NULL value for a column indicates an unset parameter.
field "setinterfacevar" valid only in asterisk 1.4.x or higher.
in asterisk 1.4:
please replace monitor-join to monitor-type varchar(128)
If you are using mysql 3.2.5X or lower the BOOL don't work so you have to simulate the behavior of the boolean with a tinyint(1) where 0 = false and 1 = true. ...
It is possible to mix statically and dynamically defined queues. If a queue is defined in both static and dynamic realtime, the static version is used. The agent login feature currently only works for static queues though (a similar effect can be achieved with dynamic queues simply by inserting an appropriate row for a new member).
Extconfig.conf Setup
Add the following lines (changing of family names isn't allowed):queues => mysql,asterisk,queue_table
queue_members => mysql,asterisk,queue_member_table
This example uses MySQL, but other realtime drivers (eg. ODBC) also work. The database containing the queue definitions is asterisk in this example, and the tables are called queue_table and queue_member_table.
Database Tables
Here are suitable MySQL table definitions for realtime queues. First the table defining each queue, with one row per queue.
CREATE TABLE queue_table (
name VARCHAR(128) PRIMARY KEY,
musiconhold VARCHAR(128),
announce VARCHAR(128),
context VARCHAR(128),
timeout INT(11),
monitor_join BOOL,
monitor_format VARCHAR(128),
queue_youarenext VARCHAR(128),
queue_thereare VARCHAR(128),
queue_callswaiting VARCHAR(128),
queue_holdtime VARCHAR(128),
queue_minutes VARCHAR(128),
queue_seconds VARCHAR(128),
queue_lessthan VARCHAR(128),
queue_thankyou VARCHAR(128),
queue_reporthold VARCHAR(128),
announce_frequency INT(11),
announce_round_seconds INT(11),
announce_holdtime VARCHAR(128),
retry INT(11),
wrapuptime INT(11),
maxlen INT(11),
servicelevel INT(11),
strategy VARCHAR(128),
joinempty VARCHAR(128),
leavewhenempty VARCHAR(128),
eventmemberstatus BOOL,
eventwhencalled BOOL,
reportholdtime BOOL,
memberdelay INT(11),
weight INT(11),
timeoutrestart BOOL,
periodic_announce VARCHAR(50),
periodic_announce_frequency INT(11),
ringinuse BOOL,
setinterfacevar BOOL
);
name VARCHAR(128) PRIMARY KEY,
musiconhold VARCHAR(128),
announce VARCHAR(128),
context VARCHAR(128),
timeout INT(11),
monitor_join BOOL,
monitor_format VARCHAR(128),
queue_youarenext VARCHAR(128),
queue_thereare VARCHAR(128),
queue_callswaiting VARCHAR(128),
queue_holdtime VARCHAR(128),
queue_minutes VARCHAR(128),
queue_seconds VARCHAR(128),
queue_lessthan VARCHAR(128),
queue_thankyou VARCHAR(128),
queue_reporthold VARCHAR(128),
announce_frequency INT(11),
announce_round_seconds INT(11),
announce_holdtime VARCHAR(128),
retry INT(11),
wrapuptime INT(11),
maxlen INT(11),
servicelevel INT(11),
strategy VARCHAR(128),
joinempty VARCHAR(128),
leavewhenempty VARCHAR(128),
eventmemberstatus BOOL,
eventwhencalled BOOL,
reportholdtime BOOL,
memberdelay INT(11),
weight INT(11),
timeoutrestart BOOL,
periodic_announce VARCHAR(50),
periodic_announce_frequency INT(11),
ringinuse BOOL,
setinterfacevar BOOL
);
This table has a column for each possible queue parameter. Except for the mandatory name column, all columns are optional, and only the columns actually used need be included. Likewise, more columns may be added if the queue application is later extended with more parameters. A NULL value for a column indicates an unset parameter.
field "setinterfacevar" valid only in asterisk 1.4.x or higher.
in asterisk 1.4:
[Sep 3 13:51:27] NOTICE[960]: app_queue.c:458 monjoin_dep_warning: The 'monitor-join' queue option is deprecated. Please use monitor-type=mixmonitor instead.
please replace monitor-join to monitor-type varchar(128)
If you are using mysql 3.2.5X or lower the BOOL don't work so you have to simulate the behavior of the boolean with a tinyint(1) where 0 = false and 1 = true. ...