aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_queue.c
AgeCommit message (Collapse)AuthorFilesLines
2008-05-30When joinempty=strict, it only failed on join if there were busy members. Iftilghman1-1/+1
all members were logged out OR paused, then it (incorrectly) let callers join the queue. (closes issue #12451) Reported by: davidw git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@119404 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-05Don't consider a caller "handled" until the caller is bridged withmmichelson1-2/+1
a queue member. There was too much of an opportunity for the member to hang up (either during a delay, announcement, or overly long agi) between the time that he answered the phone and the time when he actually was bridged with the caller. The consequence of this was that if the member hung up in that interval, then proper abandonment details would not be noted in the queue log if the caller were to hang up at any point after the member hangup. (closes issue #12561) Reported by: ablackthorn git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@115320 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-29Use the MACRO_CONTEXT and MACRO_EXTEN channel variables instead of the ↵mmichelson1-4/+9
channel's macrocontext and macroexten fields. This is needed because if macros are daisy-chained, the incorrect context and extension are placed on the new channel. I also added locking to the channel prior to accessing these variables as noted in trunk's janitor project file. (closes issue #12549) Reported by: darren1713 Patches: app_queue.c.macroextenpatch uploaded by darren1713 (license 116) (with modifications from me) Tested by: putnopvut git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114848 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-24Output of channel variables when eventwhencalled=vars was setmmichelson1-4/+4
was being truncated two characters. This patch corrects the problem. (closes issue #12493) Reported by: davidw git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114628 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-15Allow autofill to work in the general section of queues.conf.qwell1-2/+5
Additionally, don't try to (re)set options when they have empty values in realtime (all unset columns would have an empty value). (closes issue #12445) Reported by: atis Patches: 12445-autofill.diff uploaded by qwell (license 4) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114133 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-14If the datastore has been moved to another channel due to a masquerade, thenmmichelson1-2/+7
freeing the datastore here causes an eventual double free when the new channel hangs up. We should only free the datastore if we were able to successfully remove it from the channel we are referencing (i.e. the datastore was not moved). (closes issue #12359) Reported by: pguido git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114112 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-02Ensure that there is no timeout if none is specified.mmichelson1-1/+1
(closes issue #12349) Reported by: johnlange git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@112393 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-18This patch makes it so that all queue member status changes are handled ↵mmichelson1-96/+56
through device state code. This removes several problems people were seeing where their queue members would get into an "unknown" state. Huge props go to atis on this one since he was the one who found the code section that was causing the problem and proposed the solution. I just wrote what he suggested :) (closes issue #12127) Reported by: atis Patches: 12127v3.patch uploaded by putnopvut (license 60) Tested by: atis, jvandal git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@109713 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-28When using autofill, members who are in use should be counted towards the mmichelson1-0/+4
number of available members to call if ringinuse is set to yes. Thanks to jmls who brought this issue up on IRC git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105059 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-20Clear up confusion when viewing the QUEUE_WAITING_COUNT of a mmichelson1-0/+8
"dead" realtime queue. Since from the user's perspective, the queue does exist, we shouldn't tell them we couldn't find the queue. Instead since it is a dead queue, report a 0 waiting count This issue was brought up on IRC by jmls git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@103956 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-08Prevent a potential three-thread deadlock. Also added a comment blockmmichelson1-7/+22
to explicitly state the locking order necessary inside app_queue. (closes issue #11862) Reported by: flujan Patches: 11862.patch uploaded by putnopvut (license 60) Tested by: flujan git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@103120 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-30Fix a logic error with regards to autofill. Prior to this change, it was ↵mmichelson1-2/+3
possible for a caller to go out of turn if autofill were enabled and callers ahead in the queue were attempting to call a member. This change fixes this. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@101216 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-29Remove a memory leak from updating realtime queuesmmichelson1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@101035 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-29Fixing an erroneous return value returned when attempting to pause or ↵mmichelson1-2/+2
unpause a queue member fails. Fixes BE-366, thanks to John Bigelow for writing the patch. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@100973 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-14Fixing another compilation error. I'm a bit off today :(mmichelson1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@98737 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-14Oops. Last commit had compilation error.mmichelson1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@98734 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-14Adding explicit defaults for missing options to init_queue. This is ↵mmichelson1-0/+11
necessary because if a user either removes or comments one of these options and reloads their queues, the option will not reset to its default, instead maintaining the value from prior to the reload. Thanks to John Bigelow for pointing this error out to me. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@98733 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-09Part 2 of app_queue doxygen improvements. Some smaller functions this timemmichelson1-4/+11
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@97575 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-09use the \retval doxygen command properlymmichelson1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@97308 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-08Part 1 of N of adding doxygen comments to app_queue. I picked some of the ↵mmichelson1-3/+82
most common functions used (which also happen to be some the biggest/ugliest functions too) to document first. I'm pretty new to doxygen so criticism is welcome. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@97304 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-08Some coding guidelines-related cleanupmmichelson1-11/+11
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@97206 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-08Make app_queue calls work with directed pickup.file1-0/+10
(closes issue #11700) Reported by: jbauer git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@97093 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-02We need to reset the membername to NULL on each iteration of this loop, ↵mmichelson1-0/+1
otherwise the result is that multiple members can have the same name, since the variable was not reset on each iteration of the loop. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@96102 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-02A change to improve the accuracy of queue logging in the case where a member ↵mmichelson1-6/+23
does not answer during the specified timeout period. Prior to this change, there was a small chance that the member name recorded in this case would be blank. Also prior to this change, if using the ringall strategy, if no one answered the call during the specified timeout, the member name listed in the queue log would randomly be one of the members that was rung. (closes issue #11498, reported and tested by hloubser, patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@95890 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-28I found a bug while browsing the queue code and managed to reproduce it in a ↵mmichelson1-4/+2
small setup. If a queue uses the ringall strategy, it was possible through unfortunate coincidence for a single member at a given penalty level to make app_queue think that all members at that penalty level were unavailable and cause the members at the next penalty level to be rung. With this patch, we will only move to the next penalty level if ALL the members at a given penalty level are unreachable. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@95095 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-21Removing a debug message I accidentally just committedmmichelson1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@94464 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-21Fixing Portuguese syntax for saying dates and times. Also some coding ↵mmichelson1-0/+1
guidelines cleanup. (closes issue #11599, reported and patched by caio1982, coding guidelines cleanup by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@94420 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-17Issue 11574: Add dependencies on res_monitor and res_features. oej1-0/+4
I wonder if Asterisk can run at all without res_features. My guess is that there's propably a lot of more modules and the core that depends on it. Reported by: caio1982 (closes issue #11574) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@93182 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-12Removing an unused variable.mmichelson1-7/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@92443 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-11Fixing autofill to be more accurate. Specifically, if calls ahead of the currentmmichelson1-1/+4
caller were ringing members (but not yet bridged) there could be available members and waiting callers who would not get matched up. The member availability checker was correctly determining the number of available members in this scenario, but the queue itself did not parallelly reflect this status on the pending calls. This commit corrects the issue. (closes issue #11459, reported by equissoftware, patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@92323 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-10If there are no members in a queue, then the loop where the datastore for ↵mmichelson1-2/+4
detecting duplicate dialed numbers will be skipped, meaning the datastore isn't created. This means that when we try to free it, there's a crash. This stops that crash from occurring. (closes issue #11499, reported by slavon, patched by eliel) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@92202 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07* Add channel locking around datastore operations that expect the channelrussell1-17/+39
to be locked. * Document why we don't record Local channels in the dialed interfaces list. * Handle memory allocation failure. * Remove the dialed variable, as it wasn't actually needed. * Tweak some formatting to conform to coding guidelines. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91780 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07Allow dialing local channels from Queue() and Dial() again. There was a slightrussell1-3/+2
flaw in the code to prevent call forwards from looping that caused this problem. (related to issue #11486) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91677 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07Fix in an issue in the call forwarding handling code that was causing crashesrussell1-1/+2
on every call into a queue. I'm not entirely sure about the logic in this part of the code, so I want to look at it some more tomorrow. However, this makes it safe and keeps it from crashing. (closes issue #11486, reported by adamg, patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91675 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-03A big one...mmichelson1-1/+51
This is the merge of the forward-loop branch. The main change here is that call-forwards can no longer loop. This is accomplished by creating a datastore on the calling channel which has a linked list of all devices dialed. If a forward happens, then the local channel which is created inherits the datastore. If, through this progression of forwards and datastore inheritance, a device is attempted to be dialed a second time, it will simply be skipped and a warning message will be printed to the CLI. After the dialing has been completed, the datastore is detached from the channel and destroyed. This change also introduces some side effects to the code which I shall enumerate here: 1. Datastore inheritance has been backported from trunk into 1.4 2. A large chunk of code has been removed from app_dial. This chunk is the section of code which handles the call forward case after the channel has been requested but before it has been called. This was removed because call-forwarding still works fine without it, it makes the code less error-prone should it need changing, and it made this set of changes much less painful to just have the forwarding handled in one place in each module. 3. Two new files, global_datastores.h and .c have been added. These are necessary since the datastore which is attached to the channel may be created and attached in either app_dial or app_queue, so they need a common place to find the datastore info. This approach was taken in case similar datastores are needed in the future, there will be a common place to add them. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90735 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-02The other day when I went through making changes as a result of the ao2_link()russell1-2/+3
change, I added some code to set pointers to NULL after they were unreferenced. This pointed out that in this place, the object was unreferenced before the code was done using it. So, move the unref down a little bit. (crash reported by jmls on IRC) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90470 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-30Change the behavior of ao2_link(). Previously, in inherited a reference.russell1-0/+6
Now, it automatically increases the reference count to reflect the reference that is now held by the container. This was done to be more consistent with ao2_unlink(), which automatically releases the reference held by the container. It also makes it so it is no longer possible for a pointer to be invalid after ao2_link() returns. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90348 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-29This patch handles the case where a queue member with a negative penalty is ↵mmichelson1-1/+1
added via the manager. If a negative value is submitted for a member penalty, we set it to 0. (closes issue #11411, reported and patched by Laureano) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90163 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-28Fix a few memory leaks.file1-0/+1
(closes issue #11405) Reported by: eliel Patches: load_realtime.patch uploaded by eliel (license 64) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90101 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27Instead of depending on the return value of ast_true(), explicitly set therussell1-1/+1
eventwhencalled variable to 1. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89844 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27Two changes with regards to the 'eventwhencalled' option of queues.confmmichelson1-3/+3
1) Due to some signed vs. unsigned silliness, setting 'eventwhencalled' to 'vars' or 'yes' did exactly the same thing. Thus the sign change of the ast_true call. 2) The vars2manager function overwrote a \n for every channel variable it parsed, resulting in bizarre output for the channel variables. This patch remedies this. (related to issue #11385, however I'm not sure if this will actually be enough to close it) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89837 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21Fix a small error I made in my previous commitmmichelson1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89495 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21Changing an inaccurate debug message to be less inaccurate. Under the ↵mmichelson1-1/+1
circumstances, this message would always report that there were 0 members available, even though that may not be true. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89493 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16Make realtime queues accessible from the QUEUE_MEMBER_COUNT function.mmichelson1-10/+2
(closes issue #11271, reported and patched by atis, with small modifications from me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89323 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-07The member refcount must be incremented, to avoid using it after deallocation.tilghman1-0/+6
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: http://svn.digium.com/svn/asterisk/branches/1.4@89093 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-18If a non-existent file is specified to be played either as a periodic ↵mmichelson1-2/+2
announcement or as a hold/position announcement, the caller would be kicked out of the queue. No longer does this happen. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@86328 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17Changing the strategy field of the call_queue struct to be signed instead of ↵mmichelson1-1/+1
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: http://svn.digium.com/svn/asterisk/branches/1.4@86202 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-16Adding deprecated warning to monitor-join option, since the plan is tommichelson1-0/+10
no longer support this in favor of monitor-type = mixmonitor (related to issue #10885) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@86028 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-16Trying to remove a non-dynamic queue member via dynamic means can lead to somemmichelson1-1/+21
interesting (read nasty) situations. This patch clears up the issue by making only dynamic queue members removable via dynamic methods. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@85958 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-16Fixing a double free which happens in the statechange thread.mmichelson1-4/+0
(closes issue #10987, reported by andrew) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@85852 f38db490-d61c-443f-a65b-d21fe96a405b