aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
AgeCommit message (Collapse)AuthorFilesLines
2007-11-16Start untangling header inclusion in a way that does not affectrizzo32-138/+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-12Based on a note in asterisk-dev by Brian Capouch, I determined I too ↵murf1-1/+1
agressive in not initializing arrays passed to pbx_substitute_variables_xxxx; I reviewed the code (again) and hopefully found every possible spot where substitute_variables is called conditionally, and made sure the char array involved was set to a null string. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89186 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-08Make func_env build again.file1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89121 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-08Add the FILE() dialplan function and deprecate ReadFile.tilghman1-0/+61
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89114 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-11-01This commits the performance mods that give the priority processing engine ↵murf4-7/+3
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-28Add a simple dialgroup function. By taking one of the simpler uses of Queuetilghman1-0/+224
away from Queue, we simplify the lives of people who do not need all the bells and whistles. Also, this is part of the functions that people need to reimplement Queue in the dialplan, as a set of logic, rather than as a single app with hundreds of options. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87264 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-28Merged revisions 87262 via svnmerge from tilghman4-4/+92
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r87262 | tilghman | 2007-10-28 08:46:55 -0500 (Sun, 28 Oct 2007) | 7 lines Add autoservice to several more functions which might delay in their responses. Also, make sure that func_odbc functions have a channel on which to set variables. Reported by russell Fixed by tilghman Closes issue #11099 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87263 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-27Make sure a channel exists before attempting to start or stop channelrussell2-7/+17
autoservice in func_lock and func_shell. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87233 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-26Merged revisions 87120 via svnmerge from tilghman1-2/+4
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r87120 | tilghman | 2007-10-26 08:54:30 -0500 (Fri, 26 Oct 2007) | 7 lines The addition of autoservice to func_curl additionally made func_curl dependent on the existence of a channel, with no real reason. This should make func_curl once again work without a channel. Reported by jmls. Fixed by tilghman. Closes issue #11090 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87121 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-26Use the same delimited character as the FILTER function in FIELDQTY and CUT.tilghman2-95/+12
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87103 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-23Merged revisions 86902 via svnmerge from murf1-2/+9
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r86902 | murf | 2007-10-23 15:18:08 -0600 (Tue, 23 Oct 2007) | 1 line closes issue #11052 -- where nothing after the ? will allow un-initialized variable values to corrupt and crash asterisk on 64-bit platforms ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86903 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-22Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former ↵qwell1-1/+1
didn't make much sense git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86820 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-19Convert NEW_CLI to AST_CLI.qwell1-1/+1
Closes issue #11039, as suggested by seanbright. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86536 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-16Merged revisions 85850 via svnmerge from file1-0/+3
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85850 | file | 2007-10-16 11:52:22 -0300 (Tue, 16 Oct 2007) | 4 lines Check to make sure a value has been given to the VMCOUNT dialplan function. (closes issue #10996) Reported by: marsosa ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85851 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-15Document my changes from Fridaytilghman1-0/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85633 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-12Enable ranges, hexadecimal, octal, and special backslashed characters for ↵tilghman1-2/+103
the FILTER function git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85522 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-11See if I can fix this borked ANI2 code I addedmattf1-7/+8
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85498 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-11Add ANI2 support to func_calleridmattf1-0/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85496 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-30* The documentation for the LOCK() function says that it will block for up torussell1-3/+10
3 seconds while waiting on a lock when other locks are currently held to avoid deadlocks. Change the code to reflect this. * Since trying to grab a lock may block for some time, put the channel in autoservice so that audio is still read from the channel and that any active generators on the channel don't pause. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84143 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-19put the channel in autoservice when executing func_shellrussell1-0/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83181 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-19Merged revisions 83177 via svnmerge from russell1-0/+4
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r83177 | russell | 2007-09-19 14:34:25 -0500 (Wed, 19 Sep 2007) | 4 lines Using curl can take a substantial amount of time, so the channel should be autoserviced while waiting for it to complete. (closes issue #10725, reported by mnicholson) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83178 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-12Merged revisions 82285 via svnmerge from tilghman1-1/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r82285 | tilghman | 2007-09-12 15:12:06 -0500 (Wed, 12 Sep 2007) | 4 lines Working on issue #10531 exposed a rather nasty 64-bit issue on ast_mktime, so we updated the localtime.c file from source. Next we'll have to write ast_strptime to match. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82290 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-06Add EXTENSION_STATE() function that can retrieve the state of an extension thatrussell1-0/+135
has a hint. (closes issue #10635, adamgundy) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81813 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-06Rename the DEVSTATE() function to DEVICE_STATE() to better conform to how otherrussell1-11/+11
functions are named. (inspired by issue #10635) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81784 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-06Merge HINT() dialplan function from my sandbox branch into trunk. This functionrussell1-0/+63
will let you retrieve the list of devices or name associated with a hint. (inspired by issue #10635) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81783 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-03Merged revisions 81415 via svnmerge from tilghman1-14/+17
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r81415 | tilghman | 2007-08-31 14:16:52 -0500 (Fri, 31 Aug 2007) | 2 lines The IF() function was not allowing true values that had embedded colons (closes issue #10613) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81431 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-28Add proper channel locking around the uses of datastore_add and _find. Thererussell1-1/+6
are still more places in the tree that I have not yet changed if someone wants to go through and find the places they are used without the channel locked. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81262 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-28* Constify the uid field of channel datastoresrussell1-2/+2
* Convert some spaces to tabs in func_volume * Add a note in channel.h making it clear that none of the datastore API calls lock the channel they are given, so the channel should be locked before calling the functions that take a channel argument. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81260 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-23Merged revisions 80547 via svnmerge from russell1-5/+3
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80547 | russell | 2007-08-23 14:29:44 -0500 (Thu, 23 Aug 2007) | 3 lines Revert very broken fix for issue #10540 ... none of these values take ms so I don't know what I was thinking ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80550 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-23Merged revisions 80539 via svnmerge from russell1-1/+5
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80539 | russell | 2007-08-23 14:21:53 -0500 (Thu, 23 Aug 2007) | 4 lines Fix func_timeout to take values in floating point so 1.5 actually means 1.5 seconds instead of being rounded. (closes issue #10540, reported by spendergrass, patch by me) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80540 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-21use ast_atomic_fetchadd_int for incrementing resultcountrussell1-4/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80226 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-17store and destroy implementations for realtime pgsql (closes issue #10372)tilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79859 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16Revise dialplan locks to permit multiple locks per channel, but with ↵tilghman1-36/+130
deadlock avoidance git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79813 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16Don't reload a configuration file if nothing has changed.tilghman1-2/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79747 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-10Store custom device states in astdb so that they will persist a restart. As arussell1-48/+35
side benefit, this simplifies the code a bit, too. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79098 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-10Merge a set of device state improvements from team/russell/events.russell1-1/+1
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-08-08Merge audiohooks branch into trunk. This is a new API for developers to ↵file1-0/+163
listen and manipulate the audio going through a channel. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@78649 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-31Add some documentation detailing an aspect of dialplan functions, as ↵tilghman1-2/+3
requested by Russell git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77838 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-31Add func_lock, which creates dialplan mutexes, and note that the Macro apps ↵tilghman1-0/+247
are now deprecated. (Closes issue #10264) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77834 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-31Mostly cleanup of documentation to substitute the pipe with the comma, but a ↵tilghman6-26/+28
few other formatting cleanups, too. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77808 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-26Do a massive conversion for using the ast_verb() macrorussell2-13/+5
(closes issue #10277, patches by mvanbaak) Basically, this changes ... if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3, "Something\n"); to ... ast_verb(3, "Something\n"); git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77299 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-23Merge the dialplan_aesthetics branch. Most of this patch simply converts ↵tilghman9-40/+64
applications using old methods of parsing arguments to using the standard macros. However, the big change is that the really old way of specifying application and arguments separated by a comma will no longer work (e.g. NoOp,foo|bar). Instead, the way that has been recommended since long before 1.0 will become the only method available (e.g. NoOp(foo,bar). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@76703 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-19After some study, thought, comparing, etc. I've backed out the previous ↵murf1-1/+1
universal mod to make ast_flags a 64 bit thing. Instead, I added a 64-bit version of ast_flags (ast_flags64), and 64-bit versions of the test-flag, set-flag, etc. macros, and an app_parse_options64 routine, and I use these in app_dial alone, to eliminate the 30-option limit it had grown to meet. There is room now for 32 more options and flags. I was heavily tempted to implement some of the other ideas that were presented, but this solution does not intro any new versions of dial, doesn't have a different API, has a minimal/zero impact on code outside of dial, and doesn't seriously (I hope) affect the code structure of dial. It's the best I can think of right now. My goal was NOT to rewrite dial. I leave that to a future, coordinated effort. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75983 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-18Merge in ast_strftime branch, which changes timestamps to be accurate to the ↵tilghman2-13/+23
microsecond, instead of only to the second git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75706 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-18Clean up func_curl a bit.file1-8/+6
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75586 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-17via 10206, I have added an option (e) to Dial to allow the h exten to get ↵murf1-1/+1
run on peer. Had to upgrade ast_flag stuff to 64 bits to do this. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75400 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-16For my next trick I will make it so dialplan functions no longer need to ↵file7-61/+2
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-16It is no longer required for each module that deals with a channel to call ↵file6-21/+4
ast_module_user_hangup_all in it's unload function. The loader will automatically perform this action for it. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75183 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-16Cast the 2nd argument to iconv() to a void *, as some systems define it as arussell1-1/+8
(const char *), while others define it as (char *). This is done to suppress compiler warnings about it. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75163 f38db490-d61c-443f-a65b-d21fe96a405b