summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
AgeCommit message (Collapse)Author
2013-07-14Provide error message for QUEUE_MEMBER when member is not in queueMatthew Jordan
When QUEUE_MEMBER is used and the member specified is not in the queue, Asterisk provides an ERROR message that indicates that the option specified is not valid. This patch now properly displays an ERROR message that the member is not in the queue if an interface is specified. (closes issue ASTERISK-21980) Reported by: Avraam David ........ Merged revisions 394345 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-01Refactor extraneous channel eventsKinsey Moore
This change removes JitterBufStats, ChannelReload, and ChannelUpdate and refactors the following events to travel over Stasis-Core: * LocalBridge * DAHDIChannel * AlarmClear * SpanAlarmClear * Alarm * SpanAlarm * DNDState * MCID * SIPQualifyPeerDone * SessionTimeout Review: https://reviewboard.asterisk.org/r/2627/ (closes issue ASTERISK-21476) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393284 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-25CEL refactoring cleanupKinsey Moore
This change removes AST_CEL_BRIDGE_UPDATE since it should no longer be used because masquerade situations are now accounted for in other ways. This also refactors usage of AST_CEL_FORWARD to be produced by a Dial message which has been extended with a "forward" field. (closes issue ASTERISK-21566) Review: https://reviewboard.asterisk.org/r/2635/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17Update Asterisk's CDRs for the new bridging frameworkMatthew Jordan
This patch is the initial push to update Asterisk's CDR engine for the new bridging framework. This patch guts the existing CDR engine and builds the new on top of messages coming across Stasis. As changes in channel state and bridge state are detected, CDRs are built and dispatched accordingly. This fundamentally changes CDRs in a few ways. (1) CDRs are now *very* reflective of the actual state of channels and bridges. This means CDRs track well with what an actual channel is doing - which is useful in transfer scenarios (which were previously difficult to pin down). It does, however, mean that CDRs cannot be 'fooled'. Previous behavior in Asterisk allowed for CDR applications, channels, and other properties to be spoofed in parts of the code - this no longer works. (2) CDRs have defined behavior in multi-party scenarios. This behavior will not be what everyone wants, but it is a defined behavior and as such, it is predictable. (3) The CDR manipulation functions and applications have been overhauled. Major changes have been made to ResetCDR and ForkCDR in particular. Many of the options for these two applications no longer made any sense with the new framework and the (slightly) more immutable nature of CDRs. There are a plethora of other changes. For a full description of CDR behavior, see the CDR specification on the Asterisk wiki. (closes issue ASTERISK-21196) Review: https://reviewboard.asterisk.org/r/2486/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10Add announce-to-first-user option for app_queueMatthew Jordan
In r386792, the ability to play prompts to the first caller in a call queue was added. While this is arguably a bug fix for those who expect the first caller to continue receiving prompts while the agent is dialed, it has the side effect of preventing the first caller from hearing the agent immediately upon bridging. This may not be a problem for those who really want this option, but for those who didn't care whether or not the first caller in queue heard their position, it was an issue. This patch disables the ability for the first caller in the queue to hear prompts and adds a new option, announce-to-first-user, to queues.conf. Those who the behavior can enable it by setting this value to True. Note that if we ever implement the ability to have the prompts be stopped upon bridging, this option can be removed. (closes issue ASTERISK-21782) Reported by: Remi Quezada ........ Merged revisions 391215 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 391241 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391245 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-07Make app_queue AMI events more consistent. Give Join/Leave more useful names.Jason Parker
This also removes the eventwhencalled and eventmemberstatus configuration options. These events can just be filtered via manager.conf blacklists. (closes issue ASTERISK-21469) Review: https://reviewboard.asterisk.org/r/2586/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-22Add dial events to app_queue and app_followme.Jason Parker
Also fixes an issue in app_dial, where the channels were swapped on dial events. (closes issue ASTERISK-21551) (closes issue ASTERISK-21550) Review: https://reviewboard.asterisk.org/r/2549/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-21Conditional out more app_queue logging that needs to be reworked.Richard Mudgett
Fixes crash because app_queue was unconditionally freeing a datastore that was still on a channel. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-21Merge in the bridge_construction branch to make the system use the Bridging API.Richard Mudgett
Breaks many things until they can be reworked. A partial list: chan_agent chan_dahdi, chan_misdn, chan_iax2 native bridging app_queue COLP updates DTMF attended transfers Protocol attended transfers git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-17Fix shutdown assertions in stasis-coreDavid M. Lee
In r388005, macros were introduced to consistently define message types. This added an assert if a message type was used either before it was initialized or after it had been cleaned up. It turns out that this assertion fires during shutdown. This actually exposed a hidden shutdown ordering problem. Since unsubscribing is asynchronous, it's possible that the message types used by the subscription could be freed before the final message of the subscription was processed. This patch adds stasis_subscription_join(), which blocks until the last message has been processed by the subscription. Since joining was most commonly done right after an unsubscribe, a stasis_unsubscribe_and_join() convenience function was also added. Similar functions were also added to the stasis_caching_topic and stasis_message_router, since they wrap subscriptions and have similar problems. Other code in trunk was refactored to join() where appropriate, or at least verify that the subscription was complete before being destroyed. Review: https://reviewboard.asterisk.org/r/2540 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-09Fix Segfault In app_queue When "persistentmembers" Is Enabled And Using RealtimeMichael L. Young
When the "ignorebusy" setting was deprecated, we added some code to allow us to be compatible with older setups that are still using the "ignorebusy" setting instead of "ringinuse". We set a char *variable with the column name to use, which helps the realtime functions to use the correct column in their SQL queries. When "persistentmembers" is enabled, we are not setting this variable before the realtime functions were called to load members. This results in the variable being NULL and therefore causing a segfault when loading members during the module's process of loading. The solution was to move the code that sets that variable to be before these realtime functions are called during the loading of the module. (closes issue ASTERISK-21738) Reported by: JoshE Tested by: JoshE Patches: asterisk-21738-rt-ringinuse-field-not-set.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2499/ ........ Merged revisions 388108 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-29Play periodic prompts for first call in a call queueOlle Johansson
Review: https://reviewboard.asterisk.org/r/2263/ ........ Merged revisions 386792 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 386794 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-16Move device state distribution to Stasis-coreKinsey Moore
In the move from Asterisk's event system to Stasis, this makes distributed device state aggregation always-on, removes unnecessary task processors where possible, and collapses aggregate and non-aggregate states into a single cache for ease of retrieval. This also removes an intermediary step in device state aggregation. Review: https://reviewboard.asterisk.org/r/2389/ (closes issue ASTERISK-21101) Patch-by: Kinsey Moore <kmoore@digium.com> git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-12Fix Manager Segfault When app_queue Is UnloadedMichael L. Young
When app_queue is unloaded, some manager commands are not being unregistered which result in a segfault. This patch corrects this. (closes issue ASTERISK-21397) Reported by: Peter Katzmann, Corey Farrell Tested by: Corey Farrell Patches: asterisk-21397-missing-unreg-manager-cmd_1.8.diff Michael L. Young (license 5026) asterisk-21397-missing-unreg-manager-cmd_11.diff Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2444/ ........ Merged revisions 385593 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 385594 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14Revamp of terminal color codesKinsey Moore
The core module related to coloring terminal output was old and needed some love. The main thing here was an attempt to get rid of the obscene number of stack-local buffers that were allocated for no other reason than to colorize some output. Instead, this uses a simple trick to allocate several buffers within threadlocal storage, then automatically rotates between them, so that you can make multiple calls to the colorization routine within one function and not need to allocate multiple buffers. Review: https://reviewboard.asterisk.org/r/2241/ Patches: bug.patch uploaded by Tilghman Lesher git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-09app_queue: Fix incorrect assertion.Richard Mudgett
(issue ASTERISK-16115) ........ Merged revisions 378689 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 378690 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-08app_queue: Fix multiple calls to a queue member that is in only one queue.Richard Mudgett
When ringinuse=no queue members can receive more than one call if these calls happen at nearly the same time. * Fix so a queue member does not receive more than one call from a queue. NOTE: This fix does not prevent multiple calls to a member if the member is in more than one queue. * Did some refactoring to eliminate some code redundancy. (issue ASTERISK-16115) Reported by: nik600 Patches: jira_asterisk_16115_single_q_v1.8.patch (license #5621) patch uploaded by rmudgett Modified * Revert the -r341580 and -r341599 changes adding the queues.conf check_state_unknown option as it was added in an attempt to fix this problem. The fix did not need to be optional. The fix should not have tried to explicitly set the device state. Setting the device state by something other than the device introduces a race condition. I also could not see how the change would be effective other than delaying the app_queue code long enough for the device state to propagate to app_queue. ........ Merged revisions 378663 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378683 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 378687 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-03Fix Queue Log Reporting Every Call COMPLETECALLER With "h" Extension PresentMichael L. Young
When the "h" extension is present within the context of the queue, all calls are being reported COMPLETECALLER even when the agent is hanging up the call. This patch checks to see if the agent hung-up or not instead of only relying on checking if the queue (caller) channel hung-up or not. It would appear that having the h extension in the mix, the pbx goes to the h extension, "hanging-up" the queue channel and triggering the reporting of COMPLETECALLER. (closes issue ASTERISK-20743) Reported by: call Tested by: call, Michael L. Young Patches: asterisk-20743-q-cmplt-caller.diff uploaded by Michael L. Young (license 5026) Review: https://reviewboard.asterisk.org/r/2256/ ........ Merged revisions 378514 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378515 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02Prevent exhaustion of system resources through exploitation of event cacheMatthew Jordan
Asterisk maintains an internal cache for devices in the event subsystem. The device state cache holds the state of each device known to Asterisk, such that consumers of device state information can query for the last known state for a particular device, even if it is not part of an active call. The concept of a device in Asterisk can include entities that do not have a physical representation. One way that this occurred was when anonymous calls are allowed in Asterisk. A device was automatically created and stored in the cache for each anonymous call that occurred; this was possible in the SIP and IAX2 channel drivers and through channel drivers that utilized the res_jabber/res_xmpp resource modules (Gtalk, Jingle, and Motif). These devices are never removed from the system, allowing anonymous calls to potentially exhaust a system's resources. This patch changes the event cache subsystem and device state management to no longer cache devices that are not associated with a physical entity. (issue ASTERISK-20175) Reported by: Russell Bryant, Leif Madsen, Joshua Colp Tested by: kmoore patches: event-cachability-3.diff uploaded by jcolp (license 5000) ........ Merged revisions 378303 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378320 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 378321 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-14app_queue: Revert bad ringinuse=no patch.Richard Mudgett
With the option ringinuse=no set, the patch committed for ASTERISK-16115 causes non-SIP queue members to never be called because the device state is checked after a channel is created to determine if the member is busy. These queue members always get the "Member %s is busy, cannot dial" message. Most channel drivers other than chan_sip use the default device state handling. The default device-state state is considered in use or unknown if the channel exists or not respectively. (closes issue ASTERISK-20801) Reported by: rmudgett Patches: jira_asterisk_16115_revert_r370418_v1.8.patch (license #5621) patch uploaded by rmudgett ........ Merged revisions 378036 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 378037 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 378038 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-14app_queue: Make update_status() not return anything.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07Multiple revisions 375993-375994Mark Michelson
........ r375993 | mmichelson | 2012-11-07 11:01:13 -0600 (Wed, 07 Nov 2012) | 30 lines Fix misuses of timeouts throughout the code. Prior to this change, a common method for determining if a timeout was reached was to call a function such as ast_waitfor_n() and inspect the out parameter that told how many milliseconds were left, then use that as the input to ast_waitfor_n() on the next go-around. The problem with this is that in some cases, submillisecond timeouts can occur, resulting in the out parameter not decreasing any. When this happens thousands of times, the result is that the timeout takes much longer than intended to be reached. As an example, I had a situation where a 3 second timeout took multiple days to finally end since most wakeups from ast_waitfor_n() were under a millisecond. This patch seeks to fix this pattern throughout the code. Now we log the time when an operation began and find the difference in wall clock time between now and when the event started. This means that sub-millisecond timeouts now cannot play havoc when trying to determine if something has timed out. Part of this fix also includes changing the function ast_waitfor() so that it is possible for it to return less than zero when a negative timeout is given to it. This makes it actually possible to detect errors in ast_waitfor() when there is no timeout. (closes issue ASTERISK-20414) reported by David M. Lee Review: https://reviewboard.asterisk.org/r/2135/ ........ r375994 | mmichelson | 2012-11-07 11:08:44 -0600 (Wed, 07 Nov 2012) | 3 lines Remove some debugging that accidentally made it in the last commit. ........ Merged revisions 375993-375994 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375995 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 376014 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-29Ensure that CDRs for a caller in a Queue that is not answered is NO ANSWER.Matthew Jordan
When a caller enters a queue and no queue member answers the call, the current behaviour can be a little odd depending on the paused status of the queue members. If any queue member is paused, but not all, the CDR disposition will be BUSY. If all queue members are paused, then the CDR disposition is based instead on the disposition of the call prior to entering the Queue. This patch modifies the behaviour in the following ways: * If no queue members are paused, the CDR disposition is whatever the disposition was prior to going into Queue. If the call was answered this will be ANSWERED; otherwise, it is NO ANSWER. * If some queue members are pused, the CDR result is NO ANSWER. (This is a change in behaviour, as the result would previously have been BUSY) * If all queue members are paused, the CDR result is whatever the result was prior to going into Queue. This is the same as the behaviour prior to this patch. * If the caller hangs up, times out, or presses '*' with the 'h' option, the CDR disposition is again not set and is dependent on whether or not the caller was Answered prior to entering Queue. This patch was based on one provided by Thomas Arimont, but has been modified to accomodate findings by the reviewers. Review: https://reviewboard.asterisk.org/r/2064/ (closes issue AST-906) Reported by: Thomas Arimont (closes issue ASTERISK-17776) Reported by: Attila Megyeri git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-18app_queue: Make ordering of rrmemory/rrordered persist over add/remove membersJonathan Rose
Prior to this patch, adding, removing or reloading members to rrmemory would cause the order to become completely jumbled. Now it behaves more or less like rrordered other than the fact that it stores the members on a hash table rather than a linked list. This patch also prevents removal of members and member reloads from jumbling rrordered queues. (issue AST-989) Reported by: Thomas Arimont Review: https://reviewboard.asterisk.org/r/2164/ ........ Merged revisions 375216 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 375217 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 375219 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14Doxygen Updates - Title updateAndrew Latham
Update and extend the configuration_file group and enable linking to the application. Update title that was left behind many years ago. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375004 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-10app_queue: Made pass connected line updates from the caller to ringing queue ↵Richard Mudgett
members. Party A calls Party B Party B puts Party A on hold. Party B calls a queue. Ringing queue member D sees Party B identification. Party B transfers Party A to the queue. Queue member D does not get a connected line update for Party A. Queue member D answers the call and still sees Party B information. However, if Party A later transfers the call to Party C then queue member D gets a connected line update for Party C. * Made pass connected line updates from the caller to queue members while the queue members are ringing. (closes issue AST-1017) Reported by: Thomas Arimont (closes issue ABE-2886) Reported by: Thomas Arimont Tested by: rmudgett ........ Merged revisions 374801 from https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier ........ Merged revisions 374802 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374803 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374804 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01Doxygen CleanupAndrew Latham
Start adding configuration file linking and pages. Add module loading doxygen block. (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01app_queue: Support persisting and loading of long member lists.Sean Bright
Greenlight in #asterisk brought up that he was receiving an error message "Could not create persistent member string, out of space" when running app_queue in Asterisk 10. dump_queue_members() made an assumption that 8K would be enough to store the generated string, but with queues that have large member lists this is not always the case. This patch removes the limitation and uses ast_str instead of a fixed sized buffer. The complicating factor comes from the fact that ast_db_get requires a buffer and buffer size argument, which doesn't let us pull back more than what we pass in, so I introduced a new ast_db_get_allocated() which returns an ast_strdup()'d copy of the value from astdb. As an aside, I did some testing on the maximum size of data that we can store in the BDB library we distribute and was able to store a 10MB string and retrieve it with no problems, so I feel this is a safe patch. Review: https://reviewboard.asterisk.org/r/2136/ ........ Merged revisions 374108 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374135 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374150 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-26app_queue: 'agent available' hint, cleanup restart, and initial stateAlec L Davis
Fix previously untested senarios; 1). On queue initialisation set queue_avail devstate to INUSE. Previously was unavailable, which indicated an agent was available. 2). When removing members, if there are no other members available, set queue_avail to INUSE. Previously, if a member interface had become 'unavailable', they were never going to be removed, particularly when persistant queues is enabled. 3). When adding a member, check that they are available, if they are set queue_avail to NOT_INUSE. Previously on reloaded, members may have been 'unavailable'. 4). When pausing or unpausing a member, set appropriate queue availability. alecdavis (license 585) Reported by: Alec Davis Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/2129/ ........ Merged revisions 373804 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25"show" completion option for "queue" shouldn't appear twiceKinsey Moore
When tab-completing CLI commands starting with "queue", "show" appeared twice in the list due to the way that Asterisk's tab completion functions and the order in which the commands were registered. The registration order has been altered to resolve this issue. (closes issue AST-940) Reported-by: Steve Pitts ........ Merged revisions 373666 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 373675 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 373688 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22Doxygen Updates Janitor WorkAndrew Latham
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags. * Add cleanup to Makefile for the Doxygen configuration update * Start updating Doxygen configuration for cleaner output * Enable inclusion of configuration files into documentation * remove mantisworkflow... * update documentation README * Add markup to Tilghman's email and talk with him about updating his email, he knows... * no code changes on this commit other than the mentioned Makefile change (issue ASTERISK-20259) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21app_queue: Make queue reload members and variants of that workJonathan Rose
Prior to this patch, 'queue reload members' cli command did not work at all. This also affects the manager function 'QueueReload' when supplied with the 'members: yes' field. (closes issue AST-956) Reported by: John Bigelow ........ Merged revisions 373298 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 373300 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 373318 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373319 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20Add queue monitoring hintsMatthew Jordan
This patch adds support for hints on a queue. Hints can be added using the nomenclature 'Queue:name', where name is the name of the queue being monitored. This nifty feature was done by Alec Davis. Review: https://reviewboard.asterisk.org/r/1619 Reported by: Alec Davis Tested by: alecdavis patches: review1619.diff2 by alecdavis (license 585) ........ Merged revisions 373235 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20Support all ways a member can be available for 'agent available' hintsMatthew Jordan
Alec's patch in r373188 added the ability to subscribe to a hint for when Queue members are available. This patch modifies the check that determines when a Queue member is available by refactoring the availability checks in num_available_members into a shared function is_member_available. This should now handle the ringinuse option, as well as device state values other than AST_DEVICE_NOT_INUSE. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-19app_queue: Support an 'agent available' hintAlec L Davis
Sets INUSE when no free agents, NOT_INUSE when an agent is free. modifes handle_statechange() scan members loop to scan for a free agent and updates the Queue:queuename_avial devstate. Previously exited early if the member was found in the queue. Now Exits later when both a member was found, and a free agent was found. alecdavis (license 585) Reported by: Alec Davis Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/2121/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-07Fix exception path typo in app_queue.c try_calling().Richard Mudgett
(closes issue ASTERISK-20380) Reported by: Jeremy Pepper Patches: fix-local-channel-locking.patch (license #6350) patch uploaded by Jeremy Pepper ........ Merged revisions 372624 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 372625 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372626 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-06Update QueueMemberStatus event documentation to include member status valuesMatthew Jordan
The Status: header in a QueueMemberStatus event (and other QueueMember* events) is the numeric value of the device state corresponding to that Queue Member. As those values are not exactly obvious, listing them in the documentation is useful. Matt Riddell reported this indirectly through the wiki page. (closes issue ASTERISK-20243) Reported by: Matt Riddell ........ Merged revisions 372531 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-06Ensure listed queues are not offered for completionKinsey Moore
When using tab-completion for the list of queues on "queue reset stats" or "queue reload {all|members|parameters|rules}", the tab-completion listing for further queues erroneously listed queues that had already been added to the list. The tab-completion listing now only displays queues that are not already in the list. (closes issue AST-963) Reported-by: John Bigelow ........ Merged revisions 372517 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 372518 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372519 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-06Ensure "rules" is tab-completable for "queue show"Kinsey Moore
Previously, tabbing at the end of "queue show" produced a list of available queues about which information could be shown, but did not include an alternative command, "rules", to access information about queue rules. The "rules" item should now be shown in the list of tab-completable items. (closes issue AST-958) Reported-by: John Bigelow ........ Merged revisions 372444 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 372445 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372446 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-04app_queue: Only log PAUSEALL/UNPAUSEALL when 1+ memebers changed.Jonathan Rose
Prior to this patch, if pause or unpause was issued on an interface without specifying a specific queue, a PAUSEALL or UNPAUSEALL event would be logged in the queue log even if that interface wasn't a member of any queues. This patch changes it so that these events are only logged when at least one member of any queue exists for that interface. (closes issue AST-946) Reported by: John Bigelow Review: https://reviewboard.asterisk.org/r/2079/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-30Prevent crash on shutdown due to refcount error on queues container.Mark Michelson
When app_queue is unloaded, the queues container has its refcount decremented, potentially to 0. Then the taskprocessor responsible for handling device state changes is unreferenced. If the taskprocessor happens to be just about to run its task, then it will create and destroy an iterator on the queues container. This can cause the refcount on the queues container to increase to 1 and then back to 0. Going back to 0 a second time results in double frees. This failure was seen periodically in the testsuite when Asterisk would shut down. ........ Merged revisions 372089 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 372090 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372091 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-30Help prevent ringing queue members from being rung when ringinuse set to no.Mark Michelson
Queue member status would not always get updated properly when the member was called, thus resulting in the member getting multiple calls. With this change, we update the member's status at the time of calling, and we also check to make sure the member is still available to take the call before placing an outbound call. (closes issue ASTERISK-16115) reported by nik600 Patches: app_queue.c-svn-r370418.patch uploaded by Italo Rossi (license #6409) ........ Merged revisions 372048 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 372049 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 372050 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-21Fix misuses of asprintf throughout the code.Mark Michelson
This fixes three main issues * Change asprintf() uses to ast_asprintf() so that it pairs properly with ast_free() and no longer causes MALLOC_DEBUG to freak out. * When ast_asprintf() fails, set the pointer NULL if it will be referenced later. * Fix some memory leaks that were spotted while taking care of the first two points. (Closes issue ASTERISK-20135) reported by Richard Mudgett Review: https://reviewboard.asterisk.org/r/2071 ........ Merged revisions 371590 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371591 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371592 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-15Fix bug where final queue member would not be removed from memory.Mark Michelson
If a static queue had realtime members, then there could be a potential for those realtime members not to be properly deleted from memory. If the queue's members were loaded from realtime and then all the members were deleted from the backend, then the queue would still think these members existed. The reason was that there was a short- circuit in code such that if there were no members found in the backend, then the queue would not be updated to reflect this. Note that this only affected static queues with realtime members. Realtime queues with realtime members were unaffected by this issue. (closes issue ASTERISK-19793) reported by Marcus Haas ........ Merged revisions 371306 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371313 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371324 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371325 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-10Fix a couple of documentation problems in app_queue.cMark Michelson
* The RemoveQueueMember app made mention of options that could be passed in, but no options are supported. I have removed the listing of options from the documentation. * The RQMSTATUS variable did not list "NOTDYNAMIC" as a possible value that could be set. (closes issue AST-949) reported by Steve Pitts (closes issue AST-954) reported by Steve Pitts ........ Merged revisions 371141 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 371142 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 371143 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-29Hangup handlers - Dialplan subroutines that run when the channel hangs up.Richard Mudgett
Hangup handlers are an alternative to the h extension. They can be used in addition to the h extension. The idea is to attach a Gosub routine to a channel that will execute when the call hangs up. Whereas which h extension gets executed depends on the location of dialplan execution when the call hangs up, hangup handlers are attached to the call channel. You can attach multiple handlers that will execute in the order of most recently added first. (closes issue ASTERISK-19549) Reported by: Mark Murawski Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/2002/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-25Add AMI event documentationMatthew Jordan
This patch adds the core changes necessary to support AMI event documentation in the source files of Asterisk, and adds documentation to those AMI events defined in the core application modules. Event documentation is built from the source by two new python scripts, located in build_tools: get_documentation.py and post_process_documentation.py. The get_documentation.py script mirrors the actions of the existing AWK get_documentation scripts, except that it will scan the entirety of a source file for Asterisk documentation. Upon encountering it, if the documentation happens to be an AMI event, it will attempt to extract information about the event directly from the manager event macro calls that raise the event. The post_process_documentation.py script combines manager event instances that are the same event but documented in multiple source files. It generates the final core-[lang].xml file. As this process can take longer to complete than a typical 'make all', it is only performed if a new make target, 'full', is chosen. Review: https://reviewboard.asterisk.org/r/1967/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-22Explicitly check caller hangup in app Queue rather than a polluted res2 value.Richard Mudgett
........ Merged revisions 369262 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 369263 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-22Fix F and F(x) action logic in Queue application.Richard Mudgett
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-14Allow non-normal execution routines to be able to run on hungup channels.Richard Mudgett
* Make non-normal dialplan execution routines be able to run on a hung up channel. This is preparation work for hangup handler routines. * Fixed ability to support relative non-normal dialplan execution routines. (i.e., The context and exten are optional for the specified dialplan location.) Predial routines are the only non-normal routines that it makes sense to optionally omit the context and exten. Setting a hangup handler also needs this ability. * Fix Return application being able to restore a dialplan location exactly. Channels without a PBX may not have context or exten set. * Fixes non-normal execution routines like connected line interception and predial leaving the dialplan execution stack unbalanced. Errors like missing Return statements, popping too many stack frames using StackPop, or an application returning non-zero could leave the dialplan stack unbalanced. * Fixed the AGI gosub application so it cleans up the dialplan execution stack and handles the autoloop priority increments correctly. * Eliminated the need for the gosub_virtual_context return location. Review: https://reviewboard.asterisk.org/r/1984/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368985 65c4cc65-6c06-0410-ace0-fbb531ad65f3