summaryrefslogtreecommitdiff
path: root/main/pbx.c
AgeCommit message (Collapse)Author
2012-02-24Opaquification for ast_format structs in struct ast_channelTerry Wilson
Review: https://reviewboard.asterisk.org/r/1770/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20ast_channel opaquification of pointers and integral typesTerry Wilson
Review: https://reviewboard.asterisk.org/r/1753/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14Re-commit the verbose branch.Tilghman Lesher
This change permits each verbose destination (consoles, logger) to have its own concept of what the verbosity level is. The big feature here is that the logger will now be able to capture a particular verbosity level without condemning each console to need to suffer that level of verbosity. Additionally, a stray 'core set verbose' will no longer change what will go to the log. Review: https://reviewboard.asterisk.org/r/1599/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13Opaquify char * and char[] in ast_channelTerry Wilson
Review: https://reviewboard.asterisk.org/r/1733/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08Avoid cppcheck warnings; removing unused vars and a bit of cleanup.Walter Doekes
Patch by: Clod Patry Review: https://reviewboard.asterisk.org/r/1651 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01Constify some more channel driver technology callback parameters.Richard Mudgett
Review: https://reviewboard.asterisk.org/r/1707/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27Audit of ao2_iterator_init() usage for v1.8.Richard Mudgett
Fixes numerous reference leaks and missing ao2_iterator_destroy() calls as a result. Review: https://reviewboard.asterisk.org/r/1697/ ........ Merged revisions 352955 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 352956 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24Opaquify channel stringfieldsTerry Wilson
Continue channel opaque-ification by wrapping all of the stringfields. Eventually, we will restrict what can actually set these variables, but the purpose for now is to hide the implementation and keep people from adding code that directly accesses the channel structure. Semantic changes will follow afterward. Review: https://reviewboard.asterisk.org/r/1661/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09Replace direct access to channel name with accessor functionsTerry Wilson
There are many benefits to making the ast_channel an opaque handle, from increasing maintainability to presenting ways to kill masquerades. This patch kicks things off by taking things a field at a time, renaming the field to '__do_not_use_${fieldname}' and then writing setters/getters and converting the existing code to using them. When all fields are done, we can move ast_channel to a C file from channel.h and lop off the '__do_not_use_'. This patch sets up main/channel_interal_api.c to be the only file that actually accesses the ast_channel's fields directly. The intent would be for any API functions in channel.c to use the accessor functions. No more monkeying around with channel internals. We should use our own APIs. The interesting changes in this patch are the addition of channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to use accessor functions when ast_channel is really opaque), and some re-working of the way channel iterators/callbacks are handled so as to avoid creating fake ast_channels on the stack to pass in matching data by directly accessing fields (since "name" is a stringfield and the fake channel doesn't init the stringfields, you can't use the ast_channel_name_set() function). I went with ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a setter. The majority of the grunt-work for this change was done by writing a semantic patch using Coccinelle ( http://coccinelle.lip6.fr/ ). Review: https://reviewboard.asterisk.org/r/1655/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-04Fix documentation for SayNumber to reflect the fact that language is changed ↵Jonathan Rose
in CHANNEL() (closes issue ASTERISK-18962) reported by: Nir Simionovich ........ Merged revisions 349450 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 349451 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23Fix extension state callback references in chan_sip.Richard Mudgett
Chan_sip gives a dialog reference to the extension state callback and assumes that when ast_extension_state_del() returns, the callback cannot happen anymore. Chan_sip then reduces the dialog reference count associated with the callback. Recent changes (ASTERISK-17760) have resulted in the potential for the callback to happen after ast_extension_state_del() has returned. For chan_sip, this could be very bad because the dialog pointer could have already been destroyed. * Added ast_extension_state_add_destroy() so chan_sip can account for the sip_pvt reference given to the extension state callback when the extension state callback is deleted. * Fix pbx.c awkward statecbs handling in ast_extension_state_add_destroy() and handle_statechange() now that the struct ast_state_cb has a destructor to call. * Ensure that ast_extension_state_add_destroy() will never return -1 or 0 for a successful registration. * Fixed pbx.c statecbs_cmp() to compare the correct information. The passed in value to compare is a change_cb function pointer not an object pointer. * Make pbx.c ast_merge_contexts_and_delete() not perform callbacks with AST_EXTENSION_REMOVED with locks held. Chan_sip is notorious for deadlocking when those locks are held during the callback. * Removed unused lock declaration for the pbx.c store_hints list. (closes issue ASTERISK-18844) Reported by: rmudgett Review: https://reviewboard.asterisk.org/r/1635/ ........ Merged revisions 348940 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 348952 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-16Fix crash during CDR update.Richard Mudgett
The ast_cdr_setcid() and ast_cdr_update() were shown in ASTERISK-18836 to be called by different threads for the same channel. The channel driver thread and the PBX thread running dialplan. * Add lock protection around CDR API calls that access an ast_channel pointer. (closes issue ASTERISK-18836) Reported by: gpluser Review: https://reviewboard.asterisk.org/r/1628/ ........ Merged revisions 348362 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 348363 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-09Fix some parsing issues in add_exten_to_pattern_tree().Richard Mudgett
* Simplify compare_char() and avoid potential sign extension issue. * Fix infinite loop in add_exten_to_pattern_tree() handling of character set escape handling. * Added buffer overflow checks in add_exten_to_pattern_tree() character set collection. * Made ignore empty character sets. * Added escape character handling to end-of-range character in character sets. This has a slight change in behavior if the end-of-range character is an escape character. You must now escape it. * Fix potential sign extension issue when expanding character set ranges. * Made remove duplicated characters from character sets. The duplicate characters lower extension matching priority and prevent duplicate extension detection. * Fix escape character handling when the escape character is trying to escape the end-of-string. We could have continued processing characters after the end of the exten string. We could have added the previous character to the pattern matching tree incorrectly. (closes issue ASTERISK-18909) Reported by: Luke-Jr ........ Merged revisions 347811 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 347812 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347813 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-06Documents CHANNEL(musicclass) taking priority over m([x]) in waitExtenJonathan Rose
If waitExten specifies a music class to use with its music on hold option, it will use CHANNEL(musicclass) instead if that channel variable has been set on the initiating channel. This documents that behavior in the waitExten app so that this can be known without checking the documentation of the code in function local_ast_moh_start. (closes issue ASTERISK-18804) ........ Merged revisions 347239 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 347240 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-05Resolve duplicate label used in multiple priorities for the same extension.Jonathan Rose
Prior to this patch, if labels with the same name were used for different priorities in the same extension, the new label would be accepted, but it would be unusable since attempts to reach that label would just go to the first one. Now pbx.c detects this, generates a warning in logs, and culls the label before adding it to the dialplan. (closes issue ASTERISK-18807) Reported by: Kenneth Shumard Patches: pbx.c.patch uploaded by Kenneth Shumard (License 5077) ........ Merged revisions 346954 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 346955 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-14Fix Progress spelling error in main/pbx.c.Richard Mudgett
(closes issue ASTERISK-18857) Reported by: David M Patches: mainpbx-trivial.patch (License #6326) patch uploaded by David M ........ Merged revisions 345219 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 345220 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-11Fix a segmentation fault when using an extension with CID matching and no CID.Jonathan Rose
Attempting to call an extension which used Caller ID matching with a channel that has an empty caller id string would result in a segmentation fault. (closes issue ASTERISK-18392 Reported By: Ales Zelenik ........ Merged revisions 344608 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 344609 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-31Fixed invalid memory access when adding extension to pattern match treeMatthew Jordan
When an extension is removed from a context, its entry in the pattern match tree is not deleted. Instead, the extension is marked as deleted. When an extension is removed and re-added, if that extension is also a prefix of another extension, several log messages would report an error and did not check whether or not the extension was deleted before accessing the memory. Additionally, if the extension was already in the tree but previously deleted, and the pattern was at the end of a match, the findonly flag was not honored and the extension would be erroneously undeleted. Additionaly, it was discovered that an IAX2 peer could be unregistered via the CLI, while at the same time it could be scheduled for unregistration by Asterisk. The unregistration method now checks to see if the peer was already unregistered before continuing with an unregistration. (closes issue ASTERISK-18135) Reported by: Jaco Kroon, Henry Fernandes, Kristijan Vrban Tested by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1526 ........ Merged revisions 342769 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 342770 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-10Merged revisions 340109 via svnmerge from Matthew Nicholson
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r340109 | mnicholson | 2011-10-10 09:15:41 -0500 (Mon, 10 Oct 2011) | 18 lines Merged revisions 340108 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r340108 | mnicholson | 2011-10-10 09:14:48 -0500 (Mon, 10 Oct 2011) | 11 lines Load the proper XML documentation when multiple modules document the same application. This patch adds an optional "module" attribute to the XML documentation spec that allows the documentation processor to match apps with identical names from different modules to their documentation. This patch also fixes a number of bugs with the documentation processor and should make it a little more efficient. Support for multiple languages has also been properly implemented. ASTERISK-18130 Review: https://reviewboard.asterisk.org/r/1485/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-26Merged revisions 337974 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r337974 | rmudgett | 2011-09-26 14:35:23 -0500 (Mon, 26 Sep 2011) | 37 lines Merged revisions 337973 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r337973 | rmudgett | 2011-09-26 14:30:39 -0500 (Mon, 26 Sep 2011) | 30 lines Fix deadlock when using dummy channels. Dummy channels created by ast_dummy_channel_alloc() should be destoyed by ast_channel_unref(). Using ast_channel_release() needlessly grabs the channel container lock and can cause a deadlock as a result. * Analyzed use of ast_dummy_channel_alloc() and made use ast_channel_unref() when done with the dummy channel. (Primary reason for the reported deadlock.) * Made app_dial.c:dial_exec_full() not call ast_call() holding any channel locks. Chan_local could not perform deadlock avoidance correctly. (Potential deadlock exposed by this issue. Secondary reason for the reported deadlock since the held lock was part of the deadlock chain.) * Fixed some uses of ast_dummy_channel_alloc() not checking the returned channel pointer for failure. * Fixed some potential chan=NULL pointer usage in func_odbc.c. Protected by testing the bogus_chan value. * Fixed needlessly clearing a 1024 char auto array when setting the first char to zero is enough in manager.c:action_getvar(). (closes issue ASTERISK-18613) Reported by: Thomas Arimont Patches: jira_asterisk_18613_v1.8.patch (license #5621) patch uploaded by rmudgett Tested by: Thomas Arimont ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-21Merged revisions 337219 via svnmerge from Olle Johansson
https://origsvn.digium.com/svn/asterisk/branches/10 ........ r337219 | oej | 2011-09-21 11:32:50 +0200 (Ons, 21 Sep 2011) | 13 lines Make ast_pbx_run() not default to s@default if extension is not found Review: https://reviewboard.asterisk.org/r/1446/ This is a bug - or architecture mistake - that has been in Asterisk for a very long time. It was exposed by the AMI originate action and possibly some other applications. Most channel drivers checks if an extension exists BEFORE starting a pbx on an inbound call, so most calls will not depend on this issue. Thanks everyone involved in the review and on IRC and the mailing list for a quick review and all the feedback. (closes issue ASTERISK-18578) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20Merged revisions 337062 via svnmerge from Kinsey Moore
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r337062 | kmoore | 2011-09-20 16:05:01 -0500 (Tue, 20 Sep 2011) | 18 lines Merged revisions 337061 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r337061 | kmoore | 2011-09-20 16:04:11 -0500 (Tue, 20 Sep 2011) | 11 lines Make CANMATCH with the new pattern match engine behave more like the old one When checking an extension for E_CANMATCH using the new extension matching algorithm, an exact match was not returned as a possible match resulting in the queue failing to allow a caller to exit on DTMF. This removes the requirement that an extension be longer than acquired digits for an E_CANMATCH operation to succeed. (closes issue ASTERISK-18044) Review: https://reviewboard.asterisk.org/r/1367/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13Merged revisions 335653 via svnmerge from Matthew Nicholson
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r335653 | mnicholson | 2011-09-13 13:47:57 -0500 (Tue, 13 Sep 2011) | 12 lines Merged revisions 335618 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r335618 | mnicholson | 2011-09-13 13:20:52 -0500 (Tue, 13 Sep 2011) | 5 lines Don't limit the size of appdata for manager originate actions. ASTERISK-17709 Patch by: tilghman (with modifications) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09Merged revisions 335078 via svnmerge from Matthew Jordan
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r335078 | mjordan | 2011-09-09 11:27:01 -0500 (Fri, 09 Sep 2011) | 29 lines Merged revisions 335064 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r335064 | mjordan | 2011-09-09 11:09:09 -0500 (Fri, 09 Sep 2011) | 23 lines Updated SIP 484 handling; added Incomplete control frame When a SIP phone uses the dial application and receives a 484 Address Incomplete response, if overlapped dialing is enabled for SIP, then the 484 Address Incomplete is forwarded back to the SIP phone and the HANGUPCAUSE channel variable is set to 28. Previously, the Incomplete application dialplan logic was automatically triggered; now, explicit dialplan usage of the application is required. Additionally, this patch adds a new AST_CONTOL_FRAME type called AST_CONTROL_INCOMPLETE. If a channel driver receives this control frame, it is an indication that the dialplan expects more digits back from the device. If the device supports overlap dialing it should attempt to notify the device that the dialplan is waiting for more digits; otherwise, it can handle the frame in a manner appropriate to the channel driver. (closes issue ASTERISK-17288) Reported by: Mikael Carlsson Tested by: Matthew Jordan Review: https://reviewboard.asterisk.org/r/1416/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-08Removes colorful verb statements erroneously commited with r332760Jonathan Rose
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07Merged revisions 334617 via svnmerge from Alec L Davis
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r334617 | alecdavis | 2011-09-07 19:45:00 +1200 (Wed, 07 Sep 2011) | 17 lines Merged revisions 334616 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r334616 | alecdavis | 2011-09-07 19:33:39 +1200 (Wed, 07 Sep 2011) | 10 lines Prevent segfault if call arrives before Asterisk is fully booted. Prevent ast_pbx_start and ast_run_start from starting a new thread unless asterisk is fully booted. alecdavis (license 585) Tested by: alecdavis Review: https://reviewboard.asterisk.org/r/1407/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-01Merged revisions 334235 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r334235 | tilghman | 2011-09-01 12:39:32 -0500 (Thu, 01 Sep 2011) | 9 lines Merged revisions 334234 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r334234 | tilghman | 2011-09-01 12:38:33 -0500 (Thu, 01 Sep 2011) | 2 lines Remove 1.6 compatibility documentation from 1.8, as it no longer applies. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22Add option for logging congested calls as CONGESTION instead of NO_ANSWER in CDRJonathan Rose
This patch adds a CDR option to cdr.conf that will allow CDR files to log calls ending with congestion in a way that is unique from other unanswered calls. (closes issue ASTERISK-14842) Reported by: Alec Davis Patches: cdr_congestion.diff.txt (License #5546) patch uploaded by Alec Davis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@332760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-09Merged revisions 331265 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r331265 | rmudgett | 2011-08-09 18:12:49 -0500 (Tue, 09 Aug 2011) | 22 lines Merged revisions 331248 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r331248 | rmudgett | 2011-08-09 17:12:59 -0500 (Tue, 09 Aug 2011) | 15 lines Misc minor items found in code. * Add some reentrancy protection in pbx.c when creating the contexts_table hash table. * Fix inverted test in chan_sip.c conditional code. * Fix uninitialized variable and use of the wrong variable in chan_iax2.c. * Fix test of return value in app_parkandannounce.c. Explicitly testing for -1 is bad if the function does not actually return that value when it fails. * Fixup some comments and add some curly braces in features.c. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-27reverting 329840 due to failing tests. Going to change this feature to be ↵Jonathan Rose
purely optional. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-27Adds cdr logging of calls resulting in CONGESTIONJonathan Rose
Applies a patch made a long time ago by alecdavis which adds a CDR feature for logging calls that failed due to congestion. (closes issue #15907) Reported by: alecdavis Patches: cdr_congestion.diff.txt uploaded by alecdavis (license #5546) Review: https://reviewboard.asterisk.org/r/454/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329835 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-22Merged revisions 329334 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ........ r329334 | rmudgett | 2011-07-22 16:14:22 -0500 (Fri, 22 Jul 2011) | 1 line Make use less redundant loop construct for iterating over hints. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-22Merged revisions 329331 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r329331 | rmudgett | 2011-07-22 15:43:07 -0500 (Fri, 22 Jul 2011) | 55 lines Merged revisions 329299 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r329299 | rmudgett | 2011-07-22 10:44:58 -0500 (Fri, 22 Jul 2011) | 48 lines Deadlocks dealing with dialplan hints during reload. There are two remaining different deadlocks reported dealing with dialplan hints. The deadlock in ASTERISK-17666 is caused by invalid locking order in ast_remove_hint(). The hints container must be locked before the hint object. The deadlock in ASTERISK-17760 is caused by a catch-22 situation in handle_statechange(). The deadlock is caused by not having the conlock before calling the watcher callbacks. Unfortunately, having that lock causes a different deadlock as reported in ASTERISK-16961. * Fixed ast_remove_hint() locking order. * Made handle_statechange() no longer call the watcher callbacks holding any locks that matter. * Made hint ao2 destructor do the watcher callbacks for extension deactivation to guarantee that they get called. * Fixed hint reference leak in ast_add_hint() if the callback container constructor failed. * Fixed hint reference leak in complete_core_show_hint() for every hint it found for CLI tab completion. * Adjusted locking in ast_merge_contexts_and_delete() for safety. * Added context_merge_lock to prevent ast_merge_contexts_and_delete() and handle_statechange() from interfering with each other. * Fixed ast_change_hint() not taking into account that the extension is used for the hash key. (closes issue ASTERISK-17666) Reported by: irroot Tested by: irroot JIRA SWP-3318 (closes issue ASTERISK-17760) Reported by: Byron Clark Tested by: irroot JIRA SWP-3393 Review: https://reviewboard.asterisk.org/r/1313/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-11Merged revisions 327512 via svnmerge from Matthew Nicholson
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r327512 | mnicholson | 2011-07-11 08:53:59 -0500 (Mon, 11 Jul 2011) | 2 lines reset our buffer each iteration when doing variable substitution ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@327513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-08Merged revisions 327106 via svnmerge from Matthew Nicholson
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r327106 | mnicholson | 2011-07-08 14:52:51 -0500 (Fri, 08 Jul 2011) | 11 lines Reset our ast_str before passing it on to dialplan function backends. It is possible for a dialplan backend to not modify the given buffer or ast_str and still return success. This causes any previous value stored in the buffer to be used as if the new function call provided it. Some functions also append to the given buffer assuming it is empty. The test_substitution unit test has also been modified to detect this problem. (closes issue ASTERISK-17878) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@327107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-08Merged revisions 326985 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r326985 | rmudgett | 2011-07-07 20:08:05 -0500 (Thu, 07 Jul 2011) | 12 lines Some code cleanup in pbx.c * Mostly comment and format changes. * ast_context_remove_extension_callerid() and ast_add_extension_nolock() will write lock the found specific context. * ast_context_find() will now tolerate a NULL name. * Eliminated some inlined versions of find_context() and find_context_locked(). ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@327000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-21Merged revisions 324364 via svnmerge from David Vossel
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r324364 | dvossel | 2011-06-21 15:11:52 -0500 (Tue, 21 Jun 2011) | 10 lines Fixes locking inversion issue in ast_async_goto() During this function we can not hold the "chan" lock while doing the masquerade, the explicit goto on the tmp chan, or the channel alloc. Instead we need to get the channel lock, store off information about the channel that we need, and then let the channel lock go for the remainder of the function. Review: https://reviewboard.asterisk.org/r/1275/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@324365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-17Merged revisions 324115 via svnmerge from Leif Madsen
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r324115 | lmadsen | 2011-06-17 11:14:54 -0400 (Fri, 17 Jun 2011) | 3 lines Fix grammar in documentation for Goto() and GotoIf() (closes issue ASTERISK-18023) Reported by: Tim Osman ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@324131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-06Merged revisions 317917 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r317917 | russell | 2011-05-06 16:06:33 -0500 (Fri, 06 May 2011) | 7 lines Fix calculation of free RAM to make minmemfree option work. (closes issue #17124) Reported by: loic Patches: pbx_c.diff uploaded by loic (license 1020) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03Merged revisions 316265 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines Fix a bunch of compiler warnings generated by gcc 4.6.0. Most of these are -Wunused-but-set-variable, but there were a few others mixed in here, as well. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-26Merged revisions 315645 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r315645 | rmudgett | 2011-04-26 17:14:31 -0500 (Tue, 26 Apr 2011) | 21 lines The 'e' special extension fails to trigger in at least two cases. The 'e' extension is a fall back for the 'i', 't', or 'T' extensions if any of them do not exist. Many of the places the 'e' extension was supposed to be invoked fail because the priority was set wrong. There were two places where the 'e' extension was not even checked for fall back. * Made invoke the 'e' extension similarly to the previous 'i', 't', or 'T' extension check and added the 'e' extension as a fall back to the two missing locations. * Prioritized and optimized some hangup tests associated with the 'e' extension. (closes issue #19136) Reported by: kshumard Tested by: rmudgett Review: https://reviewboard.asterisk.org/r/1196/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@315649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-21fix a memory leak in device stateTzafrir Cohen
The callback handle_statechange (pbx.c) fails to release its data pointer, leaking memory in the process. Reported by: tzafrir Patches: 18735_pbx_free_callback.diff uploaded by tzafrir (license 46) Review: https://reviewboard.asterisk.org/r/1110/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04Replace ast_log(LOG_DEBUG, ...) with ast_debug()Paul Belanger
(closes issue #18556) Reported by: kkm Review: https://reviewboard.asterisk.org/r/1071/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03Asterisk media architecture conversion - no more format bitfieldsDavid Vossel
This patch is the foundation of an entire new way of looking at media in Asterisk. The code present in this patch is everything required to complete phase1 of my Media Architecture proposal. For more information about this project visit the link below. https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal The primary function of this patch is to convert all the usages of format bitfields in Asterisk to use the new format and format_cap APIs. Functionally no change in behavior should be present in this patch. Thanks to twilson and russell for all the time they spent reviewing these changes. Review: https://reviewboard.asterisk.org/r/1083/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-24Merged revisions 303549 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r303549 | russell | 2011-01-24 14:51:37 -0600 (Mon, 24 Jan 2011) | 45 lines Merged revisions 303548 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r303548 | russell | 2011-01-24 14:49:53 -0600 (Mon, 24 Jan 2011) | 38 lines Merged revisions 303546 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r303546 | russell | 2011-01-24 14:32:21 -0600 (Mon, 24 Jan 2011) | 31 lines Fix channel redirect out of MeetMe() and other issues with channel softhangup. Mantis issue #18585 reports that a channel redirect out of MeetMe() stopped working properly. This issue includes a patch that resolves the issue by removing a call to ast_check_hangup() from app_meetme.c. I left that in my patch, as it doesn't need to be there. However, the rest of the patch fixes this problem with or without the change to app_meetme. The key difference between what happens before and after this patch is the effect of the END_OF_Q control frame. After END_OF_Q is hit in ast_read(), ast_read() will return NULL. With the ast_check_hangup() removed, app_meetme sees this which causes it to exit as intended. Checking ast_check_hangup() caused app_meetme to exit earlier in the process, and the target of the redirect saw the condition where ast_read() returned NULL. Removing ast_check_hangup() works around the issue in app_meetme, but doesn't solve the issue if another application did the same thing. There are also other edge cases where if an application finishes at the same time that a redirect happens, the target of the redirect will think that the channel hung up. So, I made some changes in pbx.c to resolve it at a deeper level. There are already places that unset the SOFTHANGUP_ASYNCGOTO flag in an attempt to abort the hangup process. My patch extends this to remove the END_OF_Q frame from the channel's read queue, making the "abort hangup" more complete. This same technique was used in every place where a softhangup flag was cleared. (closes issue #18585) Reported by: oej Tested by: oej, wedhorn, russell Review: https://reviewboard.asterisk.org/r/1082/ ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@303551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-18Merged revisions 302266 via svnmerge from Jeff Peeler
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r302266 | jpeeler | 2011-01-18 14:19:57 -0600 (Tue, 18 Jan 2011) | 34 lines Merged revisions 302265 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r302265 | jpeeler | 2011-01-18 14:13:52 -0600 (Tue, 18 Jan 2011) | 27 lines Convert device state callbacks to ao2 objects to fix a deadlock in chan_sip. Lock scenario presented here: Thread 1 holds ast_rdlock_contexts &conlock holds handle_statechange hints holds handle_statechange hint waiting for cb_extensionstate Locked Here: chan_sip.c line 7428 (find_call) Thread 2 holds handle_request_do &netlock holds find_call sip_pvt_ptr waiting for ast_rdlock_contexts &conlock Locked Here: pbx.c line 9911 (ast_rdlock_contexts) Chan_sip has an established locking order of locking the sip_pvt and then getting the context lock. So the as stated by the summary, the operations in thread 2 have been modified to no longer require the context lock. (closes issue #18310) Reported by: one47 Patches: statecbs_ao2.mk2.patch uploaded by one47 (license 23), modified by me Review: https://reviewboard.asterisk.org/r/1072/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@302270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-13Add dialplan variables for asterisk.conf directoriesPaul Belanger
Review: https://reviewboard.asterisk.org/r/1075/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@301729 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-30move devices from hints into an ao2_containerStefan Schmidt
by splitting up devices from hints into an own ao2_container the callback to get these devices for statechange handling is faster. with this changes the length of a device used in a hint isnt longer restricted to 80 characters. Tests showed that calling handle_statechange is 40 times faster if no hints are used and 25 times faster if there are any hints. (closes issue #17928) Reported by: mdu113 Tested by: schmidts Review: https://reviewboard.asterisk.org/r/1003/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@296752 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-22Merged revisions 295866 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r295866 | rmudgett | 2010-11-22 13:36:10 -0600 (Mon, 22 Nov 2010) | 60 lines Merged revisions 295843 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r295843 | rmudgett | 2010-11-22 13:28:23 -0600 (Mon, 22 Nov 2010) | 53 lines Merged revisions 295790 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r295790 | rmudgett | 2010-11-22 12:46:26 -0600 (Mon, 22 Nov 2010) | 46 lines The channel redirect function (CLI or AMI) hangs up the call instead of redirecting the call. To recreate the problem: 1) Party A calls Party B 2) Invoke CLI "channel redirect" command to redirect channel call leg associated with A. 3) All associated channels are hung up. Note that if the CLI command were done on the channel call leg associated with B it works. This regression was a result of the fix for issue #16946 (https://reviewboard.asterisk.org/r/740/). The regression affects all features that use an async goto to execute the dialplan because of an external event: Channel redirect, AMI redirect, SIP REFER, and FAX detection. The struct ast_channel._softhangup code is a mess. The variable is used for several purposes that do not necessarily result in the call being hung up. I have added doxygen comments to describe how the various _softhangup bits are used. I have corrected all the places where the variable was tested in a non-bit oriented manner. The primary fix is the new AST_CONTROL_END_OF_Q frame. It acts as a weak hangup request so the soft hangup requests that do not normally result in a hangup do not hangup. JIRA SWP-2470 JIRA SWP-2489 (closes issue #18171) Reported by: SantaFox (closes issue #18185) Reported by: kwemheuer (closes issue #18211) Reported by: zahir_koradia (closes issue #18230) Reported by: vmarrone (closes issue #18299) Reported by: mbrevda (closes issue #18322) Reported by: nerbos Review: https://reviewboard.asterisk.org/r/1013/ ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@295867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-07Merged revisions 290713 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r290713 | russell | 2010-10-07 13:00:52 +0200 (Thu, 07 Oct 2010) | 11 lines Merged revisions 290712 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r290712 | russell | 2010-10-07 12:53:56 +0200 (Thu, 07 Oct 2010) | 4 lines Don't crash when Set() is called without a value. Review: https://reviewboard.asterisk.org/r/949/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@290714 65c4cc65-6c06-0410-ace0-fbb531ad65f3