summaryrefslogtreecommitdiff
path: root/main/pbx.c
AgeCommit message (Collapse)Author
2007-07-05In regards to changes for 9508, expr2 system choking on floating point ↵Steve Murphy
numbers, I'm adding this update to round out (no pun intended) and make this FP-capable version of the Expr2 stuff interoperate better with previous integer-only usage, by providing Functions syntax, with 20 builtin functions for floating pt to integer conversions, and some general floating point math routines that might commonly be used also. Along with this, I made it so if a function was not a builtin, it will try and find it in the ast_custom_function list, and if found, execute it and collect the results. Thus, you can call system functions like CDR(), CHANNEL(), etc, from within $\[..\] exprs, without having to wrap them in $\{...\} (curly brace) notation. Did a valgrind on the standalone and made sure there's no mem leaks. Looks good. Updated the docs, too. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02After some discussion on the asterisk-dev list, we determined that this approachRussell Bryant
for extracting application, function, manager, and agi documentation is the wrong one to take. The most severe problem is that the output depends on which modules are loaded as well as compile time options, which both determine which parts are available. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02Add "core dump funcdocs" CLI commandRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02change the "core dump appdocs" CLI command to use the new API for creatingRussell Bryant
CLI commands git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20Fix trunk brokenness; also, optimize application registrationTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20Cleaning up a small disaster I created earlierSteve Murphy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14Convert uses of strdup() to ast_strdup()Russell Bryant
(issue #9983, eliel) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14Merged revisions 69392 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r69392 | kpfleming | 2007-06-14 16:50:40 -0500 (Thu, 14 Jun 2007) | 2 lines use ast_localtime() in every place localtime_r() was being used ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13Fixes for ast_strlen_zero() janitor project.Jason Parker
Issue 9968, patch by eliel. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12Convert pbx.c to use ast_debug() for debug logging.Russell Bryant
(issue #9925, dimas) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-08Add channel variable manager eventRussell Bryant
(issue #7291, patch from tonyh and jontow) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68473 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-06-01remove a bogus comment that came from copy/pasteRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@66959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-01Merge major changes to the way device state is passed around Asterisk. The twoRussell Bryant
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: https://origsvn.digium.com/svn/asterisk/trunk@66958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24Add a new API call for creating detached threads. Then, go replace all of theRussell Bryant
places in the code where the same block of code for creating detached threads was replicated. (patch from bbryant) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@65968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-14Merged revisions 64193 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r64193 | murf | 2007-05-14 07:58:42 -0600 (Mon, 14 May 2007) | 1 line As per 9570, worrisome CDR warnings have been removed, that are either not helpful, or not relevant. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@64208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02Merged revisions 62738 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r62738 | murf | 2007-05-02 14:46:07 -0600 (Wed, 02 May 2007) | 9 lines Merged revisions 62737 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r62737 | murf | 2007-05-02 14:10:32 -0600 (Wed, 02 May 2007) | 1 line Some tweaks to satisfy CDR bug 8796, where being in 'h' extension louses up the dst field ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02Merged revisions 62689 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r62689 | murf | 2007-05-02 11:10:50 -0600 (Wed, 02 May 2007) | 1 line a)In chan_zap, set the clid, src fields in channel_alloc call. b)in the channel_alloc func, set the cid_num and name fields from the arglist[blush]. c) don't update the channel app & app data fields if you are in the 'h' extension. d)the load_module func in cdr_radius needs to return DECLINE, SUCCESS. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62690 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-27Merged revisions 62171 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r62171 | russell | 2007-04-27 11:14:11 -0500 (Fri, 27 Apr 2007) | 6 lines If no variables were passed into pbx_substitute_variables_helper_full(), then don't even bother creating a temporary bogus channel, since that is only for allowing certain functions to operate on the variables as if they were on a channel. Most importantly, this fixes a crash. (issue #9613, reported by callguy, fixed by me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-23Merged revisions 61765 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r61765 | russell | 2007-04-23 13:17:00 -0500 (Mon, 23 Apr 2007) | 5 lines Some dialplan functions, such as CUT(), expect to operate on variables on a channel. So, this little hack lets them work in places where a channel doesn't exist, such as within DUNDi configuration. (issue #9465, reported and patched by Corydon76, testing by blitzrage) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11changed #if HAVE_SYSINFO to #if defined(HAVE_SYSINFO)Dwayne M. Hubbard
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11added HAVE_SYSINFO preprocessor directives for portability and general happinessDwayne M. Hubbard
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-11added option_minmemfree for use in asterisk.conf to specify the amount of ↵Dwayne M. Hubbard
minimum free memory prior to accepting calls. added CLI 'core show sysinfo' to display system information git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-10Merged revisions 60989 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r60989 | murf | 2007-04-09 12:32:07 -0600 (Mon, 09 Apr 2007) | 1 line This is a big improvement over the current CDR fixes. It may still need refinement, but this won't have as many folks bothered. This also adds the mods from 1.4/r.61136; ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-30Merged revisions 59522 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r59522 | murf | 2007-03-30 11:51:17 -0600 (Fri, 30 Mar 2007) | 1 line several changes via kpflemings review ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-30Merged revisions 59486 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r59486 | murf | 2007-03-30 08:11:59 -0600 (Fri, 30 Mar 2007) | 1 line These mods fix CDR issues from 8221, 8593, 8680, 8743, and perhaps others. Mainly with CDRs generated from transfer situations. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-16Merged revisions 58946 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r58946 | tilghman | 2007-03-15 18:52:48 -0500 (Thu, 15 Mar 2007) | 2 lines Refashion dump command to match common syntax and update the resulting appdocs TeX file ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-16Fix trunk so that it compiles againTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15Merged revisions 58931 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r58931 | russell | 2007-03-15 17:25:12 -0500 (Thu, 15 Mar 2007) | 13 lines Merge changes from svn/asterisk/team/russell/LaTeX_docs. * Convert most of the doc directory into a single LaTeX formatted document so that we can generate a PDF, HTML, or other formats from this information. * Add a CLI command to dump the application documentation into LaTeX format which will only be include if the configure script is run with --enable-dev-mode. * The PDF turned out to be close to 1 MB, so it is not included. However, you can simply run "make asterisk.pdf" to generate it yourself. We may include it in release tarballs or have automatically generated ones on the web site, but that has yet to be decided. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-05Merged revisions 57826 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r57826 | murf | 2007-03-05 08:20:17 -0700 (Mon, 05 Mar 2007) | 9 lines Merged revisions 57825 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r57825 | murf | 2007-03-05 07:53:57 -0700 (Mon, 05 Mar 2007) | 1 line Fixed a typo introduced via 9156 (either the gotos or their doc strings are wrong) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@57827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-02Don't try to do recursive locking/unlocking when it isn't supported.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@57519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-02Merged revisions 57473 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r57473 | murf | 2007-03-02 09:55:16 -0700 (Fri, 02 Mar 2007) | 9 lines Merged revisions 57458 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r57458 | murf | 2007-03-02 09:39:33 -0700 (Fri, 02 Mar 2007) | 1 line further refinement in wording of goto documentation, as per 9156, goto not proceeding to next instruction ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@57476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-01Minor code cleanup... nothing to write home about.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@57241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28Convert the PBX core to use read/write locks. This yields a nifty ↵Joshua Colp
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: https://origsvn.digium.com/svn/asterisk/trunk@57184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-28Merged revisions 57139 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r57139 | murf | 2007-02-28 12:23:05 -0700 (Wed, 28 Feb 2007) | 9 lines Merged revisions 57118 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r57118 | murf | 2007-02-28 12:12:41 -0700 (Wed, 28 Feb 2007) | 1 line a small documentation update, to reflect reality in the goto doc strings, as per 9156, Goto does not proceed to next prio if jump fails ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@57140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26Merged revisions 56805 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r56805 | file | 2007-02-26 12:09:53 -0500 (Mon, 26 Feb 2007) | 2 lines Use ast_strlen_zero to see if the language and/or context argument is not present for Background instead of just checking if it is NULL. (issue #9141 reported by mjagdis) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56811 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-01Merged revisions 53070 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r53070 | tilghman | 2007-02-01 13:21:20 -0600 (Thu, 01 Feb 2007) | 10 lines Merged revisions 53069 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r53069 | tilghman | 2007-02-01 13:13:53 -0600 (Thu, 01 Feb 2007) | 2 lines No wonder FIELDQTY doesn't work with functions... the documentation in pbx.c was wrong ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-31Merged revisions 53046 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r53046 | russell | 2007-01-31 15:32:08 -0600 (Wed, 31 Jan 2007) | 11 lines Merged revisions 53045 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r53045 | russell | 2007-01-31 15:25:11 -0600 (Wed, 31 Jan 2007) | 3 lines Fix a bunch of places where pthread_attr_init() was called, but pthread_attr_destroy() was not. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23Cosmetic changes. Make main source files better conform to coding guidelines ↵Joshua Colp
and standards. (issue #8679 reported by johann8384) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-21Fix bug introduced during constification (reported by tzanger via IRC)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51353 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18Merged revisions 51265 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r51265 | qwell | 2007-01-18 16:50:23 -0600 (Thu, 18 Jan 2007) | 4 lines Add some more checks for option_debug before ast_log(LOG_DEBUG, ...) calls. Issue 8832, patch(es) by tgrman ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-12make the automatic post-answer delay happen only when the answer is ↵Kevin P. Fleming
'automatic' (not done by the Answer() dialplan application) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@50571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-12Merged revisions 50562 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r50562 | kpfleming | 2007-01-12 08:42:24 -0600 (Fri, 12 Jan 2007) | 10 lines Merged revisions 50561 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r50561 | kpfleming | 2007-01-12 08:34:15 -0600 (Fri, 12 Jan 2007) | 2 lines minor documentation clarification ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@50563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-10Merged revisions 50266 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r50266 | file | 2007-01-09 22:51:29 -0500 (Tue, 09 Jan 2007) | 2 lines Ensure data's existence before trying to access it. (issue #8774 reported by rcourtna) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@50267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-06Merged revisions 49742 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r49742 | qwell | 2007-01-05 18:24:38 -0600 (Fri, 05 Jan 2007) | 7 lines Save 1 whopping byte of allocated memory! This looks like it may have been a chicken/egg scenario.. You had to call a cleanup func, because everything was allocated. Then since you had to call a cleanup func, you were forced to allocate - ie; strdup(""). ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05const-ify some more APIs, and fix rev 49710 from branch-1.4 in a better way hereKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05Merged revisions 49676 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r49676 | kpfleming | 2007-01-05 16:16:33 -0600 (Fri, 05 Jan 2007) | 2 lines reduce stack consumption for AMI and AMI/HTTP requests by nearly 20K in most cases ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27Merged revisions 49006 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r49006 | kpfleming | 2006-12-27 16:06:56 -0600 (Wed, 27 Dec 2006) | 2 lines since these variables all have static duration, none of them need initializers (they default to zero anyway) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-21Switch list of global variables to read/write locks.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-21Convert alternate dialplan switch list to use read/write locks.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48680 65c4cc65-6c06-0410-ace0-fbb531ad65f3