Commit Graph

679 Commits

Author SHA1 Message Date
Matthew Nicholson
bdb62057a8 Merged revisions 265611 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r265611 | mnicholson | 2010-05-25 12:00:11 -0500 (Tue, 25 May 2010) | 15 lines
  
  Merged revisions 265610 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r265610 | mnicholson | 2010-05-25 11:48:19 -0500 (Tue, 25 May 2010) | 8 lines
    
    Don't mark the cdr records of unanswered queue calls with "NOANSWER".  This restores the behavior prior to r258670.
    
    (closes issue #17334)
    Reported by: jvandal
    Patches:
          queue-cdr-fixes1.diff uploaded by mnicholson (license 96)
    Tested by: aragon, jvandal
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@265612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-25 17:06:04 +00:00
Mark Michelson
032ae964b5 Fix memory hogging behavior of app_queue.
From reviewboard:
This review request is for the patch on issue 17081.

A user reported that he saw increasing numbers of allocations stemming
from app_queue.c when he would run the "queue show" CLI command. The
user reported that he was using approximately 40 realtime queues and
as he ran the CLI command more and more, the memory usage would shoot up.
As it turns out, there was a memory leak and a separate usage of memory
that, while not really a leak, was very irresponsible.

Both memory problems can be attributed to the function init_queue(). When
the "queue show" command is run, all realtime queues have the init_queue()
function called on the in-memory queue. The idea is to place the queue in
its default state and then overwrite options specified in the realtime backend
as we read them.

The first problem, the memory leak, had to do with the fact that the string
field for the name of the first periodic announcement file was being re-created
every time init_queue was called. This patch corrects the behavior by only
calling ast_str_create if the memory has not already been allocated. 

The other problem is a bit more complicated. The majority of the strings
in the call_queue structure were changed to use the ast_string_fields API
for 1.6.0 and beyond. init_queue resets all string fields on the queue to
their default values. Then, later in the realtime queue loading process,
these string fields are set to their configured values.

For those unfamiliar with string fields, frequent resizing of a string like
this is not what the string fields API is designed for. The result of this
constant resizing is that as the queue gets loaded, eventually space for
the string runs out and so a new memory pool, at twice the size of the
previously allocated one, is created for the string fields. The reporter
of issue 17081 wrote a script that ran the "queue show" CLI command 2100
times. By the end, each of his 40 queues was taking about a megabyte of
memory apiece just for their string fields.

My fix for this problem is to revert the call_queue structure from using
string fields. In my patch here, I have moved the queue back to using
fixed-sized buffers. I ran the script provided by the reporter of 17081
and determined that I no longer saw the steadily-increasing memory usage
that I had seen before applying the patch.

(closes issue #17081)
Reported by: wliegel
Patches:
      17081v2.patch uploaded by mmichelson (license 60)
Tested by: wliegel, mmichelson

Review: https://reviewboard.asterisk.org/r/651/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@265172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-21 21:57:24 +00:00
Mark Michelson
d3ae642446 Merged revisions 265090 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r265090 | mmichelson | 2010-05-21 16:08:51 -0500 (Fri, 21 May 2010) | 15 lines
  
  Merged revisions 265089 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r265089 | mmichelson | 2010-05-21 15:59:14 -0500 (Fri, 21 May 2010) | 8 lines
    
    Don't hang up on a queue caller if the file we attempt to play does not exist.
    
    This also fixes a documentation mistake in file.h that made my original attempt
    to correct this problem not work correctly.
    
    (closes issue #17061)
    Reported by: RoadKill
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@265091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-21 21:10:04 +00:00
Paul Belanger
b673bc6b2a Merged revisions 261232 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r261232 | pabelanger | 2010-05-05 11:42:07 -0400 (Wed, 05 May 2010) | 10 lines
  
  'queue reset stats' erroneously clears wrapuptime configuration.
  
  Resets each member's lastcall to 0 now.
  
  (closes issue #17262, #16519)
  Reported by: rain
  Patches:
        wrapuptime_reset_fix.diff uploaded by rain (license 327)
  Tested by: rain
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@261233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-05 15:59:38 +00:00
David Vossel
6a85387927 Merged revisions 247736 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r247736 | dvossel | 2010-02-18 14:58:41 -0600 (Thu, 18 Feb 2010) | 7 lines
  
  fixes Queue with C option crash
  
  (closes issue #16475)
  Reported by: okrief
  Patches:
        queue_crash.diff uploaded by dvossel (license 671)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@247737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-18 20:59:38 +00:00
Mark Michelson
35ef3bdbf8 Merged revisions 247169 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r247169 | mmichelson | 2010-02-17 10:24:54 -0600 (Wed, 17 Feb 2010) | 9 lines
  
  Merged revisions 247168 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r247168 | mmichelson | 2010-02-17 10:24:17 -0600 (Wed, 17 Feb 2010) | 3 lines
    
    Make sure that when autofill is disabled that callers not in the front of the queue cannot place calls.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@247172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 16:26:27 +00:00
David Vossel
e47219422b Merged revisions 246116 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r246116 | dvossel | 2010-02-10 11:49:34 -0600 (Wed, 10 Feb 2010) | 14 lines
  
  Merged revisions 246115 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r246115 | dvossel | 2010-02-10 11:44:20 -0600 (Wed, 10 Feb 2010) | 8 lines
    
    fixes random deadlock in app_queue with use_weight during reload
    
    (closes issue #16677)
    Reported by: tim_ringenbach
    Patches:
          app_queue_use_weight_deadlock.diff uploaded by tim ringenbach (license 540)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@246117 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10 17:51:34 +00:00
Jeff Peeler
9134d5bd14 Merged revisions 243693 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r243693 | jpeeler | 2010-01-27 14:37:33 -0600 (Wed, 27 Jan 2010) | 12 lines
  
  Merged revisions 243691 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r243691 | jpeeler | 2010-01-27 14:35:56 -0600 (Wed, 27 Jan 2010) | 5 lines
    
    Revert 243570, I should have looked at this closer. Will reopen the issue, but
    am leaving the review closed as the change was pointless.
    
    (issue #16488)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@243696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27 20:39:11 +00:00
Jeff Peeler
6564b7f7f6 Merged revisions 243571 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r243571 | jpeeler | 2010-01-27 12:49:52 -0600 (Wed, 27 Jan 2010) | 16 lines
  
  Merged revisions 243570 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r243570 | jpeeler | 2010-01-27 12:47:34 -0600 (Wed, 27 Jan 2010) | 9 lines
    
    Extend announcement URL used with Queue from 80 chars to PATH_MAX.
    
    (closes issue #16488)
    Reported by: syspert
    Patches: 
          soundfilelen.pacth-2 uploaded by syspert (license 938)
    
    Review: https://reviewboard.asterisk.org/r/475/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@243573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27 18:52:34 +00:00
David Vossel
2f2edec75b Merged revisions 240842 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r240842 | dvossel | 2010-01-18 09:52:55 -0600 (Mon, 18 Jan 2010) | 2 lines
  
  fixes spelling error.  s/memeber/member
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@240843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 15:53:25 +00:00
David Vossel
e0a98a3095 Merged revisions 238361 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r238361 | dvossel | 2010-01-07 12:58:23 -0600 (Thu, 07 Jan 2010) | 8 lines
  
  cli 'queue show' formatting fix.  queue name was truncated over 12 characters
  
  (closes issue #16078)
  Reported by: RoadKill
  Patches:
        quequename_limit.patch uploaded by ppyy (license 906)
  Tested by: dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@238362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-07 18:59:03 +00:00
David Vossel
c62bc1fd26 Merged revisions 237920 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r237920 | dvossel | 2010-01-05 17:08:50 -0600 (Tue, 05 Jan 2010) | 16 lines
  
  fixes holdtime playback issue in app_queue
  
  When reporting hold time, the number of seconds should be mod 60.
  Otherwise audio playback could be something like "2 minutes 123 seconds"
  rather than "2 minutes 3 seconds".
  
  Also, the "minute" sound file is missing, so for the moment until
  that file can be created the "minutes" file is used instead.
  
  (closes issue #16168)
  Reported by: nickilo
  Patches:
        patch-unified-trunk-rev-222176 uploaded by nickilo (license )
  Tested by: nickilo, wonderg
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@237921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05 23:09:25 +00:00
David Vossel
d54fa3e240 Merged revisions 237327 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r237327 | dvossel | 2010-01-04 10:39:11 -0600 (Mon, 04 Jan 2010) | 10 lines
  
  app_queue segfaults if realtime field uniqueid is NULL
  
  (closes issue #16385)
  Reported by: haakon
  Patches:
        app_queue.c.patch uploaded by haakon (license 880)
        app_queue.c.patch_v2 uploaded by dvossel (license 671)
  Tested by: haakon
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@237328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-04 16:50:24 +00:00
David Vossel
3423f2d8fe Merged revisions 231556 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r231556 | dvossel | 2009-11-30 12:55:07 -0600 (Mon, 30 Nov 2009) | 11 lines
  
  app_queue crashes randomly, often during call-transfers
  
  This patch adds a ref to the queue_ent object's parent call_queue
  in queue_exec() so the call_queue won't be destroyed
  while the the queue_ent still holds a pointer to it.
  
  (closes issue 0015686)
  Tested by: dvossel, aragon
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@231558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-30 18:57:02 +00:00
Tilghman Lesher
734c4b5bd8 Merged revisions 231134 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r231134 | tilghman | 2009-11-24 14:31:28 -0600 (Tue, 24 Nov 2009) | 7 lines
  
  Found a few places where queue refcounts were counted incorrectly.  Also add debug statements.
  (closes issue #15982, closes issue #15984)
   Reported by: atis
   Patches: 
         20091111__issue15982.diff.txt uploaded by tilghman (license 14)
   Tested by: atis
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@231136 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-24 20:36:01 +00:00
Kevin P. Fleming
6410aa2418 Merged revisions 222176 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r222176 | kpfleming | 2009-10-05 20:24:24 -0500 (Mon, 05 Oct 2009) | 27 lines
  
  Recorded merge of revisions 222152 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r222152 | kpfleming | 2009-10-05 20:16:36 -0500 (Mon, 05 Oct 2009) | 20 lines
    
    Fix ao2_iterator API to hold references to containers being iterated.
    
    See Mantis issue for details of what prompted this change.
    
    Additional notes:
    
    This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK
    has become an enum instead of a macro, with a name that fits our
    naming policy; also, it is now necessary to call
    ao2_iterator_destroy() on any iterator that has been
    created. Currently this only releases the reference to the container
    being iterated, but in the future this could also release other
    resources used by the iterator, if the iterator implementation changes
    to use additional resources.
    
    (closes issue #15987)
    Reported by: kpfleming
    
    Review: https://reviewboard.asterisk.org/r/383/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@222187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 01:39:07 +00:00
Matthias Nick
0b1d6d601c Merged revisions 221436 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r221436 | mnick | 2009-09-30 16:15:01 -0500 (Wed, 30 Sep 2009) | 2 lines
  
  Prevents from division by zero
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@221472 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 21:46:44 +00:00
Tilghman Lesher
b509ba227f Merged revisions 217990 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r217990 | tilghman | 2009-09-10 18:54:51 -0500 (Thu, 10 Sep 2009) | 10 lines
  
  Merged revisions 217989 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r217989 | tilghman | 2009-09-10 18:52:22 -0500 (Thu, 10 Sep 2009) | 3 lines
    
    Don't ring another channel, if there's not enough time for a queue member to answer.
    (Fixes AST-228)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@218052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-11 05:59:08 +00:00
Matthew Nicholson
7a0b0feb3c Merged revisions 211957 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r211957 | mnicholson | 2009-08-12 18:14:36 -0500 (Wed, 12 Aug 2009) | 17 lines
  
  Merged revisions 211953 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r211953 | mnicholson | 2009-08-12 18:04:02 -0500 (Wed, 12 Aug 2009) | 10 lines
    
    This patch adds additional checking when generating queue log TRANSFER events.
    
    The additional checks prevent generation of false TRANSFER events in certain situations.
    
    (closes issue #14536)
    Reported by: aragon
    Patches:
          queue-log-xfer-fix1.diff uploaded by mnicholson (license 96)
    Tested by: aragon, mnicholson
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@211959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-12 23:16:53 +00:00
Tilghman Lesher
9e94589304 AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@211580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:36:38 +00:00
Tilghman Lesher
74659ff9d6 Merged revisions 211040 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r211040 | tilghman | 2009-08-07 13:17:41 -0500 (Fri, 07 Aug 2009) | 21 lines
  
  Merged revisions 211038 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r211038 | tilghman | 2009-08-07 13:16:28 -0500 (Fri, 07 Aug 2009) | 14 lines
    
    QUEUE_MEMBER_LIST _really_ wants the interface name, not the membername.
    
    This is a partial revert of revision 82590, which was an attempted cleanup,
    but in reality, it broke QUEUE_MEMBER_LIST, which has always been intended
    as a method by which component interfaces could be queried from the queue.
    Membername isn't useful here, because that field cannot be used to obtain
    further information about the member.  See the documentation on
    QUEUE_MEMBER_LIST, RemoveQueueMember, QUEUE_MEMBER_PENALTY, and the various
    AMI commands which take a member argument for further justification.
    (closes issue #15664)
     Reported by: rain
     Patches: 
           app_queue-queue_member_list.diff uploaded by rain (license 327)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@211051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-07 18:20:04 +00:00
Mark Michelson
88aad0a21e Merged revisions 205350 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r205350 | mmichelson | 2009-07-08 14:26:55 -0500 (Wed, 08 Jul 2009) | 20 lines
  
  Merged revisions 205349 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r205349 | mmichelson | 2009-07-08 14:26:13 -0500 (Wed, 08 Jul 2009) | 14 lines
    
    Prevent phantom calls to queue members.
    
    If a caller were to hang up while a periodic announcement or position
    were being said, the return value for those functions would incorrectly
    indicate that the caller was still in the queue. With these changes,
    the problem does not occur.
    
    (closes issue #14631)
    Reported by: latinsud
    Patches:
          queue_announce_ghost_call2.diff uploaded by latinsud (license 745)
    	  (with small modification from me)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@205353 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 19:28:07 +00:00
Sean Bright
3eb08a23b4 Merged revisions 196792 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r196792 | seanbright | 2009-05-26 12:38:54 -0400 (Tue, 26 May 2009) | 2 lines
  
  Add a missing unref for queues in handle_statechange.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@196793 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26 16:39:39 +00:00
Tilghman Lesher
bb4849e44a Merged revisions 195370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r195370 | tilghman | 2009-05-18 15:52:33 -0500 (Mon, 18 May 2009) | 15 lines
  
  Recorded merge of revisions 195366 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r195366 | tilghman | 2009-05-18 15:24:13 -0500 (Mon, 18 May 2009) | 8 lines
    
    Add a similar dependency on SMDI for voicemail as already exists for ADSI.
    (closes issue #14846)
     Reported by: pj
     Patches: 
           20090413__bug14846__1.4.diff.txt uploaded by tilghman (license 14)
           20090507__issue14846__1.6.0.diff.txt uploaded by tilghman (license 14)
           20090507__issue14846__1.6.1.diff.txt uploaded by tilghman (license 14)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@195373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 20:55:15 +00:00
Matthew Nicholson
60b40fff10 Merged revisions 194057 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r194057 | mnicholson | 2009-05-12 17:32:13 -0500 (Tue, 12 May 2009) | 22 lines
  
  Merged revisions 194028 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r194028 | mnicholson | 2009-05-12 17:15:45 -0500 (Tue, 12 May 2009) | 16 lines
    
    This change modifies app_queue to properly generate CDR records in failure
    situations.
    
    This involves setting a proper cdr disposition coresponding to the given
    failure condition and ensuring the proper information is stored in the cdr
    record.
    
    (closes issue #13691)
    Reported by: dferrer
    Tested by: mnicholson
    
    (closes issue #13637)
    Reported by: atis
    Tested by: atis
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@194059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 22:48:14 +00:00
Mark Michelson
bc623d1bbb Merged revisions 193349 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r193349 | mmichelson | 2009-05-08 14:50:44 -0500 (Fri, 08 May 2009) | 12 lines
  
  Reset the members' call counts when resetting queue statistics.
  
  This helps to prevent odd scenarios where a queue will claim to have
  taken 0 calls, but the members appear to have taken a non-zero amount.
  
  (closes issue #15068)
  Reported by: sum
  Patches:
        patchreset.patch uploaded by sum (license 766)
  Tested by: sum
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@193350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-08 19:51:22 +00:00
Mark Michelson
fcdf30b1dc Merged revisions 190622 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r190622 | mmichelson | 2009-04-27 11:26:14 -0500 (Mon, 27 Apr 2009) | 3 lines
  
  Update warning message to not have pipes and contain all options.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@190625 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-27 16:28:07 +00:00
Mark Michelson
57ae82811a Merged revisions 190250 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r190250 | mmichelson | 2009-04-23 12:45:35 -0500 (Thu, 23 Apr 2009) | 9 lines
  
  Fix reversed behavior of leavewhenempty option in queues.conf.
  
  (closes issue #14650)
  Reported by: alecdavis
  Patches:
        14650.patch uploaded by mmichelson (license 60)
  Tested by: mmichelson, lmadsen
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@190253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-23 17:47:17 +00:00
Mark Michelson
b9e5c291fd Merged revisions 188470 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r188470 | mmichelson | 2009-04-14 18:28:13 -0500 (Tue, 14 Apr 2009) | 3 lines
  
  Fix a couple of queue member reference leaks.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@188474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-14 23:29:20 +00:00
Mark Michelson
9f89b72051 Merged revisions 188032 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r188032 | mmichelson | 2009-04-13 09:17:56 -0500 (Mon, 13 Apr 2009) | 6 lines
  
  Set all queue variables on both the caller and member channels.
  
  This allows for the variables to be accessed if a member macro is run.
  Thanks to Grigoriy Puzankin for bringing this up on the -dev list.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@188039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-13 14:20:46 +00:00
Mark Michelson
2d24cd16b9 Merged revisions 185604 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r185604 | mmichelson | 2009-03-31 17:12:52 -0500 (Tue, 31 Mar 2009) | 3 lines
  
  Fix trunk's compilation.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@185605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 22:13:14 +00:00
Mark Michelson
c4a426da37 Merged revisions 185600 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r185600 | mmichelson | 2009-03-31 17:02:48 -0500 (Tue, 31 Mar 2009) | 12 lines
  
  Merged revisions 185599 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r185599 | mmichelson | 2009-03-31 17:00:01 -0500 (Tue, 31 Mar 2009) | 6 lines
    
    Fix crash that would occur if an empty member was specified in queues.conf.
    
    (closes issue #14796)
    Reported by: pida
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@185603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 22:05:31 +00:00
Russell Bryant
fad34f595f Merged revisions 185261 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r185261 | russell | 2009-03-31 09:53:45 -0500 (Tue, 31 Mar 2009) | 5 lines

Don't free() an astobj2 object.

(closes issue #14672)
Reported by: makoto

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@185264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 14:59:13 +00:00
Mark Michelson
0551b7e9a1 Merged revisions 185072 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
  r185072 | mmichelson | 2009-03-30 11:26:48 -0500 (Mon, 30 Mar 2009) | 45 lines
  
  Merged revisions 185031 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r185031 | mmichelson | 2009-03-30 11:17:35 -0500 (Mon, 30 Mar 2009) | 39 lines
    
    Fix queue weight behavior so that calls in low-weight queues are not inappropriately blocked.
    
    (This is copied and pasted from the review request I made for this patch)
    
    Asterisk has some odd behavior when queue weights are used. The current logic used when
    potentially calling a queue member is:
    
    If the member we are going to call is part of another queue and _that other queue has any 
    callers in it_ and has a higher weight than the queue we are calling from, then don't try 
    to contact that member. The issue here is what I have marked with underscores. If the 
    higher-weighted queue has any callers in it at all, then the queue member will be unreachable 
    from the lower-weighted queue. This has the potential to be really really bad if using a 
    queue strategy, such as leastrecent or fewestcalls, with the potential to call the same 
    member repeatedly.
    
    The fix proposed by garychen on issue 13220 is very simple and, as far as I can see, works 
    well for this situation. With this set of changes, the logic used becomes:
    
    If the member we are going to call is part of another queue, the other queue has a higher 
    weight than the queue we are calling from, and the higher weight queue has at least as many 
    callers as available members, then do not try to contact the queue member. If the higher 
    weighted queue has fewer callers than available members, then there is no reason to deny 
    the call to this member since the other queue can afford to spare a member.
    
    Since the fix involved writing a generic function for determining the number of available 
    members in the queue, I also modified the is_our_turn function to make use of the new 
    num_available_members function to determine if it is our turn to try calling a member. There 
    is one small behavior change. Before writing this patch, if you had autofill disabled, then 
    if you were the head caller in a queue, you would automatically be told that it was your 
    turn to try calling a member. This did not take into account whether there were actually any 
    queue members available to take the call. Now we actually make sure there is at least one 
    member available to take the call if autofill is disabled.
    
    (closes issue #13220)
    Reported by: garychen
    
    Review: http://reviewboard.digium.com/r/202/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@185089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-30 16:52:29 +00:00
Russell Bryant
64f1321f14 Merged revisions 184693 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
r184693 | russell | 2009-03-27 11:21:10 -0500 (Fri, 27 Mar 2009) | 2 lines

Change global_app_buf to ast_str_thread_global_buf.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@184707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 16:25:13 +00:00
Mark Michelson
e4ae79101d Merged revisions 183244 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r183244 | mmichelson | 2009-03-19 13:10:34 -0500 (Thu, 19 Mar 2009) | 16 lines
  
  Fix a memory leak associated with queues.
  
  For every attempt that app_queue made to place an outbound call to a queue member,
  we would allocate a queue_end_bridge structure. When the bridge for the call had
  completed, we would free the structure. Unfortunately not all call attempts actually
  end up bridged to a member, so we need to be more selective of when to allocate
  the structure. With this change, the allocation occurs in an area where we can
  guarantee that the call will be bridged.
  
  (closes issue #14680)
  Reported by: caspy
  Patches:
        14680.patch uploaded by mmichelson (license 60)
  Tested by: caspy
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@183247 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 18:12:09 +00:00
Mark Michelson
b4fcc4a098 Change faulty comparison used when announcing average hold minutes and seconds
(closes issue #14227)
Reported by: caspy



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-13 21:26:20 +00:00
Mark Michelson
a1a9006163 Run the macro on the queue member's channel when he answers, not the caller's channel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-12 21:43:51 +00:00
Mark Michelson
d7d817d687 Fix segfault when dialing a typo'd queue
If trying to dial a non-existent queue, there would
be a segfault when attempting to access q->weight, even
though q was NULL. This problem was introduced during
the queue-reset merge and thus only affects trunk.

(closes issue #14643)
Reported by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 14:28:40 +00:00
Mark Michelson
8970f8caaa Merged revisions 180006 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r180006 | mmichelson | 2009-03-03 16:48:18 -0600 (Tue, 03 Mar 2009) | 17 lines
  
  Clarify some documentation of queues.conf.sample
  
  It had always been possible to explicitly specify a "blank"
  value for a sound file in queues.conf and have no sound played
  back. The problem with this is that it would result in some ugly
  CLI warnings from file.c.
  
  This commit introduces a check when playing a file in app_queue
  to see if the name of the file is zero-length and return early if
  that is the case. Also, the ability to specify the blank sound
  files in queues.conf is now mentioned more clearly in queues.conf.sample
  
  (closes issue #14227)
  Reported by: caspy
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 22:49:07 +00:00
Russell Bryant
184872fdfd Fix a race condition that caused device states to become incorrect for hints.
The problem here is that the hint processing code was subscribed to the wrong
event type.  So, it started processing state for a hint too soon, before the
device state cache had been updated.

Also, fix a similar bug in app_queue, as it was also subscribed to the wrong
event type.

(closes issue #14461)
Reported by: alecdavis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 17:33:38 +00:00
Mark Michelson
3c9667ae12 Merge queue-reset branch to Asterisk
From a user point-of-view, this adds new CLI commands and Manager Actions to
better facilitate the reloading of queues and the resetting of their statistics.

The new CLI commands are the "queue reload" and "queue reset stats" commands.

The new manager actions are the QueueReload and QueueReset commands.

Review: http://reviewboard.digium.com/r/115



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-13 20:57:37 +00:00
Mark Michelson
0d5da5f436 Fix a bit of odd logic for announcing position. Sync with 1.6.0's logic
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-11 23:12:57 +00:00
Mark Michelson
34161542e9 Fix odd "thank you" sound playing behavior in app_queue.c
If someone has configured the queue to play an position or holdtime
announcement, then it is odd and potentially unexpected to hear a 
"Thank you for your patience" sound when no position or holdtime
was actually announced.

This fixes the announcement so that the "thanks" sound is only played
in the case that a position or holdtime was actually announced.

There is a way that the "thank you" sound can be played without a
position or holdtime, and that is to set announce-frequency to a value
but keep announce-position and announce-holdtime both turned off.

(closes issue #14227)
Reported by: caspy
Patches:
      14227_v3.patch uploaded by putnopvut (license 60)
Tested by: caspy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174948 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-11 23:03:08 +00:00
Mark Michelson
2e1d9f9a21 Merged revisions 173692 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r173692 | mmichelson | 2009-02-05 14:29:09 -0600 (Thu, 05 Feb 2009) | 12 lines

Fix situations where queue members could be autopaused unexpectedly

Specifically, this patch prevents us from autopausing members when
we receive a busy or congestion frame from them.

(closes issue #14376)
Reported by: fiddur
Patches:
      14376.patch uploaded by putnopvut (license 60)
Tested by: fiddur


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-05 20:30:45 +00:00
Mark Michelson
172777bd02 Fix some areas where the incorrect interface was passed to ast_device_state
I swear it feels like I already did this once...

(closes issue #14359)
Reported by: francesco_r


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-04 22:16:19 +00:00
Olle Johansson
7ecda45482 Fix "cancel answered elsewhere" through app_queue with members in chan_local.
Also, implement a private cause code (as suggested by Tilghman). This works with
chan_sip, but doesn't propagate through chan_local.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-29 17:08:22 +00:00
Olle Johansson
097822966b Add final part of previously committed work for answered elsewhere in queue - the missing piece that started with app_dial() earlier on.
This is to avoid having the list and counter of missed calls being touched by queue calls. Add the C option to queue() and nothing 
will be logged on phones that support the Reason: header on SIP cancel, like the SNOM phones.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@171924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-28 14:37:16 +00:00
Mark Michelson
04e56bde03 Fix queue crashes that would occur after the calling channel was masqueraded.
The data passed to the end_bridge_callback was assumed to be data which was
still stack'd. The problem was that with some call features, attended transfers
in particular, a new bridge thread is started once the feature completes, meaning
that when the end_bridge_callback is called, the end_bridge_callback_data was
invalid.

To fix this problem, there are two measures taken

1. Instead of pointing to stacked data, we now used heap-allocated data for
passing to the end_bridge_callback in app_queue
2. Since bridges can end multiple times on a single logical call, we wait until
the final bridge is broken to actually set any queue variables. This is accomplished
through reference-counting and the use of an end_bridge_callback_data_fixup function
in app_queue.c

(closes issue #14260)
Reported by: ccesario
Patches:
      14260.patch uploaded by putnopvut (license 60)
Tested by: ccesario



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@171618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-27 19:30:54 +00:00
Mark Michelson
4263503bd5 Fix device state parsing issues for channel names with multiple slashes
The fix being applied is a bit different for trunk and the 1.6.X branches.
For trunk, we only wish to strip off the characters beyond the second slash
if the channel is a Local channel (i.e. we are removing the /n from the device
name). Other channel technologies with multiple slashes (e.g. DAHDI) need the
information after the second slash in order to get the proper device state
information.

In addition to this fix, the 1.6.X branches are receiving a much more important
fix as well. The problem in 1.6.X is that the member's device name was being directly
changed instead of having a copy changed. This meant that we would strip off the
second slash and trailing characters and then leave the member's device name like
that permanently thereafter.

(closes issue #14014)
Reported by: kebl0155
Patches:
      14014_number2.patch uploaded by putnopvut (license 60)
Tested by: kebl0155



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-21 00:33:32 +00:00