Commit Graph

75 Commits

Author SHA1 Message Date
Tilghman Lesher a5bee137f9 Error message fix.
(closes issue #17356)
 Reported by: kenner
 Patches: 
       app_stack.c.diff uploaded by kenner (license 1040)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@264752 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-20 21:28:53 +00:00
Tilghman Lesher ae5a398322 Mask out previous arguments on each nested invocation of Gosub.
(closes issue #16758)
 Reported by: wdoekes
 Patches: 
       20100316__issue16758.diff.txt uploaded by tilghman (license 14)
 
Review: https://reviewboard.asterisk.org/r/561/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-16 23:49:35 +00:00
Tilghman Lesher 169b74c313 AGI may be invoked from outside the dialplan
(closes issue #16510)
 Reported by: atis
 Patches: 
       20091223__issue16510.diff.txt uploaded by tilghman (license 14)
 Tested by: atis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-23 18:25:27 +00:00
Tilghman Lesher 423d4b8278 When GOSUB is invoked within an AGI, it may not exit correctly.
(closes issue #16216)
 Reported by: atis
 Patches: 
       20091110__atis_work.diff.txt uploaded by tilghman (license 14)
 Tested by: atis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-10 21:22:50 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Tilghman Lesher e05992889b Check for NULL frame, before dereferencing pointer.
(closes issue #15617)
 Reported by: rain


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211232 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-09 07:11:22 +00:00
Tilghman Lesher a737df8603 Allow Gosub to recognize quote delimiters without consuming them.
(closes issue #15557)
 Reported by: rain
 Patches: 
       20090723__issue15557.diff.txt uploaded by tilghman (license 14)
 Tested by: rain
 
Review: https://reviewboard.asterisk.org/r/316/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210908 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-06 21:29:26 +00:00
Kevin P. Fleming aaeec3b40f Last batch of 'static' qualifiers for module-level global variables.
Fix up modules in the 'apps' directory, and also correct the bad example of
enum definitions in include/asterisk/app.h, which many developers followed
(thanks for reading the documentation!). In addition, add some basic usage
examples of the 'pahole' and 'pglobal' tools to the coding guidelines.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 19:10:10 +00:00
Kevin P. Fleming 6c5987811c Redesigned 'optional API' support.
This patch provides a new implementation of the optional API support defined
in asterisk/optional_api.h; this new version provides solves compatibility
issues with the use of linker version scripts for suppressing global symbols.
In addition, there is now a functional (and tested!) implementation for Mac OS/X,
so module writers no longer need to use special tests before calling optional
API functions. All future implementations must provide these same semantics,
so that module writers can rely on them.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 16:07:23 +00:00
Eliel C. Sardanons d03fbf2ec5 Move AGI command 'gosub' static documentation to XML.
Move AGI command 'gosub' statis documentation to the new AstXML form.

(issue #15245)
Reported by: eliel
Patches:
      app_stack_static_conversion.txt uploaded by lmadsen (license 10)
      (with minor changes by me)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-06 23:28:38 +00:00
Kevin P. Fleming e6b2e9a750 Const-ify the world (or at least a good part of it)
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-21 21:13:09 +00:00
Tilghman Lesher 873a46ded5 If a variable had a blank value upon the initial setting, then it would do nothing.
Identified by Dmitry Andrianov via private email, fixed by me.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-20 23:30:05 +00:00
Kevin P. Fleming 1c988d8996 add 'const' qualifiers in various places where they should have been
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 13:59:35 +00:00
Tilghman Lesher d4df1c6a78 Fix0ring build
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-10 07:06:29 +00:00
Tilghman Lesher 51c80f5b40 Remove the usage of the KeepAlive app, as it no longer exists.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-10 05:39:33 +00:00
Tilghman Lesher e179e613f7 1. Make OS X compile cleanly with app_stack.
2. Use curl to download sound files, as curl is installed natively on OS X,
whereas wget and fetch are not.
(closes issue #14332)
 Reported by: oej
 Tested by: Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-03 00:29:49 +00:00
Mark Michelson 07311720f2 If the autoloop flag is set on a channel, then we need to
add 1 to the priority when checking if the extension exists. Otherwise,
gosubs will fail.

This was discovered when investigating an asterisk-users mailing list post
made by Gary Hawkins.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 23:24:38 +00:00
Mark Michelson a53877b469 Add some safety measures when using gosub, especially when using the options
for app_dial and app_queue to run a gosub when the call is answered.

* Check for the existence of the gosub target in gosub_exec. If it is nonexistent,
  then this will cause errors when we attempt to actually run the gosub, including
  a definite memory leak and potential crashes. Return an error in this situation
* Check the return value of pbx_exec in app_dial and app_queue before attempting
  to actually run the gosub routine. If there was an error, we should not attempt
  to run the gosub.
* Change a '|' to a ',' in app_queue.
* Add some extra curly braces where they had been missing previously.

(closes issue #13548)
Reported by: fiddur



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 18:37:46 +00:00
Eliel C. Sardanons bfe0c6c714 - Avoid setting .synopsis and .syntax if we are using XML documentation (or the
xml documentation wont be loaded).
- Use <variable></variable> to refer to a dialplan variable.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-03 11:01:23 +00:00
Tilghman Lesher 29502d3bac Add LOCAL_PEEK function, as requested by lmadsen.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@160344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-02 18:39:12 +00:00
Kevin P. Fleming e14dfcbedc improve handling of API calls provided by loaded modules through use of some GCC features; this makes app_stack's usage of AGI APIs even cleaner, and will allow it to work 'as expected' either with or without res_agi being loaded
reviewed at http://reviewboard.digium.com/r/62



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@159631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-26 21:20:50 +00:00
Kevin P. Fleming 81a16aa982 make some corrections to the ast_agi_register_multiple(), ast_agi_unregister_multiple() and ast_agi_fdprintf() API calls to be consistent with API guidelines
also, move UPGRADE.txt to UPGRADE-1.6.txt and make the new UPGRADE.txt contain information about upgrading between Asterisk 1.6 releases



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@157706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-19 12:42:19 +00:00
Eliel C. Sardanons f18699be24 - Add more <see-also> based on TFOT.
- Add the 'filename' type to the see-also ref. To be able to reference a filename.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-05 13:07:29 +00:00
Eliel C. Sardanons 3873227e9d Add LOCAL() function XML documentation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-03 17:11:22 +00:00
Kevin P. Fleming a67790c6f5 instead of trying to forcibly load res_agi when app_stack is loaded (even if the administrator didn't want it loaded), use GCC weak symbols to determine whether it was loaded already or not; if it was loaded, then use it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 23:34:39 +00:00
Kevin P. Fleming bd4eb070f3 bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 branch, and add the ones needed for all the new code here too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 18:52:13 +00:00
Russell Bryant 5b168ee34b Merge changes from team/group/appdocsxml
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-11-01 21:10:07 +00:00
Tilghman Lesher 45b7b39c22 Set ARGC in subroutines with the number of arguments passed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-27 16:44:55 +00:00
Tilghman Lesher 4ee45f5309 Oops, only delete the ARG variables once upon release. The following section
would have removed them again (removing variables from 2 stack frames, instead
of just one).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-27 16:24:11 +00:00
Kevin P. Fleming 8e33548633 building this module depends on res_agi being built as well
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@149384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-15 08:55:47 +00:00
Kevin P. Fleming 7df8b8b848 make datastore creation and destruction a generic API since it is not really channel related, and add the ability to add/find/remove datastores to manager sessions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-05 16:56:11 +00:00
Steve Murphy f4c85ebd22 (closes issue #12689)
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: https://origsvn.digium.com/svn/asterisk/trunk@123165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-16 20:43:46 +00:00
Tilghman Lesher 90d75af346 Conditionally load the AGI command gosub, depending on whether or not res_agi
has been loaded, fix a return value in the loader, and ensure that the help
workhorse header does not print on load.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120602 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 15:58:11 +00:00
Tilghman Lesher 428f08bd64 Suppress warning about pbx structure already existing
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30 16:40:13 +00:00
Tilghman Lesher c7191467d2 Add native AGI command GOSUB, as invoking Gosub with EXEC does not work
properly.
(closes issue #12760)
 Reported by: Corydon76
 Patches: 
       20080530__bug12760.diff.txt uploaded by Corydon76 (license 14)
 Tested by: tim_ringenbach, Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@119296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-30 16:10:46 +00:00
Tilghman Lesher 527c601d0c Lock around variables retrieved, and copy the values, if they stay persistent,
since another thread could remove them.
(closes issue #12541)
 Reported by: snuffy
 Patches: 
       bug_12156_apps.diff uploaded by snuffy (license 35)
       Several additional changes by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-30 19:21:04 +00:00
Tilghman Lesher 857e3412f4 Several manager changes:
1) Add the Dialplan class, for NewExten and VarSet events, which should cut
down on the volume of traffic in the Call class.
2) Permit some commands to be run from multiple classes, such as allowing
DBGet to be run from either the System or the Reporting class.
3) Heavily document each class in the sample config, as there were several
that made no sense to be in the write= line, and two that made no sense to be
in the read= line (since they controlled no permissions there).

(Closes issue #10386)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 00:12:35 +00:00
Luigi Rizzo 51391e6b09 shuffle a little bit the content of header files to reduce dependencies.
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: https://origsvn.digium.com/svn/asterisk/trunk@89522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-22 03:50:04 +00:00
Luigi Rizzo ea2c54859d more removal of redundant headers
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-22 02:07:33 +00:00
Luigi Rizzo 7e8835e0d7 remove another set of redundant #include "asterisk/options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:24:55 +00:00
Luigi Rizzo 0595b5e2aa include "logger.h" and errno.h from asterisk.h - usage shows that they
were included almost everywhere.
Remove some of the instances.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 18:52:04 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
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
2007-11-16 20:04:58 +00:00
Mark Michelson 5a4867543d "show application <foo>" changes for clarity.
(closes issue #11171, reported and patched by blitzrage)

Many thanks!



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 19:04:45 +00:00
Tilghman Lesher 20bbd09de3 Mostly cleanup of documentation to substitute the pipe with the comma, but a few other formatting cleanups, too.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 01:10:47 +00:00
Joshua Colp b8cd949cce Applications no longer need to call ast_module_user_add and ast_module_user_remove. This is now taken care of in the pbx_exec function outside of the application.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 14:39:29 +00:00
Joshua Colp 96a646734f It is no longer required for each module that deals with a channel to call ast_module_user_hangup_all in it's unload function. The loader will automatically perform this action for it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 13:35:20 +00:00
Tilghman Lesher d260399bc1 Oops, shouldn't have taken that last shortcut (also add some checks)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 13:00:45 +00:00
Tilghman Lesher 344f8d40a8 Another method of doing local variables, hopefully a little closer to what codefreeze had in mind
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 05:47:05 +00:00
Tilghman Lesher 2586a090a8 Local variables for codefreeze
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 04:36:23 +00:00
Russell Bryant 055d82cbce Add a massive set of changes for converting to use the ast_debug() macro.
(issue #9957, patches from mvanbaak, caio1982, critch, and dimas)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 19:39:12 +00:00