Asterisk
  1. Asterisk
  2. ASTERISK-9813

Queue timeouts are considerably higher than expected

    Details

    • Type: Bug Bug
    • 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:
      10127
    • Regression:
      No

      Description

      A queue is defined as follows:

      ----------------------------
      [testq]
      timeout=10
      retry=5
      strategy=ringall
      wrapuptime=0
      maxlen=0
      joinempty=no
      leavewhenempty=yes
      eventmemberstatus=no
      eventwhencalled=no
      reportholdtime=no
      memberdelay=0
      weight=0
      timeoutrestart=0
      autopause=no
      member => SIP/100
      member => SIP/101
      member => SIP/102
      ----------------------------

      When called with 'Queue(testq,n)':
      1 - The phones ring for 10 seconds.
      2 - There is 5 seconds silence
      3 - The phones ring for 10 seconds.
      4 - There is 5 seconds silence
      5 - The call exits the queue on the time-out cycle

      So, despite the queue having a timeout of 10 seconds, the call is in the queue for 30.

      When called with 'Queue(testq,n,,,10):
      1 - The phones ring for 10 seconds.
      2 - There is 5 seconds silence
      3 - The call exits the queue (no mention is made of the time-out cycle).

      So, despite coding an explicit 10 seconds timeout, the call is in the queue for 15.

                • ADDITIONAL INFORMATION ******

      This is repeatable in both static and realtime configurations.

      1. 10127_more_debug.patch
        5 kB
        Mark Michelson
      2. 10127_realtime_fix.patch
        4 kB
        Mark Michelson
      3. 10127_with_debug.patch
        4 kB
        Mark Michelson
      4. 10127.patch
        4 kB
        Mark Michelson
      5. queue_log.txt
        103 kB
      6. queue-more-debug.txt
        44 kB

        Activity

        Hide
        Leif Madsen added a comment -

        I tested the latest patch and it is very close to working.

        On the first call, 2 of 3 members are rang, but where the third member would be called, there is just a delay, then the Queue() exits and continues on in the dialplan.

        On the 2nd call, all 3 members are rang and the Queue() exits to the dialplan (works as desired).

        All calls beyond the first call seem to work fine, it's just the first call that doesn't work right. If I restart Asterisk, then I can reproduce as stated above.

        Show
        Leif Madsen added a comment - I tested the latest patch and it is very close to working. On the first call, 2 of 3 members are rang, but where the third member would be called, there is just a delay, then the Queue() exits and continues on in the dialplan. On the 2nd call, all 3 members are rang and the Queue() exits to the dialplan (works as desired). All calls beyond the first call seem to work fine, it's just the first call that doesn't work right. If I restart Asterisk, then I can reproduce as stated above.
        Hide
        Leif Madsen added a comment -

        OK, tested again with the more-debug patch. Seems to ring 2 interfaces fine, then quits before it rings the 3rd interface for some reason. I added the queue-more-debug.txt file which contains the logging for the test call.

        I removed everything I didn't think was necessary in order to help aid the reader

        Show
        Leif Madsen added a comment - OK, tested again with the more-debug patch. Seems to ring 2 interfaces fine, then quits before it rings the 3rd interface for some reason. I added the queue-more-debug.txt file which contains the logging for the test call. I removed everything I didn't think was necessary in order to help aid the reader
        Hide
        Leif Madsen added a comment -

        I had problems making this work before, but maybe I was just a nub and wasn't applying this correctly or something.

        With the 10127-more-debug.patch file everything works as I would expect. Essentially this 'n' option becomes a "single iteration" flag that continues on in the dialplan upon calling all available members in the queue.

        It works!

        Show
        Leif Madsen added a comment - I had problems making this work before, but maybe I was just a nub and wasn't applying this correctly or something. With the 10127-more-debug.patch file everything works as I would expect. Essentially this 'n' option becomes a "single iteration" flag that continues on in the dialplan upon calling all available members in the queue. It works!
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 76801

        ------------------------------------------------------------------------
        r76801 | mmichelson | 2007-07-24 11:09:48 -0500 (Tue, 24 Jul 2007) | 13 lines

        Added a membercount variable to call_queue struct which keeps track of the number of logged in members in a particular queue.
        This makes it so that the 'n' option for Queue() can act properly depending on which strategy is used. If the strategy is
        roundrobin, rrmemory, or ringall, we want to ring each phone once before moving on in the dialplan. However, if any other strategy is
        used, we will only ring one phone since it cannot be guaranteed that a different phone will ring on subsequent attempts to ring a phone.

        As a side effect of this, the QUEUE_MEMBER_COUNT dialplan function now just reads the membercount variable instead of traversing through
        the member list to figure out how many members there are.

        Special thanks to blitzrage for helping to test this out.

        (closes issue ASTERISK-9813, reported by bcnit, patched by me, tested by blitzrage)

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

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 76801 ------------------------------------------------------------------------ r76801 | mmichelson | 2007-07-24 11:09:48 -0500 (Tue, 24 Jul 2007) | 13 lines Added a membercount variable to call_queue struct which keeps track of the number of logged in members in a particular queue. This makes it so that the 'n' option for Queue() can act properly depending on which strategy is used. If the strategy is roundrobin, rrmemory, or ringall, we want to ring each phone once before moving on in the dialplan. However, if any other strategy is used, we will only ring one phone since it cannot be guaranteed that a different phone will ring on subsequent attempts to ring a phone. As a side effect of this, the QUEUE_MEMBER_COUNT dialplan function now just reads the membercount variable instead of traversing through the member list to figure out how many members there are. Special thanks to blitzrage for helping to test this out. (closes issue ASTERISK-9813 , reported by bcnit, patched by me, tested by blitzrage) ------------------------------------------------------------------------
        Hide
        Digium Subversion added a comment -

        Repository: asterisk
        Revision: 76804

        ------------------------------------------------------------------------
        r76804 | mmichelson | 2007-07-24 11:25:25 -0500 (Tue, 24 Jul 2007) | 21 lines

        Merged revisions 76801 via svnmerge from
        https://origsvn.digium.com/svn/asterisk/branches/1.4

        ........
        r76801 | mmichelson | 2007-07-24 11:26:58 -0500 (Tue, 24 Jul 2007) | 13 lines

        Added a membercount variable to call_queue struct which keeps track of the number of logged in members in a particular queue.
        This makes it so that the 'n' option for Queue() can act properly depending on which strategy is used. If the strategy is
        roundrobin, rrmemory, or ringall, we want to ring each phone once before moving on in the dialplan. However, if any other strategy is
        used, we will only ring one phone since it cannot be guaranteed that a different phone will ring on subsequent attempts to ring a phone.

        As a side effect of this, the QUEUE_MEMBER_COUNT dialplan function now just reads the membercount variable instead of traversing through
        the member list to figure out how many members there are.

        Special thanks to blitzrage for helping to test this out.

        (closes issue ASTERISK-9813, reported by bcnit, patched by me, tested by blitzrage)

        ........

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

        Show
        Digium Subversion added a comment - Repository: asterisk Revision: 76804 ------------------------------------------------------------------------ r76804 | mmichelson | 2007-07-24 11:25:25 -0500 (Tue, 24 Jul 2007) | 21 lines Merged revisions 76801 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r76801 | mmichelson | 2007-07-24 11:26:58 -0500 (Tue, 24 Jul 2007) | 13 lines Added a membercount variable to call_queue struct which keeps track of the number of logged in members in a particular queue. This makes it so that the 'n' option for Queue() can act properly depending on which strategy is used. If the strategy is roundrobin, rrmemory, or ringall, we want to ring each phone once before moving on in the dialplan. However, if any other strategy is used, we will only ring one phone since it cannot be guaranteed that a different phone will ring on subsequent attempts to ring a phone. As a side effect of this, the QUEUE_MEMBER_COUNT dialplan function now just reads the membercount variable instead of traversing through the member list to figure out how many members there are. Special thanks to blitzrage for helping to test this out. (closes issue ASTERISK-9813 , reported by bcnit, patched by me, tested by blitzrage) ........ ------------------------------------------------------------------------

          People

          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development