Details

    • 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:
      None
    • Mantis ID:
      4037
    • Regression:
      No

      Description

      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.

        Activity

        Hide
        Michael Jerris added a comment -

        markster, can we have some comment on realtime insert\delete?

        Show
        Michael Jerris added a comment - markster, can we have some comment on realtime insert\delete?
        Hide
        Michael Jerris added a comment -

        Also lets get this in and move implementing realtime updates and delete to another bug.

        Show
        Michael Jerris added a comment - Also lets get this in and move implementing realtime updates and delete to another bug.
        Hide
        knielsen added a comment -

        I think we should finish this issue one way or the other, add to CVS or not, but let's finish it.

        I looked once more into the AddQueueMember stuff, and I still think the only sane way is to map them to realtime INSERT/DELETE, once that is added to realtime. The comment from outtolunc seems to agree.

        Or perhaps use drmac's realtime UPDATE proposal, but that also requires realtime additions: the current realtime API does not allow to update on a composite key, and realtime queue need the key (queue, member).

        Both twilson and MikeJ seemed to think this should be added to CVS and the dynamic stuff moved to another bug.

        Or if you prefer, I will just have to maintain this locally for our own purpose.

        Show
        knielsen added a comment - I think we should finish this issue one way or the other, add to CVS or not, but let's finish it. I looked once more into the AddQueueMember stuff, and I still think the only sane way is to map them to realtime INSERT/DELETE, once that is added to realtime. The comment from outtolunc seems to agree. Or perhaps use drmac's realtime UPDATE proposal, but that also requires realtime additions: the current realtime API does not allow to update on a composite key, and realtime queue need the key (queue, member). Both twilson and MikeJ seemed to think this should be added to CVS and the dynamic stuff moved to another bug. Or if you prefer, I will just have to maintain this locally for our own purpose.
        Hide
        Kevin P. Fleming (Inactive) added a comment -

        Committed to CVS HEAD, thanks!

        Show
        Kevin P. Fleming (Inactive) added a comment - Committed to CVS HEAD, thanks!
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 5821

        U trunk/apps/app_queue.c
        U trunk/configs/extconfig.conf.sample

        ------------------------------------------------------------------------
        r5821 | kpfleming | 2008-01-15 15:36:50 -0600 (Tue, 15 Jan 2008) | 2 lines

        add realtime support to app_queue for static members/agents (bug ASTERISK-3943)

        ------------------------------------------------------------------------

        http://svn.digium.com/view/asterisk?view=rev&revision=5821

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 5821 U trunk/apps/app_queue.c U trunk/configs/extconfig.conf.sample ------------------------------------------------------------------------ r5821 | kpfleming | 2008-01-15 15:36:50 -0600 (Tue, 15 Jan 2008) | 2 lines add realtime support to app_queue for static members/agents (bug ASTERISK-3943 ) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=5821

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development