summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
AgeCommit message (Collapse)Author
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Merged revisions 89323 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89323 | mmichelson | 2007-11-16 09:28:22 -0600 (Fri, 16 Nov 2007) | 5 lines Make realtime queues accessible from the QUEUE_MEMBER_COUNT function. (closes issue #11271, reported and patched by atis, with small modifications from me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89324 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14make the 'name' and 'value' fields in ast_variable const char *Luigi Rizzo
This prevents modifying the strings in the stored variables, and catched a few instances where this was actually done. Given the differences between trunk and 1.4 (and the fact that this is effectively an API change) it is better to fix 1.4 independently. These are chan_sip.c::sip_register() chan_skinny.c:: near line 2847 config.c:: near line 1774 logger.c::make_components() res_adsi.c:: near line 1049 I may have missed some instances for modules that do not build here. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14Instead of reserving 800 bytes for periodic announcements, use an array ofRussell Bryant
ast_str pointers and only alloate space for the strings as needed. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14Convert most of the strings in the call_queue struct to use stringfields.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12Based on a note in asterisk-dev by Brian Capouch, I determined I too ↵Steve Murphy
agressive in not initializing arrays passed to pbx_substitute_variables_xxxx; I reviewed the code (again) and hopefully found every possible spot where substitute_variables is called conditionally, and made sure the char array involved was set to a null string. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08improve linked-list macros in two ways:Kevin P. Fleming
- the *_CURRENT macros no longer need the list head pointer argument - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07Merged revisions 89093 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89093 | tilghman | 2007-11-07 17:39:37 -0600 (Wed, 07 Nov 2007) | 7 lines The member refcount must be incremented, to avoid using it after deallocation. A huge thanks go to lvl- for patiently providing the necessary valgrind output that was necessary to finding this problem of memory corruption. Reported by: lvl- Patch by: tilghman Closes issue #11174 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Adding the queue strategy wrandomMark Michelson
(closes issue #10942, reported and patched by julianjm, documentation changes by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Added CLI and manager commands for changing a queue member's penaltyMark Michelson
(closes issue #9374, reported and initially patched by wuwu, intermediate patch by eliel, and final patch by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89068 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01This commits the performance mods that give the priority processing engine ↵Steve Murphy
in the pbx, a 25-30% speed boost. The two updates used, are, first, to merge the ast_exists_extension() and the ast_spawn_extension() where they are called sequentially in a loop in the code, into a slightly upgraded version of ast_spawn_extension(), with a few extra args; and, second, I modified the substitute_variables_helper_full, so it zeroes out the byte after the evaluated string instead of demanding you pre-zero the buffer; I also went thru the code and removed the code that zeroed this buffer before every call to the substitute_variables_helper_full. The first fix provides about a 9% speedup, and the second the rest. These figures come from the 'PIPS' benchmark I describe in blogs, conf. reports, etc. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-29Adding the more flexible QUEUE_MEMBER function to replace the ↵Mark Michelson
QUEUE_MEMBER_COUNT function. A deprecation notice will be issued the first time QUEUE_MEMBER_COUNT is used. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-26Added queue strategy "linear". This strategy is useful for those who always ↵Mark Michelson
wish for their phones to be rung in a specific order. (closes issue #7279, reported and initially patched by diLLec, patch reworked by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-24Adding the general option "shared_lastcall" to queues so that a member's ↵Mark Michelson
wrapuptime may be used across multiple queues. (closes issue #9777, reported and patched by eliel) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former ↵Jason Parker
didn't make much sense git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19Convert NEW_CLI to AST_CLI.Jason Parker
Closes issue #11039, as suggested by seanbright. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-18Merged revisions 86328 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r86328 | mmichelson | 2007-10-18 12:38:26 -0500 (Thu, 18 Oct 2007) | 5 lines If a non-existent file is specified to be played either as a periodic announcement or as a hold/position announcement, the caller would be kicked out of the queue. No longer does this happen. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-18Changed some spaces to tabsMark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-17Merged revisions 86202 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r86202 | mmichelson | 2007-10-17 16:39:05 -0500 (Wed, 17 Oct 2007) | 6 lines Changing the strategy field of the call_queue struct to be signed instead of unsigned, since the code attempts to set the strategy to -1 if you specify a bogus strategy. While this isn't a huge issue in 1.4, it could be a problem for someone who, say, tries to use the roundrobin strategy in trunk (despite all the deprecation warnings in 1.4). ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16Removed the monitor-join option. If one wishes to mix audio, they should ↵Mark Michelson
instead use monitor-type=mixmonitor. (related to issue #10885) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16Fixing the build.Mark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16Merged revisions 85958 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85958 | mmichelson | 2007-10-16 16:14:34 -0500 (Tue, 16 Oct 2007) | 5 lines Trying to remove a non-dynamic queue member via dynamic means can lead to some interesting (read nasty) situations. This patch clears up the issue by making only dynamic queue members removable via dynamic methods. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15Merged revisions 85720 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85720 | russell | 2007-10-15 16:10:02 -0500 (Mon, 15 Oct 2007) | 3 lines Ensure that no pending state changes are leaked when the device state change thread gets stopped on module unload. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-12Allow for the position announcement to be turned off if desired.Mark Michelson
(closes issue #8515, reported by bruno_rocha, initial patch by bruno_rocha, final patch by qwell) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-09Patch to add one-touch parking for queues.Mark Michelson
(closes issue #10869, reported and patched by bluecrow76) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-04A two-in-one patch from the bugtrackerMark Michelson
1) Fix some bad logic in the counting of statistics for QueueSummary manager event. Variables were not being reset for each additional queue, so cumulative totals were reported on each successive queue. 2) Add a longest hold time stat to QueueSummary manager event. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-04Merged revisions 84692 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84692 | mmichelson | 2007-10-04 16:57:03 -0500 (Thu, 04 Oct 2007) | 5 lines Don't allocate space for queue members unless it's needed. You end up deleting dynamic members on a reload. Not good. closes issue (#10879, reported by dazza76, patched by me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-04Merged revisions 84637 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84637 | file | 2007-10-04 11:51:57 -0300 (Thu, 04 Oct 2007) | 4 lines Create a duplicate of the channel's member name as the tab completion stuff will free it. (closes issue #10884) Reported by: adamg ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-24interface_exists_global was never returning 1. Most likely an error from my ↵Mark Michelson
merge on Friday. (closes issue #10817, reported and patched by snar, patch simplified by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-21Fix some areas where we were still using '|' for an argument delimiter ↵Tilghman Lesher
(closes issue #10793) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-21Update app_queue to use commas as application argument separators.Russell Bryant
(closes issue #10793, snar) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-20Merging changes from queue_refcount_trunk into trunk. Refcounted queues now ↵Mark Michelson
in place. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19More conversions to NEW_CLIJason Parker
(issue #10724) Patches: chan_zap.c.patch uploaded by moy (license 222) app_queue.c.patch uploaded by eliel (license 64) app_voicemail.c.patch uploaded by eliel (license 64) app_meetme.c.patch uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19Merged revisions 83074 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r83074 | file | 2007-09-19 10:47:59 -0300 (Wed, 19 Sep 2007) | 6 lines Protect the CDR record from modification by pbx_exec so that the application data contains the Queue data. (closes issue #10761) Reported by: snar Patches: app-queue-mixmonitor.patch uploaded by snar (license 245) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18Merged revisions 82961 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82961 | file | 2007-09-18 20:41:02 -0300 (Tue, 18 Sep 2007) | 2 lines Initialize a variable to NULL to make the world happy. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18Merged revisions 82865 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82865 | mmichelson | 2007-09-18 15:09:02 -0500 (Tue, 18 Sep 2007) | 4 lines Moving the logic for handling an empty membername to the create_member function so that there is a common place where this occurs instead of being spread out to several different places. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18Merged revisions 82834 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82834 | kpfleming | 2007-09-18 13:59:52 -0500 (Tue, 18 Sep 2007) | 2 lines there is no need for conditional logic to select ->interface or ->membername, snince ->membername will always be populated ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82835 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18(closes issue #10755)Jason Parker
Reported by: snar Patches: app-queue-cdr-trunk.patch uploaded by snar (license 245) queues.conf.patch uploaded by snar (license 245) Add an updatecdr option to queues.conf, so that if a "member name" is specified, the cdr record will be updated with that, rather than the channel. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82800 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17Make the MALLOC_DEBUG output for free() useful again. After changing calls toRussell Bryant
free to be ast_free, astmm said all calls to free were coming from utils.h git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17Merged revisions 82590,82592 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82590 | kpfleming | 2007-09-17 11:33:30 -0500 (Mon, 17 Sep 2007) | 2 lines fix a couple of places where a logical member name (if specified) was not used, but instead the direct interface was listed ........ r82592 | kpfleming | 2007-09-17 11:40:12 -0500 (Mon, 17 Sep 2007) | 2 lines revert a change that wasn't supposed to be committed... doh! ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14Merged revisions 82396 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82396 | mmichelson | 2007-09-14 13:28:36 -0500 (Fri, 14 Sep 2007) | 5 lines Adding member name field to manager events where they were missing before (closes issue #10721, reported by snar) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13Changed "in" to "queue" in "queue {pause|unpause} member" command to be more ↵Mark Michelson
clear. Also added check to be sure that sixth argument is the word "reason" if full command is given git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13Added the ability to pause and unpause members via the CLIMark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13Merged revisions 82346 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82346 | mmichelson | 2007-09-13 15:16:37 -0500 (Thu, 13 Sep 2007) | 4 lines Preemptively fixing a possible segfault. It is possible that queuename is NULL (meaning pause ALL queues), so use q->name instead. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13Merged revisions 82326 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82326 | mmichelson | 2007-09-13 11:25:59 -0500 (Thu, 13 Sep 2007) | 7 lines Added logic to handle the unlikely case that someone has two queues with the same name. Asterisk will log a warning message letting the user know that one was already defined with that name and is it skipping all further instances. This also will work for realtime queues but in order for that to happen, the user would have to trigger a perfectly timed reload as a realtime queue is being looked up, which is highly unlikely (but taken care of nonetheless). ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13Fix a missing unref of a member struct. This was pointed out by Marta. Thanks!Russell Bryant
This function in 1.4 didn't have the problem. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12Removed an unneeded ao2_ref. This was a problem because unless ↵Mark Michelson
get_member_status returned QUEUE_NORMAL, a NULL member would be unreferenced. While this didn't cause any crashes or anything terrible, it still is incorrect git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12Merged revisions 82274 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82274 | mmichelson | 2007-09-12 09:24:53 -0500 (Wed, 12 Sep 2007) | 6 lines We should only initialize a realtime queue when it is allocated, not every time we access it. This prevents the members ao2_container from being reallocated every time the queue is accessed. I also removed a debug message I had accidentally left in on a previous commit. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11Merged revisions 82267 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82267 | russell | 2007-09-11 17:37:17 -0500 (Tue, 11 Sep 2007) | 3 lines Fix incorrect uses of ao2_find(). Every one of these calls was reading bogus memory ... ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-11Merged revisions 82263 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82263 | russell | 2007-09-11 15:49:34 -0500 (Tue, 11 Sep 2007) | 5 lines Fix another missing unref of member objects. This one was pointed out by Marta. When building the outgoing list in try_calling(), a member reference is stored in each outgoing entry. However, when this list got destroyed, the reference was not released. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82264 65c4cc65-6c06-0410-ace0-fbb531ad65f3