aboutsummaryrefslogtreecommitdiffstats
path: root/main/app.c
AgeCommit message (Collapse)AuthorFilesLines
2009-08-06Allow Gosub to recognize quote delimiters without consuming them.tilghman1-6/+21
(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: http://svn.digium.com/svn/asterisk/trunk@210908 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-27Only update total silence counter after a counter reset.russell1-1/+9
(closes issue #2264) Reported by: pfn Patches: silent-vm-1.6.2-fix2.txt uploaded by pfn (license 810) Tested by: pfn git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203962 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-23Ignore voicemail messages that are just silence.russell1-19/+16
(closes issue #2264) Reported by: pfn Patches: silent-vm-1.6.2.txt uploaded by pfn (license 810) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@202570 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-01Add the ability to execute connected line interception macros.mmichelson1-0/+22
When connected line updates are received or generated in the middle of an application call, it is now possible to execute a macro to manipulate the connected line data. This way, phone numbers may be manipulated to be more presentable to users, names may be changed for...whatever reason, or whatever else needs to be done may be. Review: https://reviewboard.asterisk.org/r/256 AST-165 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198727 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-21Const-ify the world (or at least a good part of it)kpfleming1-3/+3
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: http://svn.digium.com/svn/asterisk/trunk@196072 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-22Fix building of chan_h323 with gcc-3.3jpeeler1-9/+9
There seems to be a bug with old versions of g++ that doesn't allow a structure member to use the name list. Rename list member to group_list in ast_group_info and change the few places it is used. (closes issue #14790) Reported by: stuarth git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190057 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-10Modify headers and macros, according to Russell's suggestions on the -dev listtilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187599 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27Change global_app_buf to ast_str_thread_global_buf.russell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184693 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-04Spacing changes onlytilghman1-197/+276
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@180259 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-03app_read does not break from prompt loop with user terminated empty stringdvossel1-3/+7
In app.c, ast_app_getdata is called to stream the prompts and receive DTMF input. If ast_app_getdata() receives an empty string caused by the user inputing the end of string character, in this case '#', it should break from the prompt loop and return to app_read, but instead it cycles through all the prompts. I've added a return value for this special case in ast_readstring() which uses an enum I've delcared in apps.h. This enum is now used as a return value for ast_app_getdata(). (closes issue #14279) Reported by: Marquis Patches: fix_app_read.patch uploaded by Marquis (license 32) read-ampersanmd.patch2 uploaded by dvossel (license 671) Tested by: Marquis, dvossel Review: http://reviewboard.digium.com/r/177/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@180032 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-02Merged revisions 179468 via svnmerge from tilghman1-1/+9
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r179468 | tilghman | 2009-03-02 17:09:01 -0600 (Mon, 02 Mar 2009) | 10 lines When ending a recording with silence detection, remember to reduce the duration. The end of the recording is correspondingly trimmed, but the duration was not trimmed by the number of seconds trimmed, so the saved duration was necessarily longer than the actual soundfile duration. (closes issue #14406) Reported by: sasargen Patches: 20090226__bug14406.diff.txt uploaded by tilghman (license 14) Tested by: sasargen ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@179469 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-20Allow semicolons to be escaped, when passing arguments to the System command.tilghman1-0/+27
(closes issue #14231) Reported by: jcovert Patches: 20090113__bug14231__2.diff.txt uploaded by Corydon76 (license 14) corrected_20090113__bug14231__2.diff.txt uploaded by jcovert (license 551) Tested by: jcovert git-svn-id: http://svn.digium.com/svn/asterisk/trunk@177664 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17Merge a large set of updates to the Asterisk indications API.russell1-5/+8
This patch includes a number of changes to the indications API. The primary motivation for this work was to improve stability. The object management in this API was significantly flawed, and a number of trivial situations could cause crashes. The changes included are: 1) Remove the module res_indications. This included the critical functionality that actually loaded the indications configuration. I have seen many people have Asterisk problems because they accidentally did not have an indications.conf present and loaded. Now, this code is in the core, and Asterisk will fail to start without indications configuration. There was one part of res_indications, the dialplan applications, which did belong in a module, and have been moved to a new module, app_playtones. 2) Object management has been significantly changed. Tone zones are now managed using astobj2, and it is no longer possible to crash Asterisk by issuing a reload that destroys tone zones while they are in use. 3) The API documentation has been filled out. 4) The API has been updated to follow our naming conventions. 5) Various bits of code throughout the tree have been updated to account for the API update. 6) Configuration parsing has been mostly re-written. 7) "Code cleanup" The code is from svn/asterisk/team/russell/indications/. Review: http://reviewboard.digium.com/r/149/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176627 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-29Merged revisions 172438 via svnmerge from tilghman1-0/+11
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r172438 | tilghman | 2009-01-29 16:54:29 -0600 (Thu, 29 Jan 2009) | 9 lines Lose the CAP_NET_ADMIN at every fork, instead of at startup. Otherwise, if Asterisk runs as a non-root user and the administrator does a 'restart now', Asterisk loses the ability to set QOS on packets. (closes issue #14004) Reported by: nemo Patches: 20090105__bug14004.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172441 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-29- Make sure we set setvar= variables on outbound calls too, not only inbound ↵oej1-2/+2
calls. - Also, change a function in app.c to return a userful value instead of always returning 0. Patch by fnordian, changed by Corydon76 and myself. This does not close the bug report, as fnordian had an additional change we're still discussing. (related to issue #14059) Reported by: fnordian Patches: chan_sip_hfield.patch uploaded by fnordian (license 110) 20090116__bug14059.diff.txt uploaded by Corydon76 (license 14) Tested by: fnordian, Corydon76, oej git-svn-id: http://svn.digium.com/svn/asterisk/trunk@172268 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-13Merged revisions 168561 via svnmerge from russell1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r168561 | russell | 2009-01-13 13:13:05 -0600 (Tue, 13 Jan 2009) | 2 lines Revert unnecessary indications API change from rev 122314 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168562 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-12Some platforms (notably, the BSDs) have a more efficient implementation calledtilghman1-2/+11
closefrom(3). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@168522 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-13Merge ast_str_opaque branch (discontinue usage of ast_str internals)tilghman1-0/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@163991 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09Merged revisions 161948 via svnmerge from russell1-2/+7
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r161948 | russell | 2008-12-09 08:52:25 -0600 (Tue, 09 Dec 2008) | 15 lines Fix a problem with GROUP() settings on a masquerade. The previous code carried over group settings from the old channel to the new one. However, it did nothing with the group settings that were already on the new channel. This patch removes all group settings that already existed on the new channel. I have a more complicated version of this patch which addresses only the most blatant problem with this, which is that a channel can end up with multiple group settings in the same category. However, I could not think of a use case for keeping any of the group settings from the old channel, so I went this route for now. (closes AST-152) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@161951 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-05Add LISTFILTER dialplan function, along with supporting documentation. Seetilghman1-0/+13
documentation for more information on how to use it. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@154915 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-12When checking for an encoded character, make sure the string isn't blank, first.tilghman1-0/+5
(Closes issue #13470) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@142748 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-10Another big chunk of changes from the RSW branch. Bunch of stuff from main/seanbright1-8/+8
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@137082 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-30Merged revisions 134475 via svnmerge from mmichelson1-1/+5
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r134475 | mmichelson | 2008-07-30 13:31:47 -0500 (Wed, 30 Jul 2008) | 4 lines Fix a spot where a function could return without bringing a channel out of autoservice. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@134476 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-02Keep ast_app_inboxcount API compatible with 1.6.0.tilghman1-8/+37
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@127609 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-20Merged revisions 124395 via svnmerge from tilghman1-2/+6
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r124395 | tilghman | 2008-06-20 17:02:55 -0500 (Fri, 20 Jun 2008) | 3 lines If the last character in a string to be parsed is the delimiter, then we should count that final empty string as an additional argument. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@124396 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-22- revert change to ast_queue_hangup and create ast_queue_hangup_with_causemvanbaak1-1/+1
- make data member of the ast_frame struct a named union instead of a void Recently the ast_queue_hangup function got a new parameter, the hangupcause Feedback came in that this is no good and that instead a new function should be created. This I did. The hangupcause was stored in the seqno member of the ast_frame struct. This is not very elegant, and since there's already a data member that one should be used. Problem is, this member was a void *. Now it's a named union so it can hold a pointer, an uint32 and there's a padding in case someone wants to store another type in there in the future. This commit is so massive, because all ast_frame.data uses have to be altered to ast_frame.data.data Thanks russellb and kpfleming for the feedback. (closes issue #12674) Reported by: mvanbaak git-svn-id: http://svn.digium.com/svn/asterisk/trunk@117802 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-09Adding support for "urgent" voicemail messages. Messages which aremmichelson1-4/+6
marked "urgent" are considered to be higher priority than other messages and so they will be played before any other messages in a user's mailbox. There are two ways to leave an urgent message. 1. send the 'U' option to VoiceMail(). 2. Set review=yes in voicemail.conf. This will give instructions for a caller to mark a message as urgent after the message has been recorded. I have tested that this works correctly with file and ODBC storage, and James Rothenberger (who wrote initial support for this feature) has tested its use with IMAP storage. (closes issue #11817) Reported by: jaroth Based on branch http://svn.digium.com/svn/asterisk/team/jrothenberger/asterisk-urgent Tested by: putnopvut, jaroth git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115588 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-01Modify TIMEOUT() to be accurate down to the millisecond.tilghman1-6/+6
(closes issue #10540) Reported by: spendergrass Patches: 20080417__bug10540.diff.txt uploaded by Corydon76 (license 14) Tested by: blitzrage git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115076 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-28Adding a new option 'n' to app_chanspy. This option allows for the name of ↵mmichelson1-1/+12
the spied-on party to be spoken instead of the channel name or number. This was accomplished by adding a new function pointer to point to a function in app_voicemail which retrieves the name file and plays it. This makes for an easy way that applications may play a user's name should it be necessary. app_directory, in particular, can be simplified greatly by this change. This change comes as a suggestion from Switchvox, which already has this feature. AST-23 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114813 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-25Oops, this isn't necessarily AGI that is forking anymoretilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114665 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-16Standardized routines for forking processes (keeps all the specialized code ↵tilghman1-0/+63
in one place). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114188 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-25Merged revisions 110628 via svnmerge from file1-0/+9
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r110628 | file | 2008-03-25 11:37:35 -0300 (Tue, 25 Mar 2008) | 4 lines Add an option (transmit_silence) which transmits silence during both Record() and DTMF generation. The reason this is an option is that in order to transmit silence we have to setup a translation path. This may not be needed/wanted in all cases. (closes issue #10058) Reported by: tracinet ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@110629 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-05Create a centralized configuration option for silencethresholdtilghman1-1/+3
(closes issue #11236) Reported by: philipps Patches: 20080218__bug11236.diff.txt uploaded by Corydon76 (license 14) Tested by: philipps git-svn-id: http://svn.digium.com/svn/asterisk/trunk@106072 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-04Whitespace changes onlytilghman1-11/+11
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105840 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-01Asterisk, when parking can drop rights a caller when a parking timeout ↵twilson1-0/+11
occurs. Also, when doing built-in attended transfers, sometimes incorrectly passes rights from the transferrer to the transferee. This patch tries to fixes the parking issue and lays some groundwork for later fixing the transfer issue. (closes issue #11520) Reported by: pliew Tested by: otherwiseguy git-svn-id: http://svn.digium.com/svn/asterisk/trunk@105477 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-18Merged revisions 103786 via svnmerge from mmichelson1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r103786 | mmichelson | 2008-02-18 14:52:09 -0600 (Mon, 18 Feb 2008) | 10 lines There was an invalid assumption when calculating the duration of a file that the filestream in question was created properly. Unfortunately this led to a segfault in the situation where an unknown format was specified in voicemail.conf and a voicemail was recorded. Now, we first check to be sure that the stream was written correctly or else assume a zero duration. (closes issue #12021) Reported by: jakep Tested by: putnopvut ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103787 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-11Just some minor coding style cleanup...file1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103318 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27Merged revisions 89709 via svnmerge from kpfleming1-5/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89709 | kpfleming | 2007-11-27 14:16:56 -0600 (Tue, 27 Nov 2007) | 2 lines on second thought... revert all the other changes i've made in app options parsing leaving only one: if an empty argument is supplied for an option, set that argument pointer to point to an empty string rather than NULL, so that the application can do normal checks on it without worrying about it being NULL ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89721 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27Merged revisions 89701 via svnmerge from kpfleming1-2/+5
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89701 | kpfleming | 2007-11-27 13:36:55 -0600 (Tue, 27 Nov 2007) | 2 lines generate a warning when an application option that requires an argument is ignored due to lack of an argument ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89704 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-26Merged revisions 89586 via svnmerge from kpfleming1-1/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89586 | kpfleming | 2007-11-26 11:20:36 -0600 (Mon, 26 Nov 2007) | 2 lines when parsing application options that take arguments, don't indicate that the option was supplied unless a non-zero-length argument was found for it ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89588 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-24Added <sys/file.h> include to allow trunk to compile. Hope this doesn't ↵murf1-0/+1
louse thing up. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89544 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-24remove some unnecessary includesrizzo1-4/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89542 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-24Merged revisions 89540 via svnmerge from tilghman1-3/+11
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89540 | tilghman | 2007-11-24 00:19:23 -0600 (Sat, 24 Nov 2007) | 9 lines Currently, zero-length voicemail messages cause a hangup in VoicemailMain. This change fixes the problem, with a multi-faceted approach. First, we do our best to avoid these messages from being created in the first place, and second, if that fails, we detect when the voicemail message is zero-length and avoid exiting at that point. Reported by: dtyoo Patch by: gkloepfer,tilghman (Closes issue #11083) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89541 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-22remove a number of #include <fcntl.h> which are eitherrizzo1-1/+0
useless or done elsewhere git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89516 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21remove a bunch of useless #include "options.h"rizzo1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89511 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-20move asterisk/paths.h outside asterisk.h and into those filesrizzo1-0/+1
who really need it. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89466 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-19another bunch of include removals (errno.h and asterisk/logger.h)rizzo1-2/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89425 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16Start untangling header inclusion in a way that does not affectrizzo1-5/+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-15Merged revisions 89275 via svnmerge from tilghman1-3/+10
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89275 | tilghman | 2007-11-14 17:23:58 -0600 (Wed, 14 Nov 2007) | 5 lines When a recording ends with '#', we are improperly trimming an extra 200ms from the recording. Reported by: sim Patch by: tilghman Closes issue #11247 ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89276 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-08improve linked-list macros in two ways:kpfleming1-5/+5
- 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