aboutsummaryrefslogtreecommitdiffstats
path: root/main/devicestate.c
AgeCommit message (Collapse)AuthorFilesLines
2007-11-16Start untangling header inclusion in a way that does not affectrizzo1-6/+0
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: http://svn.digium.com/svn/asterisk/trunk@89333 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-08improve linked-list macros in two ways:kpfleming1-1/+1
- the *_CURRENT macros no longer need the list head pointer argument - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89106 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-10Merge a set of device state improvements from team/russell/events.russell1-18/+92
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: http://svn.digium.com/svn/asterisk/trunk@79027 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-23(closes issue #10271)russell1-1/+1
Reported by: snuffy Patches: doxygen-updates.diff uploaded by snuffy (license 35) Another big batch of doxygen documentation updates git-svn-id: http://svn.digium.com/svn/asterisk/trunk@76559 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-14Add a massive set of changes for converting to use the ast_debug() macro.russell1-10/+5
(issue #9957, patches from mvanbaak, caio1982, critch, and dimas) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69327 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-07Fix a bunch of doxygen errors and document more thingsrussell1-3/+3
(issue #9842, snuffy) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@68339 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-06Issue 9869 - replace malloc and memset with ast_calloc, and other coding ↵tilghman1-2/+2
guidelines changes git-svn-id: http://svn.digium.com/svn/asterisk/trunk@67864 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-06Merged revisions 67594 via svnmerge from file1-6/+5
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r67594 | file | 2007-06-06 08:20:27 -0400 (Wed, 06 Jun 2007) | 10 lines Merged revisions 67593 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r67593 | file | 2007-06-06 08:18:36 -0400 (Wed, 06 Jun 2007) | 2 lines Revert channel name splitting fix for Zap. The moral of the story is don't use - in your user/peer names. (issue #9668 reported by stevedavies) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@67595 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-01Merge major changes to the way device state is passed around Asterisk. The tworussell1-53/+13
places that cared about device states were app_queue and the hint code in pbx.c. The changes include converting it to use the Asterisk event system, as well as other efficiency improvements. * app_queue: This module used to register a callback into devicestate.c to monitor device state changes. Now, it is just a subscriber to Asterisk events with the type, device state. * pbx.c hints: Previously, the device state processing thread in devicestate.c would call ast_hint_state_changed() each time the state of a device changed. Then, that code would go looking for all the hints that monitor that device, and call their callbacks. All of this blocked the device state processing thread. Now, the hint code is a subscriber of Asterisk events with the type, device state. Furthermore, when this code receives a device state change event, it queues it up to be processed by another thread so that it doesn't block one of the event processing threads. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@66958 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-23Fix a couple minor spelling mistakes.russell1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@65573 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-14Merged revisions 64276 via svnmerge from file1-3/+7
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r64276 | file | 2007-05-14 14:36:34 -0400 (Mon, 14 May 2007) | 10 lines Merged revisions 64275 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r64275 | file | 2007-05-14 14:34:06 -0400 (Mon, 14 May 2007) | 2 lines Only perform stripping of - strings from the channel name for Zap channels. Anywhere else we might remove a legitimate part of a device name. (issue #9668 reported by stevedavies) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@64277 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-13This introduces a new dialplan function, DEVSTATE, which allows you to do somerussell1-6/+68
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: http://svn.digium.com/svn/asterisk/trunk@54261 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-02Clean up ast_device_state. It's pretty now!file1-24/+18
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@53113 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-02Switch the devicestate thread to operate the same way as the logging thread. ↵file1-16/+14
Pops all entries off the list to be processed, resets the list back to a clean state, and processes each entry. The thread won't have to acquire the list lock again until it checks to see if there are more to process. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@53112 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-02Read/write lockify the devicestate stuff a bit.file1-27/+26
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@53111 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-23Cosmetic changes. Make main source files better conform to coding guidelines ↵file1-3/+3
and standards. (issue #8679 reported by johann8384) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@51486 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-30Documentation updatesoej1-1/+18
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48164 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-30Small updateoej1-0/+6
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48150 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-30Doxygen updatesoej1-1/+19
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48149 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-30Adding some generic docs on extension and device states - watchers and providersoej1-1/+44
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48139 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-04Merged revisions 44378 via svnmerge from kpfleming1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r44378 | kpfleming | 2006-10-04 14:47:22 -0500 (Wed, 04 Oct 2006) | 4 lines update thread creation code a bit reduce standard thread stack size slightly to allow the pthreads library to allocate the stack+data and not overflow a power-of-2 allocation in the kernel and waste memory/address space add a new stack size for 'background' threads (those that don't handle PBX calls) when LOW_MEMORY is defined ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@44379 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-0/+383
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b