1. Asterisk
  2. ASTERISK-3943

[patch] realtime support for app_queue.c


    • Type: New Feature New Feature
    • Status: Closed
    • Severity: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Target Release Version/s: None
    • Component/s: Applications/app_queue
    • Labels:
    • Mantis ID:
    • Regression:


      This is a patch to app_queue.c that enables dynamic realtime for queues.
      Queue parameters and member list for a queue are loaded from realtime
      each time the Queue application command is called, so that updates are
      available immediately without the need for an explicit reload.

      Disclaimer has been faxed on April 15, 2005. The disclaimer concerns
      Sifira A/S, which is the company that employs me and owns the copyright
      for the code.

                • ADDITIONAL INFORMATION ******

      To enable the use of dynamic realtime for queues, first create the table
      in the database. For MySQL:

      CREATE TABLE queues_table (
      id INT(11) NOT NULL AUTO_INCREMENT, /* Optional */
      category VARCHAR(128) NOT NULL,
      var_name VARCHAR(128) NOT NULL,
      var_val VARCHAR(128) NOT NULL,
      PRIMARY KEY (id)

      Ensure a proper realtime driver configuration (eg. res_mysql.conf).

      Add a suitable family in extconfig.conf:

      queue => mysql,mydb,queues_table

      Finally add the following entry to queues.conf:

      realtime_family = queue

      to tell app_queue.c to use the newly defined realtime family.

      If a queue name is defined statically in queues.conf, it will not be
      looked up in dynamic realtime.

      After this, queues can be defined / modified in the queues_table and be
      immediately available without reload. Queues are defined in the table
      with the same parameters used in the config file. The `category' column
      is the queue name, the `var_name' column is the parameter name, and the
      `var_val' column is the parameter value. For example:

      INSERT INTO queues_table VALUES (1,'my-example-queue','strategy','roundrobin');
      INSERT INTO queues_table VALUES (2,'my-example-queue','music','default');
      INSERT INTO queues_table VALUES (3,'my-example-queue','timeout','10');
      INSERT INTO queues_table VALUES (4,'my-example-queue','retry','0');
      INSERT INTO queues_table VALUES (5,'my-example-queue','maxlen','0');
      INSERT INTO queues_table VALUES (6,'my-example-queue','member','SIP/111@mysip');
      INSERT INTO queues_table VALUES (7,'my-example-queue','member','SIP/222@mysip');
      INSERT INTO queues_table VALUES (8,'my-example-queue','member','SIP/333@mysip');

      This database setup is chosen to resemble closely the one used in static
      realtime, so you should be able to use the same rows for static and
      dynamic realtime. For now I have chosen this for simplicity; another
      attractive and just-as-easy-to-implement possibility would be to have
      two tables: One `queue' table with one row per queue and one column for
      each parameter; and one `queue_member' table with one row per member and
      columns for member interface and penalty. The latter model is perhaps
      prettyer from a relatinal database perspective.

      Other than that I will add documentation to the Wiki (or another
      appropriate place if/when this is accepted into CVS.

      Comments welcome, of course.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.


        knielsen created issue -
        Erin Spiceland made changes -
        Field Original Value New Value
        issue.field.mantisimportkey 4037 27711
        Erin Spiceland made changes -
        Workflow jira [ 69531 ] Subtask and Courtesy Workflow [ 108299 ]
        Erin Spiceland made changes -
        Assignee Kevin P. Fleming [ kpfleming ]


          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: