summaryrefslogtreecommitdiff
path: root/main/pbx.c
AgeCommit message (Collapse)Author
2010-05-20Let ExtensionState resolve dynamic hints.Tilghman Lesher
(closes issue #16623) Reported by: tilghman Patches: 20100116__issue16623.diff.txt uploaded by tilghman (license 14) Tested by: lmadsen git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-24Fix potential invalid reads that could occur in pbx.cMark Michelson
Here is a cut and paste of my review request for this change: This past weekend, Russell ran our current suite of unit tests for Asterisk under valgrind. The PBX pattern match test caused valgrind to spew forth two invalid read errors. This patch contains two changes that shut valgrind up and do not cause any new memory leaks. Change 1: In ast_context_remove_extension_callerid2, valgrind reported an invalid read in the for loop close to the function's end. Specifically, one of the the strcmp calls in the loop control was reading invalid memory. This was because the caller of ast_context_remove_extension_callerid2 (__ast_context destroy in this case) passed as a parameter a shallow copy of an ast_exten's exten field. This same ast_exten was what was destroyed inside the for loop, thus any iterations of the for loop beyond the destruction of the ast_exten would result in invalid reads. My fix for this is to make a copy of the ast_exten's exten field and pass the copy to ast_context_remove_extension_callerid2. In addition, I have also acted similarly with the ast_exten's matchcid field. Since in this case a NULL is handled quite differently than an empty string, I needed to be a bit more careful with its handling. Change 2: In __ast_context_destroy, we iterated over a hashtab and called ast_context_remove_extension_callerid2 on each item. Specifically, the hashtab over which we were iterating was an ast_exten's peer_table. Inside of ast_context_remove_extension_callerid2, we could possibly destroy this ast_exten, which also caused the hashtab to be freed. Attempting to call ast_hashtab_end_traversal on the hashtab iterator caused an invalid read to occur when trying to read the iterator->tab->do_locking field since iterator->tab had already been freed. My handling of this problem is a bit less straightforward. With each iteration over the hashtab's contents, we set a variable called "end_traversal" based on the return of ast_context_remove_extension_callerid2. If 0 is ever returned, then we know that the extension was found and destroyed. Because of this, we cannot call ast_hashtab_end_traversal because we will be guaranteeing a read of invalid memory. In such a case, we forego calling ast_hashtab_end_traversal and instead call ast_free on the hashtab iterator. Review: https://reviewboard.asterisk.org/r/585 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-08Use memmove() instead of memcpy() for a case where the buffers overlap.Russell Bryant
Once again, valgrind is freaking awesome. That is all. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27Merged revisions 243486 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r243486 | mmichelson | 2010-01-27 12:06:43 -0600 (Wed, 27 Jan 2010) | 3 lines Use a safe list traversal while checking for duplicate vars in pbx_builtin_setvar_helper. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-25Change api for pbx_builtin_setvar to actually return error code if a ↵Olle Johansson
function can't be written to. This patch removes code that was duplicated from pbx.c to manager.c in order to prevent API change in released versions of Asterisk. There are propably also other places that would benefit from reading the return code and react if a function returns error codes on writing a value into it. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-20Update CDR variables as pbx startsAlec L Davis
Allows CDR variables added in cdr.c:set_one_cid to become visable during the call, by executing ast_cdr_update() early in __ast_pbx run. Reverts sig_pri changes in trunk that are specific to isdn technology only. (closes issue #16638) Reported by: alecdavis Patches: cdr_update.diff3.txt uploaded by alecdavis (license 585) Tested by: alecdavis git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-19Initialize data on the stack so that Park doesn't interpret random arguments.Jeff Peeler
passdata was only being set in pbx_substitue_variables when arguments were passed. (closes issue #16406) (closes issue #16586) Reported by: DLNoah Patches: bug16586v2.patch uploaded by jpeeler (license 325) Tested by: DLNoah git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241366 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-17Avoid a crash on Solaris when running 'core show functions.'Sean Bright
(closes issue #16309) Reported by: asgaroth git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15Convert a few places to use ast_calloc_with_stringfields where applicable.Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-14Similarly, ensure that matchcid is duplicated correctly when merging contexts.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-14Ensure that the callerid is NULL when the parent is effectively NULL.Tilghman Lesher
This applies only to pattern-match hints, which create exact-match hints on the fly. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13Oops, another tag errorTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13Oops, missed a closing tagTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13Add the TESTTIME() dialplan function, which permits testing GotoIfTime.Tilghman Lesher
Specifically, by setting TESTTIME() to a particular date and time, you can test whether a dialplan correctly branches as was intended. This was developed after recent questions on the -users list on how to test their holiday dialplan logic. (closes issue #16464) Reported by: tilghman Patches: 20100112__issue16464.diff.txt uploaded by tilghman (license 14) Review: https://reviewboard.asterisk.org/r/458/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-12Blank callerid and NULL callerid should not compare equal.Tilghman Lesher
The second is the default state for matching CID in the dialplan (no matching) while the first matches one particular CallerID. This is a regression. (fixes AST-314, SWP-611) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05fixes subscriptions being lost after 'module reload'David Vossel
During a module reload if multiple extension configs are present, such as both extensions.conf and extensions.ael, watchers for one config's hints will be lost during the merging of the other config. This happens because hint watchers are only preserved for the current config being merged. The old context list is destroyed after the merging takes place, meaning any watchers that were not perserved will be removed. Now all hints are preserved during merging regardless of what config file is being merged. These hints are only restored if they are present within the new context list. (closes issue #16093) Reported by: jlaroff git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-04Merged revisions 237493 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r237493 | tilghman | 2010-01-04 14:57:35 -0600 (Mon, 04 Jan 2010) | 8 lines Regression in issue #15421 - Pattern matching (closes issue #16482) Reported by: wdoekes Patches: astsvn-16482-betterfix.diff uploaded by wdoekes (license 717) 20091223__issue16482.diff.txt uploaded by tilghman (license 14) Tested by: wdoekes, tilghman ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-04Merged revisions 237405 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r237405 | tilghman | 2010-01-04 12:19:00 -0600 (Mon, 04 Jan 2010) | 16 lines Add a flag to disable the Background behavior, for AGI users. This is in a section of code that relates to two other issues, namely issue #14011 and issue #14940), one of which was the behavior of Background when called with a context argument that matched the current context. This fix broke FreePBX, however, in a post-Dial situation. Needless to say, this is an extremely difficult collision of several different issues. While the use of an exception flag is ugly, fixing all of the issues linked is rather difficult (although if someone would like to propose a better solution, we're happy to entertain that suggestion). (closes issue #16434) Reported by: rickead2000 Patches: 20091217__issue16434.diff.txt uploaded by tilghman (license 14) 20091222__issue16434__1.6.1.diff.txt uploaded by tilghman (license 14) Tested by: rickead2000 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-17Merged revisions 235421 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r235421 | tilghman | 2009-12-17 11:17:51 -0600 (Thu, 17 Dec 2009) | 8 lines Use context from which Macro is executed, not macro context, if applicable. Also, ensure that the extension COULD match, not just that it won't match more. (closes issue #16113) Reported by: OrNix Patches: 20091216__issue16113.diff.txt uploaded by tilghman (license 14) Tested by: OrNix ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-13Trim leading/trailing spaces from the filename, to deal with common user error.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@234458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01Merged revisions 231853 via svnmerge from David Vossel
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r231853 | dvossel | 2009-12-01 15:14:31 -0600 (Tue, 01 Dec 2009) | 3 lines WaitExten m option with no parameters generates frame with zero datalen but non-null data ptr ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-11Merged revisions 229498 via svnmerge from David Brooks
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r229498 | dbrooks | 2009-11-11 13:46:19 -0600 (Wed, 11 Nov 2009) | 8 lines Solaris doesn't like NULL going to ast_log Solaris will crash if NULL is passed to ast_log. This simple patch simply uses S_OR to get around this. (closes issue #15392) Reported by: yrashk ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-10Merged revisions 229360 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r229360 | tilghman | 2009-11-10 16:09:16 -0600 (Tue, 10 Nov 2009) | 12 lines If two pattern classes start with the same digit and have the same number of characters, they will compare equal. The example given in the issue report is that of [234] and [246], which have these characteristics, yet they are clearly not equivalent. The code still uses these two characteristics, yet when the two scores compare equal, an additional check will be done to compare all characters within the class to verify equality. (closes issue #15421) Reported by: jsmith Patches: 20091109__issue15421__2.diff.txt uploaded by tilghman (license 14) Tested by: jsmith, thedavidfactor ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04Expand codec bitfield from 32 bits to 64 bits.Tilghman Lesher
Reviewboard: https://reviewboard.asterisk.org/r/416/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22Merged revisions 225105 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r225105 | tilghman | 2009-10-21 11:02:12 -0500 (Wed, 21 Oct 2009) | 4 lines Fix documentation for ast_softhangup() and correct the misuse thereof. (closes issue #16103) Reported by: majorbloodnok ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-15Create an API for adding an optional time unit onto the ends of time periods.Tilghman Lesher
Two examples of its use are included, and the usage could be expanded in some cases into certain configuration options where time periods are specified. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224225 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-07Deadlock in channel masquerade handlingDavid Vossel
Channels are stored in an ao2_container. When accessing an item within an ao2_container the proper locking order is to first lock the container, and then the items within it. In ast_do_masquerade both the clone and original channel must be locked for the entire duration of the function. The problem with this is that it attemptes to unlink and link these channels back into the ao2_container when one of the channel's name changes. This is invalid locking order as the process of unlinking and linking will lock the ao2_container while the channels are locked!!! Now, both the channels in do_masquerade are unlinked from the ao2_container and then locked for the entire function. At the end of the function both channels are unlocked and linked back into the container with their new names as hash values. This new method of requiring all channels and tech pvts to be unlocked before ast_do_masquerade() or ast_change_name() required several changes throughout the code base. (closes issue #15911) Reported by: russell Patches: masq_deadlock_trunk.diff uploaded by dvossel (license 671) Tested by: dvossel, atis (closes issue #15618) Reported by: lmsteffan Patches: deadlock_local_attended_transfers_trunk.diff uploaded by dvossel (license 671) Tested by: lmsteffan, dvossel Review: https://reviewboard.asterisk.org/r/387/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-24Merged revisions 220288 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r220288 | tilghman | 2009-09-24 14:39:41 -0500 (Thu, 24 Sep 2009) | 6 lines Implicitly sending a progress signal breaks some applications. Call Progress() in your dialplan if you explicitly want progress to be sent. (Reverts change 216430, closes issue #15957) Reported by: Pavel Troller on the Asterisk-Dev mailing list http://lists.digium.com/pipermail/asterisk-dev/2009-September/039897.html ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-16Merged revisions 218867 via svnmerge from David Brooks
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r218867 | dbrooks | 2009-09-16 13:00:45 -0500 (Wed, 16 Sep 2009) | 13 lines Fixes CID pattern matching behavior to mirror that of extension pattern matching. Pattern matching for extensions uses a type of scoring system, giving values for specificity to each character in the pattern. Unfortunately, this is done character by character, in order. This does lead to some less specific patterns being first in line for matching, but it will usually get the job done. This patch merely brings CID matching to the same level as extension matching. This patch does not attempt to tackle the problem shared by extension matching. (closes issue #14708) Reported by: klaus3000 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-11Check the origination priority for more matches, not the current priority.Tilghman Lesher
Found by Pavel Troller on the -dev list. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-04Enable turning off the application delimiter warning with the 'dontwarn' option.Tilghman Lesher
Suggested on the -dev list, and implemented in an alternate way by me. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-04Merged revisions 216430 via svnmerge from Olle Johansson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r216430 | oej | 2009-09-04 15:45:48 +0200 (Fre, 04 Sep 2009) | 27 lines Make apps send PROGRESS control frame for early media and fix too early media issue in SIP The issue at hand is that some legacy (dying) PBX systems send empty media frames on PRI links *before* any call progress. The SIP channel receives these frames and by default signals 183 Session progress and starts sending media. This will cause phones to play silence and ignore the later 180 ringing message. A bad user experience. The fix is twofold: - We discovered that asterisk apps that support early media ("noanswer") did not send any PROGRESS frame to indicate early media. Fixed. - We introduce a setting in chan_sip so that users can disable any relay of media frames before the outbound channel actually indicates any sort of call progress. In 1.4, 1.6.0 and 1.6.1, this will be disabled for backward compatibility. In later versions of Asterisk, this will be enabled. We don't assume that it will change your Asterisk phone experience - only for the better. We encourage third-party application developers to make sure that if they have applications that wants to send early media, add a PROGRESS control frame transmission to make sure that all channel drivers actually will start sending early media. This has not been the default in Asterisk previous to this patch, so if you got inspiration from our code, you need to update accordingly. Sorry for the trouble and thanks for your support. This code has been running for a few months in a large scale installation (over 250 servers with PRI and/or BRI links to old PBX systems). That's no proof that this is an excellent patch, but, well, it's tested :-) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-25Merged revisions 213970 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r213970 | tilghman | 2009-08-25 01:34:44 -0500 (Tue, 25 Aug 2009) | 7 lines Improve error message by informing user exactly which function is missing a parethesis. (closes issue #15242) Reported by: Nick_Lewis Patches: pbx.c-funcparenthesis.patch2 uploaded by dbrooks (license 790) pbx.c-funcparenthesis-1.4.diff uploaded by loloski (license 68) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@213971 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10AST-2009-005Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08Fix a CEL related regression with hints updating by subscribing to ↵Matthew Nicholson
AST_DEVICE_STATE instead of AST_DEVICE_STATE_CHANGED. (closes issue #15440) Reported by: lmsteffan git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08Merged revisions 205409 via svnmerge from David Vossel
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r205409 | dvossel | 2009-07-08 16:35:12 -0500 (Wed, 08 Jul 2009) | 6 lines moving ast_devstate_to_extenstate to pbx.c from devicestate.c ast_devstate_to_extenstate belongs in pbx.c. This change fixes a compile time error with chan_vpb as well. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-02Merged revisions 204681 via svnmerge from David Vossel
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r204681 | dvossel | 2009-07-02 10:05:57 -0500 (Thu, 02 Jul 2009) | 14 lines Improved mapping of extension states from combined device states. This fixes a few issues with incorrect extension states and adds a cli command, core show device2extenstate, to display all possible state mappings. (closes issue #15413) Reported by: legart Patches: exten_helper.diff uploaded by dvossel (license 671) Tested by: dvossel, legart, amilcar Review: https://reviewboard.asterisk.org/r/301/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204710 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26Make invalid hints report Unavailable instead of Idle.Russell Bryant
(closes issue #14413) Reported by: pj git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26Merge the new Channel Event Logging (CEL) subsystem.Russell Bryant
CEL is the new system for logging channel events. This was inspired after facing many problems trying to represent what is possible to happen to a call in Asterisk using CDR records. For more information on CEL, see the built in HTML or PDF documentation generated from the files in doc/tex/. Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard work developing this code. Also, thanks to Matt Nicholson (mnicholson) and Sean Bright (seanbright) for their assistance in the final push to get this code ready for Asterisk trunk. Review: https://reviewboard.asterisk.org/r/239/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-10Fixes the argument order in definition of new_find_extension().David Brooks
In the definition of new_find_extension(), the arguments 'callerid' and 'label' were swapped. The prototype declaration and all calls to the function are ordered 'callerid' then 'label', but the function itself was ordered 'label' then 'callerid'. (closes issue #15303) Reported by: JimDickenson git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26Add new ast_complete_applications function so that we can use it with theSean Bright
'channel originate ... application <app>' CLI command. (And yeah, I cleaned up some whitespace in res_clioriginate.c... big whoop, wanna fight about it!?) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22Implement a new element in AstXML for AMI actions documentation.Eliel C. Sardanons
A new xml element was created to manage the AMI actions documentation, using AstXML. To register a manager action using XML documentation it is now possible using ast_manager_register_xml(). The CLI command 'manager show command' can be used to show the parsed documentation. Example manager xml documentation: <manager name="ami action name" language="en_US"> <synopsis> AMI action synopsis. </synopsis> <syntax> <xi:include xpointer="xpointer(...)" /> <-- for ActionID <parameter name="header1" required="true"> <para>Description</para> </parameter> ... </syntax> <description> <para>AMI action description</para> </description> <see-also> ... </see-also> </manager> git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22Fix build under dev mode and remove some casts that are no longer necessary asSean Bright
a result of the const-ify the world patch. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22Avoid using prototypes when not necessary (it is already defined in the headerEliel C. Sardanons
file). Make log_match_char_tree() static to main/pbx.c (only used there). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196114 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-05-18Warn about the use of the application WaitExten() within a Macro().Eliel C. Sardanons
Update applications documentation to warn the user about the use of the WaitExten() application within a Macro(). Recommend the use of Read() instead. (closes issue #14444) Reported by: ewieling git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-16Fix a missing unlock in case of error, and a missing free().Eliel C. Sardanons
Always free the allocated memory for a string field, because we are always using it (not only when xmldocs are enabled). Also if there is an error allocating memory for the string field remember to unlock the list of registered applications, before returning. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-14If the timing ended on a zero, then we would loop forever.Tilghman Lesher
(closes issue #14983) Reported by: teox Patches: 20090513__issue14983.diff.txt uploaded by tilghman (license 14) Tested by: teox git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-13Merged revisions 194137 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r194137 | tilghman | 2009-05-12 19:52:03 -0500 (Tue, 12 May 2009) | 7 lines Fix logic for how to proceed with a single digit extension. (closes issue #15091) Reported by: andrew Patches: 20090512__issue15091.diff.txt uploaded by tilghman (license 14) Tested by: andrew ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-13Two fixes found while debugging with ast_backtrace():Tilghman Lesher
1) If MALLOC_DEBUG is used when concurrently using ast_backtrace, the free() used in that routine will trigger an error, because the memory was allocated internally to libc, where we could not intercept that call to wrap it. Therefore, it's not memory we knew about, and the free is reported as an error. 2) Now that channels are objects, the old hack of initializing a channel to all zeroes no longer works, since we may try to call something like ast_channel_lock() within a function on that reference. In that case, it's reported as an error, because the pointer isn't an object reference. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194101 65c4cc65-6c06-0410-ace0-fbb531ad65f3