summaryrefslogtreecommitdiff
path: root/funcs/func_strings.c
AgeCommit message (Collapse)Author
2012-10-29Make evaluation of channel variables consistently case-sensitive.Mark Michelson
Due to inconsistencies in how variable names were evaluated, the decision was made to make all evaluations case-sensitive. See the UPGRADE.txt file or https://wiki.asterisk.org/wiki/display/AST/Case+Sensitivity for more details. (closes issue ASTERISK-20163) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2160 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31Clean up and ensure proper usage of alloca()Kinsey Moore
This replaces all calls to alloca() with ast_alloca() which calls gcc's __builtin_alloca() to avoid BSD semantics and removes all NULL checks on memory allocated via ast_alloca() and ast_strdupa(). (closes issue ASTERISK-20125) Review: https://reviewboard.asterisk.org/r/2032/ Patch-by: Walter Doekes (wdoekes) ........ Merged revisions 370642 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370643 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06Add missing newlines to CLI loggingKinsey Moore
........ Merged revisions 361471 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361472 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29Opaquify ast_channel structs and listsTerry Wilson
Review: https://reviewboard.asterisk.org/r/1773/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08Avoid cppcheck warnings; removing unused vars and a bit of cleanup.Walter Doekes
Patch by: Clod Patry Review: https://reviewboard.asterisk.org/r/1651 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20Merged revisions 337119 via svnmerge from Richard Mudgett
https://origsvn.digium.com/svn/asterisk/branches/10 ........ r337119 | rmudgett | 2011-09-20 17:47:45 -0500 (Tue, 20 Sep 2011) | 16 lines Fix crash with STRREPLACE function. The ast_func_read() function calls the .read2 callback with the len parameter set to zero indicating no size restrictions on the supplied ast_str buffer. The value was used to dimension a local starts[] array with the array subsequently used. * Reworked the strreplace() function to perform the string replacement in a straight forward manner. Eliminated the need for the starts[] array. (closes issue ASTERISK-18545) Reported by: Federico Alves Patches: jira_asterisk_18545_v10.patch (license #5621) patch uploaded by rmudgett Tested by: rmudgett, Federico Alves ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19Merged revisions 336789 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/10 ........ r336789 | tilghman | 2011-09-19 16:41:16 -0500 (Mon, 19 Sep 2011) | 2 lines Ensure substring will not be found in the previous match. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336790 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
2011-05-20Adds STRREPLACE functionJonathan Rose
Adds a new STRREPLACe function to func_strings.c that allows users to search and replace against a variable in the dialplan. (closes issue #18023) Reported by: wdoekes Review: https://reviewboard.asterisk.org/r/1219/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@320040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-28Merged revisions 293159 via svnmerge from Jeff Peeler
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r293159 | jpeeler | 2010-10-28 11:11:08 -0500 (Thu, 28 Oct 2010) | 18 lines Merged revisions 293158 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r293158 | jpeeler | 2010-10-28 11:09:40 -0500 (Thu, 28 Oct 2010) | 11 lines Fix infinite loop in FILTER(). Specifically when you're using characters above \x7f or invalid character escapes (e.g. \xgg). (closes issue #18060) Reported by: wdoekes Patches: issue18060_func_strings_filter_infinite_loop.patch uploaded by wdoekes (license 717) Tested by: wdoekes ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@293160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-24Merged revisions 288713 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r288713 | tilghman | 2010-09-24 08:54:17 -0500 (Fri, 24 Sep 2010) | 12 lines Merged revisions 288712 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r288712 | tilghman | 2010-09-24 08:53:30 -0500 (Fri, 24 Sep 2010) | 5 lines Solaris won't printf a NULL. (closes issue #18041) Reported by: asgaroth ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-03Merged revisions 280809 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r280809 | tilghman | 2010-08-03 15:25:10 -0500 (Tue, 03 Aug 2010) | 12 lines Sneak FIELDNUM() into 1.8. Returns a 1-based index into a list of a specified item. Matches up with FIELDQTY() and CUT(). (closes issue #17713) Reported by: gareth Patches: svn-279754.diff uploaded by gareth (license 208) Tested by: gareth, tilghman Review: https://reviewboard.asterisk.org/r/810/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@280810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09Kill some startup warnings and errors and make some messages more helpful in ↵Tilghman Lesher
tracking down the source. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-20Fix memory corruption found by unit tests.Russell Bryant
ast_str_reset() was being called on a potentially uninitialized pointer. Valgrind is my hero, once again. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10Hmmm, apparently needed to be fixed in trunk, too.Tilghman Lesher
(closes issue #16900) Reported by: bluecrow76 Patches: asterisk-1.6.2.4-func_strings.diff uploaded by bluecrow76 (license 270) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10It's amazing what writing a test will find.Tilghman Lesher
(issue #16900) Reported by: bluecrow76 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-24Remove unnecessary warning message, make a couple of formatting tweaksRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10Fussy compiler on another machine...Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10Fix weird issue with unit tests on optimized build - turned out to be a ↵Tilghman Lesher
signing issue. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10Enable warnings on atypical conditions for the FILTER function (suggested by ↵Tilghman Lesher
mmichelson on the -dev list). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10Merged revisions 245944 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r245944 | tilghman | 2010-02-10 07:37:13 -0600 (Wed, 10 Feb 2010) | 2 lines Include examples of FILTER usage in extension patterns where a "." may be a risk. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18Make HASHes inheritable across channel creation.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-24Add REPLACE & PASSTHRU functions, overhaul of func_strings, fix API docs for ↵Tilghman Lesher
the ast_get_encoded_* functions. * Add REPLACE function, which searches a given variable for a set of characters and replaces each with a given character. * Add PASSTHRU function, which passes a literal string back, like a NoOp for functions. Intent is to be able to specify a literal string to another function that takes a variable name as an argument. * Let the array manipulation functions work with dialplan functions, in addition to variables. This allows the array manipulation functions to modify ASTDB and ODBC backends, assuming the func_odbc configuration has both read and write functions. (closes issue #15223) Reported by: ajohnson Patches: 20091112__issue15223.diff.txt uploaded by tilghman (license 14) Tested by: lmadsen, tilghman git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30Merged revisions 221153,221157,221303 via svnmerge from Matthias Nick
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r221153 | mnick | 2009-09-30 10:37:39 -0500 (Wed, 30 Sep 2009) | 2 lines check bounds - prevents for buffer overflow ........ r221157 | mnick | 2009-09-30 10:41:46 -0500 (Wed, 30 Sep 2009) | 8 lines added a new dialplan function 'CSV_QUOTE' and changed the cdr_custom.sample.conf (closes issue #15471) Reported by: dkerr Patches: csv_quote_14.txt uploaded by mnick (license ) Tested by: mnick ........ r221303 | mnick | 2009-09-30 14:02:00 -0500 (Wed, 30 Sep 2009) | 2 lines changed the prototype definition of csv_quote ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21Merged revisions 207945 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r207945 | tilghman | 2009-07-21 17:38:54 -0500 (Tue, 21 Jul 2009) | 8 lines Force an error if a blank is passed to QUOTE (because the documentation states the argument is not optional). This change makes URIENCODE and QUOTE behave similarly, since the documentation states that the argument is not optional, for both. (closes issue #15439) Reported by: pkempgen Patches: 20090706__issue15439.diff.txt uploaded by tilghman (license 14) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-31Fix documentation for FIELDQTY.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198470 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-04-29Merge str_substitution branch.Tilghman Lesher
This branch adds additional methods to dialplan functions, whereby the result buffers are now dynamic buffers, which can be expanded to the size of any result. No longer are variable substitutions limited to 4095 bytes of data. In addition, the common case of needing buffers much smaller than that will enable substitution to only take up the amount of memory actually needed. The existing variable substitution routines are still available, but users of those API calls should transition to using the dynamic-buffer APIs. Reviewboard: http://reviewboard.digium.com/r/174/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-23Fix example that could fail in certain circumstancesTerry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190154 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-22Add funcs for manipulating delimited lists in the dialplanTerry Wilson
Adds PUSH and POP for appending to and retrieving/removing from the end of a list and UNSHIFT and SHIFT for insert to and retrieiving/ removing from the beginning of a list. Review: http://reviewboard.digium.com/r/230 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-31Don't increment the loop, now that incrementing is taken care of by theTilghman Lesher
decoder function. (closes issue #14363) Reported by: andrew53 Patches: func_strings_filter.patch uploaded by andrew53 (license 519) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13Merge ast_str_opaque branch (discontinue usage of ast_str internals)Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-11Merged revisions 163253 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r163253 | russell | 2008-12-11 15:46:29 -0600 (Thu, 11 Dec 2008) | 8 lines Fix some observed slowdowns in dialplan processing. The change is to remove autoservice usage from dialplan functions that do not need it because they do not perform operations that potentially block. (closes issue #13940) Reported by: tbelder ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163254 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-29we can now build with -Wformat=2, which found a couple of real bugsKevin P. Fleming
because SPRINTF() use non-literal format strings (which cannot be checked), move it into its own module so the rest of func_strings can benefit from format string checking git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-05Add LISTFILTER dialplan function, along with supporting documentation. SeeTilghman Lesher
documentation for more information on how to use it. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02Fix various spelling and grammatical issues in documentationRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153468 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-10-26Merged revisions 152059 via svnmerge from Sean Bright
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r152059 | seanbright | 2008-10-26 16:23:36 -0400 (Sun, 26 Oct 2008) | 7 lines Since passing \0 as the second argument to strchr is valid (and will match the trailing \0 of a string) we need to check that first, otherwise we end up with incorrect results. Fix suggested by reporter. (closes issue #13787) Reported by: meitinger ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-01Add schedule extensions to app_meetme. In addition, the reporter found aTilghman Lesher
problem within strptime(3), which we are correcting here with ast_strptime(). (closes issue #11040) Reported by: DEA Patches: 20080910__bug11040.diff.txt uploaded by Corydon76 (license 14) Tested by: DEA git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@145649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-15Merged revisions 138023 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r138023 | tilghman | 2008-08-15 09:51:12 -0500 (Fri, 15 Aug 2008) | 8 lines Additional check for more string specifiers than arguments. (closes issue #13299) Reported by: adomjan Patches: 20080813__bug13299.diff.txt uploaded by Corydon76 (license 14) func_strings.c-sprintf.patch uploaded by adomjan (license 487) Tested by: adomjan ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@138024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-07Continue merging in changes from resolve-shadow-warnings. funcs/ this time.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@136302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-07Merged revisions 113117 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r113117 | tilghman | 2008-04-07 12:51:49 -0500 (Mon, 07 Apr 2008) | 3 lines Force ast_mktime() to check for DST, since strptime(3) does not. (Closes issue #12374) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@113172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07Merged revisions 106552 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r106552 | tilghman | 2008-03-07 00:36:33 -0600 (Fri, 07 Mar 2008) | 6 lines Safely use the strncat() function. (closes issue #11958) Reported by: norman Patches: 20080209__bug11958.diff.txt uploaded by Corydon76 (license 14) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-04Merged revisions 102214 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r102214 | tilghman | 2008-02-03 23:10:02 -0600 (Sun, 03 Feb 2008) | 6 lines Missing braces. (closes issue #11912) Reported by: dimas Patches: sprintf.patch uploaded by dimas (license 88) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09Added a new module, res_phoneprov, which allows auto-provisioning of phonesTerry Wilson
based on configuration templates that use Asterisk dialplan function and variable substitution. It should be possible to create phone profiles and templates that work for the majority of phones provisioned over http. It is currently only intended to provision a single user account per phone. An example profile and set of templates for Polycom phones is provided. NOTE: Polycom firmware is not included, but should be placed in AST_DATA_DIR/phoneprov/configs to match up with the included templates. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97634 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02Change instances of AST_NONSTANDARD_APP_ARGS(foo, bar, ',') to ↵Mark Michelson
AST_STANDARD_APP_ARGS(foo, bar) (closes issue #11668, reported and patched by mvanbaak) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@95994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21remove another set of redundant #include "asterisk/options.h"Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19another bunch of include removals (errno.h and asterisk/logger.h)Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16remove a bunch of duplicate includesLuigi Rizzo
Reproduce with grep -r #include . | grep -v .svn | grep -v Binary | sort | uniq -c | sort -nr git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89348 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