aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/pbx.h
AgeCommit message (Collapse)AuthorFilesLines
2009-03-09Merged revisions 180719 via svnmerge from jpeeler1-1/+3
https://origsvn.digium.com/svn/asterisk/trunk ........ r180719 | jpeeler | 2009-03-09 15:58:17 -0500 (Mon, 09 Mar 2009) | 16 lines Add Doxygen documentation for API changes from 1.6.0 to 1.6.1 Copied from my review board description: This is a continuation of the API changes documentation started for describing changes between releases. Most of the API changes were pretty simple needing only to be brought to attention via the new "Asterisk API Changes" list. However, if you see anything that needs further explanation feel free to supplement what is there. The current method of documenting is to add (in the header file): \version <ver number> <description of changes> and then to add the function to the change list in doxyref.h on the AstAPIChanges page. I also made sure all the functions that were newly added were tagged with \since 1.6.1. I think this is a good habit to start both for the historical aspect as well as for the future ability to easily add a "New Asterisk API" page. Review: http://reviewboard.digium.com/r/190/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@180740 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-24Merged revisions 166665 via svnmerge from murf1-3/+0
https://origsvn.digium.com/svn/asterisk/trunk This merged from trunk with no conflicts. I tested mostly the 'tired' cases, and for the most part ignored the tests for reconnecting and dialing in to fetch a parked call, after the first case. ................ r166665 | murf | 2008-12-23 11:13:49 -0700 (Tue, 23 Dec 2008) | 153 lines Merged revisions 166093 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 In order to merge this 1.4 patch into trunk, I had to resolve some conflicts and wait for Russell to make some changes to res_agi. I re-ran all the tests; 39 calls in all, and made fairly careful notes and comparisons: I don't want this to blow up some aspect of asterisk; I completely removed the KEEPALIVE from the pbx.h decls. The first 3 scenarios involving feature park; feature xfer to 700; hookflash park to Park() app call all behave the same, don't appear to leave hung channels, and no crashes. ........ r166093 | murf | 2008-12-19 15:30:32 -0700 (Fri, 19 Dec 2008) | 131 lines This merges the masqpark branch into 1.4 These changes eliminate the need for (and use of) the KEEPALIVE return code in res_features.c; There are other places that use this result code for similar purposes at a higher level, these appear to be left alone in 1.4, but attacked in trunk. The reason these changes are being made in 1.4, is that parking ends a channel's life, in some situations, and the code in the bridge (and some other places), was not checking the result code properly, and dereferencing the channel pointer, which could lead to memory corruption and crashes. Calling the masq_park function eliminates this danger in higher levels. A series of previous commits have replaced some parking calls with masq_park, but this patch puts them ALL to rest, (except one, purposely left alone because a masquerade is done anyway), and gets rid of the code that tests the KEEPALIVE result, and the NOHANGUP_PEER result codes. While bug 13820 inspired this work, this patch does not solve all the problems mentioned there. I have tested this patch (again) to make sure I have not introduced regressions. Crashes that occurred when a parked party hung up while the parking party was listening to the numbers of the parking stall being assigned, is eliminated. These are the cases where parking code may be activated: 1. Feature one touch (eg. *3) 2. Feature blind xfer to parking lot (eg ##700) 3. Run Park() app from dialplan (eg sip xfer to 700) (eg. dahdi hookflash xfer to 700) 4. Run Park via manager. The interesting testing cases for parking are: I. A calls B, A parks B a. B hangs up while A is getting the numbers announced. b. B hangs up after A gets the announcement, but before the parking time expires c. B waits, time expires, A is redialed, A answers, B and A are connected, after which, B hangs up. d. C picks up B while still in parking lot. II. A calls B, B parks A a. A hangs up while B is getting the numbers announced. b. A hangs up after B gets the announcement, but before the parking time expires c. A waits, time expires, B is redialed, B answers, A and B are connected, after which, A hangs up. d. C picks up A while still in parking lot. Testing this throroughly involves acting all the permutations of I and II, in situations 1,2,3, and 4. Since I added a few more changes (ALL references to KEEPALIVE in the bridge code eliimated (I missed one earlier), I retested most of the above cases, and no crashes. H-extension weirdness. Current h-extension execution is not completely correct for several of the cases. For the case where A calls B, and A parks B, the 'h' exten is run on A's channel as soon as the park is accomplished. This is expected behavior. But when A calls B, and B parks A, this will be current behavior: After B parks A, B is hung up by the system, and the 'h' (hangup) exten gets run, but the channel mentioned will be a derivative of A's... Thus, if A is DAHDI/1, and B is DAHDI/2, the h-extension will be run on channel Parked/DAHDI/1-1<ZOMBIE>, and the start/answer/end info will be those relating to Channel A. And, in the case where A is reconnected to B after the park time expires, when both parties hang up after the joyful reunion, no h-exten will be run at all. In the case where C picks up A from the parking lot, when either A or C hang up, the h-exten will be run for the C channel. CDR's are a separate issue, and not addressed here. As to WHY this strange behavior occurs, the answer lies in the procedure followed to accomplish handing over the channel to the parking manager thread. This procedure is called masquerading. In the process, a duplicate copy of the channel is created, and most of the active data is given to the new copy. The original channel gets its name changed to XXX<ZOMBIE> and keeps the PBX information for the sake of the original thread (preserving its role as a call originator, if it had this role to begin with), while the new channel is without this info and becomes a call target (a "peer"). In this case, the parking lot manager thread is handed the new (masqueraded) channel. It will not run an h-exten on the channel if it hangs up while in the parking lot. The h exten will be run on the original channel instead, in the original thread, after the bridge completes. See bug 13820 for our intentions as to how to clean up the h exten behavior. Review: http://reviewboard.digium.com/r/29/ ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@166730 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-18Merged revisions 165723 via svnmerge from russell1-0/+31
https://origsvn.digium.com/svn/asterisk/trunk ........ r165723 | russell | 2008-12-18 13:33:42 -0600 (Thu, 18 Dec 2008) | 14 lines Remove the need for AST_PBX_KEEPALIVE with the GoSub option from Dial. This is part of an effort to completely remove AST_PBX_KEEPALIVE and other similar return codes from the source. While this usage was perfectly safe, there are others that are problematic. Since we know ahead of time that we do not want to PBX to destroy the channel, the PBX API has been changed so that information can be provided as an argument, instead, thus removing the need for the KEEPALIVE return value. Further changes to get rid of KEEPALIVE and related code is being done by murf. There is a patch up for that on review 29. Review: http://reviewboard.digium.com/r/98/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@165728 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-15Merged revisions 164423 via svnmerge from mmichelson1-0/+4
https://origsvn.digium.com/svn/asterisk/trunk ................ r164423 | mmichelson | 2008-12-15 13:53:29 -0600 (Mon, 15 Dec 2008) | 11 lines Merged revisions 164422 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r164422 | mmichelson | 2008-12-15 13:53:08 -0600 (Mon, 15 Dec 2008) | 3 lines Add the deadlock note to ast_spawn_extension as well ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@164425 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-15Merged revisions 164419 via svnmerge from mmichelson1-0/+20
https://origsvn.digium.com/svn/asterisk/trunk ................ r164419 | mmichelson | 2008-12-15 13:51:24 -0600 (Mon, 15 Dec 2008) | 12 lines Merged revisions 164416 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r164416 | mmichelson | 2008-12-15 13:45:07 -0600 (Mon, 15 Dec 2008) | 4 lines Add notes to autoservice and pbx doxygen regarding a potential deadlock scenario so that it is avoided in the future ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@164421 f38db490-d61c-443f-a65b-d21fe96a405b
2008-10-29Merged revisions 152536 via svnmerge from murf1-6/+7
https://origsvn.digium.com/svn/asterisk/trunk ................ r152536 | murf | 2008-10-28 23:01:00 -0600 (Tue, 28 Oct 2008) | 57 lines Merged revisions 152535 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r152535 | murf | 2008-10-28 22:36:32 -0600 (Tue, 28 Oct 2008) | 46 lines The magic trick to avoid this crash is not to try to find the channel by name in the list, which is slow and resource consuming, but rather to pay attention to the result codes from the ast_bridge_call, to which I added the AST_PBX_NO_HANGUP_PEER_PARKED value, which now are returned when a channel is parked. Why? because CDR's aren't generated via parking, so nothing is needed, but if a transfer occurred, there are critical things I need. If you get AST_PBX_KEEPALIVE, then don't touch the channel pointer. If you get AST_PBX_NO_HANGUP_PEER, or AST_PBX_NO_HANGUP_PEER_PARKED, then don't touch the peer pointer. Updated the several places where the results from a bridge were not being properly obeyed, and fixed some code I had introduced so that the results of the bridge were not overridden (in trunk). All the places that previously tested for AST_PBX_NO_HANGUP_PEER now have to check for both AST_PBX_NO_HANGUP_PEER and AST_PBX_NO_HANGUP_PEER_PARKED. I tested this against the 4 common parking scenarios: 1. A calls B; B answers; A parks B; B hangs up while A is getting the parking slot announcement, immediately after being put on hold. 2. A calls B; B answers; A parks B; B hangs up after A has been hung up, but before the park times out. 3. A calls B; B answers; B parks A; A hangs up while B is getting the parking slot announcement, immediately after being put on hold. 4. A calls B; B answers; B parks A; A hangs up after B has been hung up, but before the park times out. No crash. I also ran the scenarios above against valgrind, and accesses looked good. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@152537 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-09Code wasn't ready to be merged - see -dev list discussiontilghman1-3/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@129307 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-06Changing name of global api call to ast_* oej1-1/+1
My mistake, pointed out by Russell. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@128378 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-05Implement flags for AGI in the channel structure so taht "show channels" andoej1-0/+3
AMI commands can display that a channel is under control of an AGI. Work inspired by work at customer site, but paid for by Edvina AB git-svn-id: http://svn.digium.com/svn/asterisk/trunk@128240 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-04Merged revisions 127973 via svnmerge from tilghman1-1/+10
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r127973 | tilghman | 2008-07-03 22:30:30 -0500 (Thu, 03 Jul 2008) | 8 lines Fix the 'dialplan remove extension' logic, so that it a) works with cidmatch, and b) completes contexts correctly when the extension is ambiguous. (closes issue #12980) Reported by: licedey Patches: 20080703__bug12980.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@128027 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-16(closes issue #12689)murf1-1/+1
Reported by: ys Many thanks to ys for doing the research on this problem. I didn't think it would be best to unlock the contexts and then relock them after the remove_extension2() call, so I added an extra arg to remove_extension2() and set it appropriately in each call. There were not that many. I considered forcing the code to lock the contexts before the call to remove_extension2(), but that would require a slightly greater degree of changes, especially since the find_context_locked is local to pbx.c I did a simple sanity test to make sure the code doesn't mess things up in general. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@123165 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-01Modify TIMEOUT() to be accurate down to the millisecond.tilghman1-2/+2
(closes issue #10540) Reported by: spendergrass Patches: 20080417__bug10540.diff.txt uploaded by Corydon76 (license 14) Tested by: blitzrage git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115076 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-28Add incomplete matching to PBX code and app_dialtilghman1-0/+1
(closes issue #12351) Reported by: Corydon76 Patches: 20080402__pbx_incomplete__3.diff.txt uploaded by Corydon76 (license 14) pbx_incomplete_with_timeout.diff uploaded by fabled (license 448) Tested by: Corydon76, fabled git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114773 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-22Allow setqueuevar=yes (et al) to work, after changes to pbx_builtin_setvar()qwell1-0/+1
(closes issue #12490) Reported by: bcnit Patches: 12490-queuevars-3.diff uploaded by qwell (license 4) Tested by: qwell git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114540 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-28Make some notes about common usage of pbx_builtin_getvar_helper() that is notrussell1-0/+14
thread-safe. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@111909 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-17(closes issue #12238)murf1-0/+2
Reported by: mvanbaak Tested by: murf, mvanbaak Due to a bug that occurred when merge_contexts_and_delete scanned the "old" or existing contexts, and found a context that doesn't exist in the new set, yet owned by a different registrar. The context is created in the new set, with the old registrar, and and all the priorities and extens that have a different registrar are copied into it. But, not the includes, ignorepats, and switches. I added code to do this immediately after the context is created. This still leaves a logical hole in the code. If you define a context in two places, (eg. in extensions.conf and also in extensions.ael), and they both have includes, but different in composition, no new context will be generated, and therefore the 'old' includes, switches, and ignorepats will not be copied. I'd have added code to simply add any non-duplicates into the 'new' context that had a different registrar, but there is one big complication: includes, and switches are definitely order dependent. (ignorepats I'm not sure about). And we'll have to develop some sort of policy about how we merge order dependent lists, especially if the intersection of the two sets is empty. (in other words, they do not have any elements in common). Do the new go first, or the old? I've elected to punt this issue until a user complains. Hopefully, this is pretty rare thing. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@109169 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-10(closes issue #6019)tilghman1-0/+5
Reported by: ssokol Patches: 20080304__bug6019.diff.txt uploaded by Corydon76 (license 14) Tested by: putnopvut git-svn-id: http://svn.digium.com/svn/asterisk/trunk@107231 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-07(closes issue #6002)murf1-18/+20
Reported by: rizzo Tested by: murf Proposal of the changes to be made, and then an announcement of how they were accomplished: http://lists.digium.com/pipermail/asterisk-dev/2008-February/032065.html and: http://lists.digium.com/pipermail/asterisk-dev/2008-March/032124.html Here is a recap, file by file, of what I have done: pbx/pbx_config.c pbx/pbx_ael.c All funcs that were passed a ptr to the context list, now will ALSO be passed a hashtab ptr to the same set. Why? because (for the time being), the dialplan is stored in both, to facilitate a quick, low-cost move to hash-tables to speed up dialplan processing. If it was deemed necessary to pass the context LIST, well, it is just as necessary to have the TABLE available. This is because the list/table in question might not be the global one, but temporary ones we would use to stage the dialplan on, and then swap into the global position when things are ready. We now have one external function for apps to use, "ast_context_find_or_create()" instead of the pre-existing "find" and "create", as all existing usages used both in tandem anyway. pbx_config, and pbx_ael, will stage the reloaded dialplan into local lists and tables, and then call merge_contexts_and_delete, which will merge (now) existing contexts and priorities from other registrars into this local set by copying them. Then, merge_contexts_and_delete will lock down the contexts, swap the lists and tables, and unlock (real quick), and then destroy the old dialplan. chan_sip.c chan_iax.c chan_skinny.c All the channel drivers that would add regcontexts now use the ast_context_find_or_create now. chan_sip also includes a small fix to get rid of warnings about removing priorities that never got entered. apps/app_meetme.c apps/app_dial.c apps/app_queue.c All the apps that added a context/exten/priority were also modified to use ast_context_find_or_create instead. include/asterisk/pbx.h ast_context_create() is removed. Find_or_create_ is the new method. ast_context_find_or_create() interface gets the hashtab added. ast_merge_contexts_and_delete() gets the local hashtab arg added. ast_wrlock_contexts_version() is added so you can detect if someone else got a writelock between your readlocking and writelocking. ast_hashtab_compare_contexts was made public for use in pbx_config/pbx_ael ast_hashtab_hash_contexts was in like fashion make public. include/asterisk/pval.h ast_compile_ael2() interface changed to include the local hashtab table ptr. main/features.c For the sake of the parking context, we use ast_context_find_or_create(). main/pbx.c I changed all the "tree" names to "table" instead. That's because the original implementation was based on binary trees. (had a free library). Then I moved to hashtabs. Now, the names move forward too. refcount field added to contexts, so you can keep track of how many modules wanted this context to exist. Some log messages that are warnings were inflated from LOG_NOTICE to LOG_WARNING. Added some calls to ast_verb(3,...) for debug messages Lots of little mods to ast_context_remove_extension2, which is now excersized in ways it was not previously; one definite bug fixed. find_or_create was upgraded to handle both local lists/tables as well as the globals. context_merge() was added to do the per-context merging of the old/present contexts/extens/prios into the new/proposed local list/tables ast_merge_contexts_and_delete() was heavily modified. ast_add_extension2() was also upgraded to handle changes. the context_destroy() code was re-engineered to handle the new way of doing things, by exten/prio instead of by context. res/ael/pval.c res/ael/ael.tab.c res/ael/ael.tab.h res/ael/ael.y res/ael/ael_lex.c res/ael/ael.flex utils/ael_main.c utils/extconf.c utils/conf2ael.c utils/Makefile Had to change the interface to ast_compile_ael2(), to include the hashtab ptr. This ended up involving several external apps. The main gotcha was I had to include lock.h and hashtab.h in several places. As a side note, I tested this stuff pretty thoroughly, I replicated the problems originally reported by Luigi, and made triply sure that reloads worked, and everything worked thru "stop gracefully". I found a and fixed a few bugs as I was merging into trunk, that did not appear in my tests of bug6002. How's this for verbose commit messages? git-svn-id: http://svn.digium.com/svn/asterisk/trunk@106757 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-18Add an API call (ast_async_parseable_goto) which parses a goto string and ↵file1-0/+5
does an async goto instead of an explicit goto. (closes issue #11753) Reported by: johan git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103765 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07Add count of total number of calls processed by asterisk during it's lifetime.qwell1-0/+5
Add number of total calls and current calls to SNMP. Closes issue #10057, patch by jcmoore. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91779 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-28Merged revisions 89893 via svnmerge from russell1-1/+20
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89893 | russell | 2007-11-27 18:20:13 -0600 (Tue, 27 Nov 2007) | 4 lines - update documentation for some of the goto functions to note that they handle locking the channel as needed - update ast_explicit_goto() to lock the channel as needed ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89915 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-24closes issue #11363; where the pattern _20x. buried in an included context, ↵murf1-0/+5
didn't match 2012; There were a small set of problems to fix: 1. I needed NOT to score patterns unless you are at the end of the data string. 2. Capital N,X,Z and small n,x,z are OK in patterns. I canonicalize the patterns in the trie to caps. 3. When a pattern ends with dot or exclamation, CANMATCH/MATCHMORE should always report this pattern, no matter the length. With this commit, I also supplied the wish of Luigi, where the user can select which pattern matching algorithm to use, the old (legacy) pattern matcher, or the new, trie based matcher. The OLD matcher is the default. A new [general] section variable, extenpatternmatchnew, is added to the extensions.conf, and the example config has it set to false. If true, the new matcher is used. In all other respects, the context/exten structs are the same; the tries and hashtabs are formed, but in the new mode the tries are not used. A new CLI command 'dialplan set extenpatternmatch true/false' is provided to allow switching at run time. I beg users that are forced to return to the old matcher to please report the reason in the bug tracker. Measured the speed benefit of the new matcher against an impossibly large context with 10,000 extensions: the new matcher is 374 times faster. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89547 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-22shuffle a little bit the content of header files to reduce dependencies.rizzo1-54/+1
In this commit: - move the ast_register/unregister_app functions to module.h to avoid the need to include pbx.h for the simpler apps; - move the ast_group structure to channel.h to remove the dependency of app.h on linkedlists.h Note, this is a long process that I am doing in small steps. The main difficulty is that now for each subsystem we have a single header (e.g. channel.h) included by the subsystem provider (usually one file, e.g. channel.c) and by its clients (dozens of them, e.g. we have some 70+ apps and 30+ functions). This requires the clients to include all the extra headers required by the provider (eg. lock.h, linkedlists.h, definitions of substructures...) even though many of the clients would be just happy with opaque struct declarations and function prototypes. The long term plan is to eventually rectify this structure so that the compilation can become faster, and also APIs are more stable. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89522 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-12Doxygen fixes.qwell1-0/+2
Also fix a common typo I kept seeing (arguement) in various files. Closes issue #11222, patch by snuffy (with arguement > argument by me). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89202 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-06Merged revisions 88805 via svnmerge from russell1-0/+25
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r88805 | russell | 2007-11-05 16:07:54 -0600 (Mon, 05 Nov 2007) | 12 lines After seeing crashes related to channel variables, I went looking around at the ways that channel variables are handled. In general, they were not handled in a thread-safe way. The channel _must_ be locked when reading or writing from/to the channel variable list. What I have done to improve this situation is to make pbx_builtin_setvar_helper() and friends lock the channel when doing their thing. Asterisk API calls almost all lock the channel for you as necessary, but this family of functions did not. (closes issue #10923, reported by atis) (closes issue #11159, reported by 850t) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88934 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-02Add pbx_lua as a method of doing extensionstilghman1-0/+14
Reported by: mnicholson Patch by: mnicholson Closes issue #11140 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88250 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-01This commits the performance mods that give the priority processing engine ↵murf1-1/+1
in the pbx, a 25-30% speed boost. The two updates used, are, first, to merge the ast_exists_extension() and the ast_spawn_extension() where they are called sequentially in a loop in the code, into a slightly upgraded version of ast_spawn_extension(), with a few extra args; and, second, I modified the substitute_variables_helper_full, so it zeroes out the byte after the evaluated string instead of demanding you pre-zero the buffer; I also went thru the code and removed the code that zeroed this buffer before every call to the substitute_variables_helper_full. The first fix provides about a 9% speedup, and the second the rest. These figures come from the 'PIPS' benchmark I describe in blogs, conf. reports, etc. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88166 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-03Create a universal exception handling extension, "e" (closes issue #9785)tilghman1-0/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84580 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-15This commit closes bug 7605, and half-closes 7638. The AEL code has been ↵murf1-0/+46
redistributed/repartitioned to allow code re-use both inside and outside of Asterisk. This commit introduces the utils/conf2ael program, and an external config-file reader, for both normal config files, and for extensions.conf (context, exten, prio); It provides an API for programs outside of asterisk to use to play with the dialplan and config files. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79595 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-16Change the function name slightly... just for kpfleming!file1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75260 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-16For my next trick I will make it so dialplan functions no longer need to ↵file1-2/+8
call ast_module_user_add and ast_module_user_remove. These are now called in the ast_func_read and ast_func_write functions outside of the module. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75255 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-16Applications no longer need to call ast_module_user_add and ↵file1-2/+22
ast_module_user_remove. This is now taken care of in the pbx_exec function outside of the application. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75200 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-16Merge a bunch of doxygen updates to header files. This includes changes torussell1-7/+8
use the \retval tag for documenting return values, fixing various warnings when generating the documentation, and various other things. (closes issue #10203, snuffy) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75164 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-01Merge major changes to the way device state is passed around Asterisk. The tworussell1-2/+0
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-02-28Convert the PBX core to use read/write locks. This yields a nifty ↵file1-4/+22
performance improvement when it comes to simultaneous calls going through the dialplan. Using murf's test the old mutex based core took an average of 57.3 seconds while the rwlock based core took 31.1 seconds. That's a nifty 26.2 seconds performance improvement. The other good part is that if we do need to switch back then we just have to change the lock/unlock API calls. I converted everywhere that used to touch the mutex locks directly to use them. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@57184 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-05const-ify some more APIs, and fix rev 49710 from branch-1.4 in a better way herekpfleming1-4/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@49711 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-18convert the final clients of ast_build_string to use ast_str_*()rizzo1-1/+1
Now the only module left using it is chan_sip.c git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48559 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-12Fix various spelling mistakes in comments.russell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48417 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-30Documentation updatesoej1-5/+34
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48164 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-02Let's make application/function/hint lists read/write lists... just for kicksfile1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47037 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-16merge markster's usersconf branch with some slight changeskpfleming1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43052 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-14add MacroExclusive application, a Macro that only one call can executed atrussell1-0/+23
a time (issue #7366, Steve Davies, with mods by me as discussed in the report) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39681 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-08Support hold/unhold in Zap, update IAX2 parser to know about modern ↵markster1-0/+1
commands, forward hold/unhold in dial, add hold device state and implement holding in the SLA. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37318 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-09Formatting fixoej1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26131 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-08 - convert the lists of switches to use the linked list macrosrussell1-1/+2
- remove some checks of the result of ast_mutex_lock, since it is not necessary (this would be a good project to add to the janitor projects list). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25443 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-08remove an XXX commentrussell1-1/+8
- we can't use ast_true here because non-empty strings would no longer be evaluated as true document the return values of pbx_checkcondition() in doxygen format git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25411 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-05constify the argument to pbx_checkconditionrussell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@24878 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-01- convert the list of dialplan function to the list macrosrussell1-1/+1
- add missing locking of the functions list in the "show functions" CLI command git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23950 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-14constify a couple of function argumentsrizzo1-5/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20138 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-05- Doxygen fixesoej1-32/+24
- Typos corrected git-svn-id: http://svn.digium.com/svn/asterisk/trunk@17694 f38db490-d61c-443f-a65b-d21fe96a405b