aboutsummaryrefslogtreecommitdiffstats
path: root/main/file.c
AgeCommit message (Collapse)AuthorFilesLines
2010-05-13Fix internal timing not working with Zapteljpeeler1-0/+1
dahdi_compat.h was not being included in channel.c when used with Zaptel and wasn't in file.c at all. (closes issue #15250) Reported by: mneuhauser Patches: dahdi_compat.patch uploaded by mneuhauser (license 425) Tested by: IgorG git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@263112 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-25Handle new SRCCHANGE control message here tootwilson1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@254451 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-08Properly calculate the remaining space in the output string when reducing ↵mnicholson1-4/+7
format strings. (closes issue #16560) Reported by: goldwein git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@238629 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01Fix a warning pointed out by buildbot.russell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@232007 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01Ignore unknown formats in ast_format_str_reduce() and return an error if no ↵mnicholson1-2/+15
know formats are found. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@231740 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30Remove duplicate entries from voicemail format lists. This prevents ↵mnicholson1-0/+60
app_voicemail from entering an infinite loop when the same format is specified twice in the format list. (closes issue #15625) Reported by: Shagg63 Tested by: mnicholson Review: https://reviewboard.asterisk.org/r/429/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@231614 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-08Make filestream frame handling safer by isolating frames before returning them.russell1-46/+38
This patch is related to a number of issues on the bug tracker that show crashes related to freeing frames that came from a filestream. A number of fixes have been made over time while trying to figure out these problems, but there re still people seeing the crash. (Note that some of these bug reports include information about other problems. I am specifically addressing the filestream frame crash here.) I'm still not clear on what the exact problem is. However, what is _very_ clear is that we have seen quite a few problems over time related to unexpected behavior when we try to use embedded frames as an optimization. In some cases, this optimization doesn't really provide much due to improvements made in other areas. In this case, the patch modifies filestream handling such that the embedded frame will not be returned. ast_frisolate() is used to ensure that we end up with a completely mallocd frame. In reality, though, we will not actually have to malloc every time. For filestreams, the frame will almost always be allocated and freed in the same thread. That means that the thread local frame cache will be used. So, going this route doesn't hurt. With this patch in place, some people have reported success in not seeing the crash anymore. (SWP-150) (AST-208) (ABE-1834) (issue #15609) Reported by: aragon Patches: filestream_frisolate-1.4.diff2.txt uploaded by russell (license 2) Tested by: aragon, russell (closes issue #15817) Reported by: zerohalo Tested by: zerohalo (closes issue #15845) Reported by: marhbere Review: https://reviewboard.asterisk.org/r/386/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@222878 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-20Really stop the stream, when ast_closestream() is called.tilghman1-0/+16
(closes issue #15129) Reported by: bmh Patches: 20090918__issue15129.diff.txt uploaded by tilghman (license 14) Review: https://reviewboard.asterisk.org/r/372/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@219653 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26Don't fast forward past the end of a message.russell1-0/+7
This is nice change for users of the voicemail application. If someone gets a little carried away with fast forwarding through a message, they can easily get to the end and accidentally exit the voicemail application by hitting the fast forward key during the following prompt. This adds some safety by not allowing a fast forward past the end of a message. (closes issue #14554) Reported by: lacoursj Patches: 21761.patch uploaded by lacoursj (license 707) Tested by: lacoursj git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@203785 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-16Improve support for media paths that can generate multiple frames at once.kpfleming1-6/+12
There are various media paths in Asterisk (codec translators and UDPTL, primarily) that can generate more than one frame to be generated when the application calling them expects only a single frame. This patch addresses a number of those cases, at least the primary ones to solve the known problems. In addition it removes the broken TRACE_FRAMES support, fixes a number of bugs in various frame-related API functions, and cleans up various code paths affected by these changes. https://reviewboard.asterisk.org/r/175/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@200991 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-15Update ast_readvideo_callback to match ast_readaudio_callback.mmichelson1-2/+11
This fixes potential refcount errors that may occur on ast_filestreams. AST-208 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@188582 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09Add debugging mode for diagnosing file descriptor leaks.tilghman1-3/+6
(Related to issue #14625) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@187300 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18revert commit that included extranous changeskpfleming1-12/+6
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@182807 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18Improve the build system to *properly* remove unnecessary symbols from the ↵kpfleming1-6/+12
runtime global namespace. Along the way, change the prefixes on some internal-only API calls to use a common prefix. With these changes, for a module to export symbols into the global namespace, it must have *both* the AST_MODFLAG_GLOBAL_SYMBOLS flag and a linker script that allows the linker to leave the symbols exposed in the module's .so file (see res_odbc.exports for an example). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@182802 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-12Fix a place where filestreams were not refcounted properlymmichelson1-1/+10
This section was already present in trunk and other branches, but did not exist in 1.4. (closes issue #14395) Reported by: ZX81 Patches: 14395.patch uploaded by putnopvut (license 60) Tested by: ZX81 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@175407 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-07Fix the last couple of places where free() was improperly used directly.russell1-7/+8
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167566 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-07Don't fclose() the file early, the filestream destructor will handle it.russell1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167554 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-07Only try to close the file if one was actually openedrussell1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167545 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-07Don't use free() directly. This caused a crash since ast_filestream is now ↵russell1-1/+1
an ao2 object. Reported by JunK-Y on IRC, #asterisk-dev git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167541 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-20There was an issue when attempting to reference an embeddedmmichelson1-39/+76
frame in a freed ast_filestream. This patch makes use of the ao2 functions to make sure that we do not free an ast_filestream structure until the embedded ast_frame has been "freed" as well. (closes issue #13496) Reported by: fst-onge Patches: filestream_frame_1_4.diff uploaded by putnopvut (license 60) Tested by: putnopvut Closes AST-89 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@158126 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-03somehow missed a bunch of gcc 4.3.x warnings in this branch on the first passkpfleming1-5/+12
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153823 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-01fix a bunch of potential problems found by gcc 4.3.x, primarily bare strings ↵kpfleming1-2/+5
being passed to printf()-like functions and ignored results from read()/write() and friends git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153337 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-12Don't return a free'd pointer, when a file cannot be opened.tilghman1-0/+1
(closes issue #13462) Reported by: wackysalut git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@142740 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-11a whole pile of Zaptel/DAHDI compatibility work, with lots more to come... ↵kpfleming1-1/+1
this tree is not yet ready for users to be easily upgrading or switching, but it needs to be :-) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@130298 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-12Adds DAHDI support alongside Zaptel. DAHDI usage favored, but all Zap stuff ↵jpeeler1-3/+3
should continue working. Release announcement to follow. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@122314 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-22I thought I was going to be able to leave 1.4 alone, but that was not the case.russell1-5/+16
I ran into some problems with G.722 in 1.4, so I have merged in all of the fixes in this area that I have made in trunk/1.6.0, and things are happy again. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114550 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-10Only try to prefix language if we are not using an absolute path (suffix it ↵qwell1-6/+1
otherwise). en/var/lib/asterisk/sounds/blah.gsm is a very silly path. (closes issue #12379) Reported by: kuj Patches: 12379-absolutepath.diff uploaded by qwell (license 4) Tested by: kuj, qwell git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114035 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-17Backport revision 106439 from trunk. I didn't realize this was broken in ↵qwell1-41/+71
1.4 as well. Closes issue #12222. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@109057 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-05Add a control frame to indicate the source of media has changed. Depending ↵file1-0/+1
on the underlying technology it may need to change some things. (closes issue #12148) Reported by: jcomellas git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@106235 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-27Bump a couple of more buffers up by 2 so that annoying warnings aren't generatedmmichelson1-2/+2
like crazy on every fileexists_core call. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@104783 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-27Bump up the buffer by 2.file1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@104665 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-27fallback to standard English prompts properly when using new prompt ↵kpfleming1-14/+22
directory layout (closes issue #11831) Reported by: IgorG Patches: fallbacken.v1.diff uploaded by IgorG (license 20) (modified by me to improve code and conform rest of function to coding guidelines) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@104593 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-31Fix a couple of places where ast_frfree() was not called on a frame that camerussell1-0/+1
from a translator. This showed itself by g729 decoders not getting released. Since the flag inside the translator frame never got unset by freeing the frame to indicate it was no longer in use, the translators never got destroyed, and thus the g729 licenses were not released. (closes issue #11892) Reported by: xrg Patches: 11892.diff uploaded by russell (license 2) Tested by: xrg, russell git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@101601 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-27When deleting a task from the scheduler, ignoring the return value couldtilghman1-6/+2
possibly cause memory to be accessed after it is freed, which causes all sorts of random memory corruption. Instead, if a deletion fails, wait a bit and try again (noting that another thread could change our taskid value). (closes issue #11386) Reported by: flujan Patches: 20080124__bug11386.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76, flujan, stuarth` git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@100465 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-29Use of "private" as a field name in a header file messes with C++ projectstilghman1-1/+1
Reported by: chewbacca Patch by: casper (Closes issue #11401) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90155 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-29Merge a change from team/russell/chan_refcount ...russell1-0/+5
This makes ast_stopstream() thread-safe. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90142 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-21gcc 4.2 has a new set of warnings dealing with cosnt pointers. This set ofrussell1-6/+6
changes gets all of Asterisk (minus chan_alsa for now) to compile with gcc 4.2. (closes issue #10774, patch from qwell) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@83432 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-05Fix an issue that can occur when you do an attended transfer to parking. Ifrussell1-29/+97
you complete the transfer before the announcement of the parking spot finishes, then the channel being parked will hear the remainder of the announcement. These changes make it so that will not happen anymore. Basically, res_features sets a flag on the channel is playing the announcement to so that the file streaming core knows that it needs to watch out for a channel masquerade, and if it occurs, to abort the announcement. (closes BE-182) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@81599 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-10Don't bother having the core pass through or emulate begin DTMF frames when ↵file1-1/+15
in an ast_waitstream. It only cares about the end of DTMF. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@78955 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-22Merged revisions 71065 via svnmerge from qwell1-4/+3
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r71065 | qwell | 2007-06-22 09:52:18 -0500 (Fri, 22 Jun 2007) | 4 lines Fix a few silly usages of ast_playstream() - it only ever returns 0... Issue 10035 ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@71068 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-06Properly handle cases where a stream can't be written to. (issue #9757 ↵file1-0/+2
reported by junky) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@67924 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-06Stop the video stream when you stop playback of all streams for a calloej1-0/+5
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@63152 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-08Merged revisions 60660 via svnmerge from tilghman1-4/+9
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r60660 | tilghman | 2007-04-07 20:39:25 -0500 (Sat, 07 Apr 2007) | 2 lines Bug 9486 - memory leak when opening a filestream ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@60661 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-02Return the correct digit that interrupted the stream. This fixes exiting therussell1-0/+1
Background application when using the m option. (issue #9176, mjagdis) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@57396 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-26Fix core show file formats CLI command.file1-2/+29
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@52335 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-16Display more useful output when streaming files.qwell1-3/+2
Include the channel name to which the file is being played. Issue 8828, patch by junky. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@51146 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-27since these variables all have static duration, none of them need ↵kpfleming1-1/+1
initializers (they default to zero anyway) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49006 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-27move extern declaration for this option to a header file where it belongskpfleming1-1/+1
provide an initial value for 'languageprefix' option, instead of relying on randomness to provide a useful value git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48998 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-15don't try to call fclose() if fopen() failedkpfleming1-3/+4
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47701 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-02Reverse change of "show" to "list" and make several other commands more ↵tilghman1-2/+2
consistent with "category verb arguments" git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47051 f38db490-d61c-443f-a65b-d21fe96a405b