summaryrefslogtreecommitdiff
path: root/funcs/func_devstate.c
AgeCommit message (Collapse)Author
2014-07-25Add module support level to ast_module_info structure. Print it in CLI ↵Mark Michelson
"module show" . ASTERISK-23919 #close Reported by Malcolm Davenport Review: https://reviewboard.asterisk.org/r/3802 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419592 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-05-10Coverity Report: Fix issues for error type CHECKED_RETURN for coreJonathan Rose
(issue ASTERISK-19658) Reported by: Matt Jordan Review: https://reviewboard.asterisk.org/r/1905/ ........ Merged revisions 366094 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 366106 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04Make 'help devstate change' display properly (get rid of excess comma)Jonathan Rose
(closes issue ASTERISK-19444) Reported by: Makoto Dei Patches: devstate-change-usage-truncate.patch uploaded by Makoto Dei (license 5027) ........ Merged revisions 361201 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361208 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14Merged revisions 328247 via svnmerge from Leif Madsen
https://origsvn.digium.com/svn/asterisk/branches/1.10 ................ r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines Merged revisions 328209 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines Introduce <support_level> tags in MODULEINFO. This change introduces MODULEINFO into many modules in Asterisk in order to show the community support level for those modules. This is used by changes committed to menuselect by Russell Bryant recently (r917 in menuselect). More information about the support level types and what they mean is available on the wiki at https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20Add load priority order, such that preload becomes unnecessary in most casesTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21Const-ify the world (or at least a good part of it)Kevin P. Fleming
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes: - CLI command handlers - CLI command handler arguments - AGI command handlers - AGI command handler arguments - Dialplan application handler arguments - Speech engine API function arguments In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing. Review: https://reviewboard.asterisk.org/r/251/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-08Fix the spelling of UNAVAILABLE in func_devstate CLI completion.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193274 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12This commit does two things:Michiel van Baak
- Add CLI aliases module to asterisk. - Remove all deprecated CLI commands from the code Initial work done by file. Junk-Y and lmadsen did a lot of work and testing to get the list of deprecated commands into the configuration file. Deprecated CLI commands are now handled by this new module, see cli_aliases.conf for more info about that. ok russellb@ via reviewboard (closes issue #13735) Reported by: mvanbaak git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01Merge changes from team/group/appdocsxmlRussell Bryant
This commit introduces the first phase of an effort to manage documentation of the interfaces in Asterisk in an XML format. Currently, a new format is available for applications and dialplan functions. A good number of conversions to the new format are also included. For more information, see the following message to asterisk-dev: http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-01Add a \todoRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-01Add a "devstate change" CLI command to control custom device states. Also,Russell Bryant
do some additional code cleanup and improvement in passing. (closes issue #12106) Reported by: nizon Patches: devstate-patch.txt uploaded by nizon (license 415) -- Updated to trunk, and tab completion added by me git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-08Merge changes from team/mvanbaak/cli-command-auditRussell Bryant
(closes issue #8925) About a year ago, as Leif Madsen and Jim van Meggelen were going over the CLI commands in Asterisk 1.4 for the next version of their book, they documented a lot of inconsistencies. This set of changes addresses all of these issues and has been reviewed by Leif. While this does introduce even more changes to the CLI command structure, it makes everything consistent, which is the most important thing. Thanks to all that helped with this one! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former ↵Jason Parker
didn't make much sense git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19Convert NEW_CLI to AST_CLI.Jason Parker
Closes issue #11039, as suggested by seanbright. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06Rename the DEVSTATE() function to DEVICE_STATE() to better conform to how otherRussell Bryant
functions are named. (inspired by issue #10635) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06Merge HINT() dialplan function from my sandbox branch into trunk. This functionRussell Bryant
will let you retrieve the list of devices or name associated with a hint. (inspired by issue #10635) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81783 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10Store custom device states in astdb so that they will persist a restart. As aRussell Bryant
side benefit, this simplifies the code a bit, too. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10Merge a set of device state improvements from team/russell/events.Russell Bryant
The way a device state change propagates is kind of silly, in my opinion. A device state provider calls a function that indicates that the state of a device has changed. Then, another thread goes back and calls a callback for the device state provider to find out what the new state is before it can go send it off to whoever cares. I have changed it so that you can include the state that the device has changed to in the first function call from the device state provider. This removes the need to have to call the callback, which locks up critical containers to go find out what the state changed to. This change set changes the "simple" device state providers to use the new method. This includes parking, meetme, and SLA. I have also mostly converted chan_agent in my branch, but still have some more things to think through before presenting the plan for converting channel drivers to ensure all of the right events get generated ... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-09Merged revisions 73985 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r73985 | tilghman | 2007-07-08 23:03:20 -0500 (Sun, 08 Jul 2007) | 2 lines Doxygen formatting fixes; fixes errors while 'make progdocs'. (Closes issue #10104) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06Issue 9869 - replace malloc and memset with ast_calloc, and other coding ↵Tilghman Lesher
guidelines changes git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-30Issue 9477 - Improve menuselect labelsTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@66585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11Add a minor loop optimization to the custom device state callback. Once theRussell Bryant
correct device is found, it should just break out of the loop ... git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-13This introduces a new dialplan function, DEVSTATE, which allows you to do someRussell Bryant
pretty cool things. First, you can get the device state of anything in the dialplan: NoOp(SIP/mypeer has state ${DEVSTATE(SIP/mypeer)}) NoOp(The conference room 1234 has state ${DEVSTATE(MeetMe:1234)}) Most importantly, this allows you to create custom device states so you can control phone lamps directly from the dialplan. Set(DEVSTATE(Custom:mycustomlamp)=BUSY) ... exten => mycustomlamp,hint,Custom:mycustomlamp git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@54261 65c4cc65-6c06-0410-ace0-fbb531ad65f3