summaryrefslogtreecommitdiff
path: root/main/file.c
AgeCommit message (Collapse)Author
2008-08-10Another big chunk of changes from the RSW branch. Bunch of stuff from main/Sean Bright
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@137082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-13Merge changes from timing branchRussell Bryant
- Convert chan_iax2 to use the timing API - Convert usage of timing in the core to use the timing API instead of using DAHDI directly - Make a change to the timing API to add the set_rate() function - change the timing core to use a rwlock - merge a timing implementation, res_timing_dahdi Basic testing was successful using res_timing_dahdi git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12Goodbye Zaptel, hello DAHDI. Removes Zaptel driver support with DAHDI. ↵Jeff Peeler
Configuration file and dialplan backwards compatability has been put in place where appropiate. Release announcement to follow. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@122234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-22- revert change to ast_queue_hangup and create ast_queue_hangup_with_causeMichiel van Baak
- 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: https://origsvn.digium.com/svn/asterisk/trunk@117802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-10Merged revisions 114035 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r114035 | qwell | 2008-04-10 12:26:10 -0500 (Thu, 10 Apr 2008) | 10 lines Only try to prefix language if we are not using an absolute path (suffix it 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: https://origsvn.digium.com/svn/asterisk/trunk@114036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-03Use a 32k file buffer on recordings, which increases the efficiency of file ↵Tilghman Lesher
recording. (closes issue #11962) Reported by: garlew Patches: recording.patch uploaded by garlew (license 376) bug-11962.diff uploaded by snuffy (license 35) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112564 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-20Fix a bug when using zaptel timing for playing back files that have a sample ↵Russell Bryant
rate other than 8 kHz. The issue here is that format modules give a "whennext" sample value, which is used to calculate when to set a timer for to retrieve the next frame. However, the zaptel timer operates on 8 kHz samples, so this must be taken into account. (another part of issue #12164, reported by milazzo and jsmith, patch by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110303 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07Merge changes from team/russell/g722-sillyness ...Russell Bryant
Fix a number of other places where the number of samples in a G722 frame was not properly handled because of various reasons. main/rtp.c: - When a G722 frame is read from the smoother, the number of samples in the frame must be divided by 2 before being sent out over the network. Even though G722 is 16 kHz, an error in some previous spec has made it so that we have to list the number of samples such as if it was 8 kHz. main/file.c: - When scheduling the next time to expect a frame, take into account that the format of the file we're reading from may not be 8 kHz. codecs/codec_g722.c: - When converting from G722 to slinear, g722_decode() expects its samples parameter to be in the silly (real samples / 2) format. Make it so. - When converting from slinear to G722, properly set the number of samples in the frame to be the number of bytes of output * 2. formats/format_pcm.c: - This format module handles G722, among a number of other formats. However, the read() and seek() functions did not account for the fact that G722 has 2 samples per byte. (closes issue #12130, reported by rickross, patched by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-06Fix file playback in many cases.Jason Parker
(closes issue #12115) Reported by: pj Patches: v2-fileexists.patch uploaded by dimas (license 88) (with modifications by me) Tested by: dimas, qwell, russell git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05Merged revisions 106235 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r106235 | file | 2008-03-05 18:32:10 -0400 (Wed, 05 Mar 2008) | 4 lines Add a control frame to indicate the source of media has changed. Depending on the underlying technology it may need to change some things. (closes issue #12148) Reported by: jcomellas ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04Whitespace changes onlyTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27Merged revisions 104783 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104783 | mmichelson | 2008-02-27 14:36:26 -0600 (Wed, 27 Feb 2008) | 4 lines Bump a couple of more buffers up by 2 so that annoying warnings aren't generated like crazy on every fileexists_core call. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27Merged revisions 104665 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104665 | file | 2008-02-27 13:41:40 -0400 (Wed, 27 Feb 2008) | 2 lines Bump up the buffer by 2. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-27Merged revisions 104593 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r104593 | kpfleming | 2008-02-27 10:53:06 -0600 (Wed, 27 Feb 2008) | 8 lines fallback to standard English prompts properly when using new prompt 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: https://origsvn.digium.com/svn/asterisk/trunk@104594 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-19Only output a log message saying the format does not exist if it actually ↵Joshua Colp
does not exist, not if the file itself could not be opened. (closes issue #11828) Reported by: IgorG Patches: readfile.v1.diff uploaded by IgorG (license 20) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-31Merged revisions 101601 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r101601 | russell | 2008-01-31 17:10:06 -0600 (Thu, 31 Jan 2008) | 12 lines Fix a couple of places where ast_frfree() was not called on a frame that came 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: https://origsvn.digium.com/svn/asterisk/trunk@101611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-27Merged revisions 100465 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r100465 | tilghman | 2008-01-27 15:59:53 -0600 (Sun, 27 Jan 2008) | 11 lines When deleting a task from the scheduler, ignoring the return value could 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: https://origsvn.digium.com/svn/asterisk/trunk@100488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29Merged revisions 90155 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r90155 | tilghman | 2007-11-29 11:29:59 -0600 (Thu, 29 Nov 2007) | 5 lines Use of "private" as a field name in a header file messes with C++ projects Reported by: chewbacca Patch by: casper (Closes issue #11401) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-29Merged revisions 90142 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r90142 | russell | 2007-11-28 18:06:08 -0600 (Wed, 28 Nov 2007) | 4 lines Merge a change from team/russell/chan_refcount ... This makes ast_stopstream() thread-safe. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-22more removal of fcntl.h and other system headersLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-22implement the split of file.h and mod_format.hLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21remove a bunch of useless #include "options.h"Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20move asterisk/paths.h outside asterisk.h and into those filesLuigi Rizzo
who really need it. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89466 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-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
2007-11-08improve linked-list macros in two ways:Kevin P. Fleming
- 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: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06Commit some cleanups to the format type code.Tilghman Lesher
- Remove the AST_FORMAT_MAX_* types, as these are consuming 3 out of our available 32 bits. - Add a native slin16 type, so that 16kHz codecs can translate without losing resolution. (This doesn't affect anything immediately, until another codec has wb support.) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former ↵Jason Parker
didn't make much sense git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19Convert NEW_CLI to AST_CLI.Jason Parker
Closes issue #11039, as suggested by seanbright. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-11Merge a ton of NEW_CLI conversions. Thanks to everyone that helped out! :)Russell Bryant
(closes issue #10724) Reported by: eliel Patches: chan_skinny.c.patch uploaded by eliel (license 64) chan_oss.c.patch uploaded by eliel (license 64) chan_mgcp.c.patch2 uploaded by eliel (license 64) pbx_config.c.patch uploaded by seanbright (license 71) iax2-provision.c.patch uploaded by eliel (license 64) chan_gtalk.c.patch uploaded by eliel (license 64) pbx_ael.c.patch uploaded by seanbright (license 71) file.c.patch uploaded by seanbright (license 71) image.c.patch uploaded by seanbright (license 71) cli.c.patch uploaded by moy (license 222) astobj2.c.patch uploaded by moy (license 222) asterisk.c.patch uploaded by moy (license 222) res_limit.c.patch uploaded by seanbright (license 71) res_convert.c.patch uploaded by seanbright (license 71) res_crypto.c.patch uploaded by seanbright (license 71) app_osplookup.c.patch uploaded by seanbright (license 71) app_rpt.c.patch uploaded by seanbright (license 71) app_mixmonitor.c.patch uploaded by seanbright (license 71) channel.c.patch uploaded by seanbright (license 71) translate.c.patch uploaded by seanbright (license 71) udptl.c.patch uploaded by seanbright (license 71) threadstorage.c.patch uploaded by seanbright (license 71) db.c.patch uploaded by seanbright (license 71) cdr.c.patch uploaded by moy (license 222) pbd_dundi.c.patch uploaded by moy (license 222) app_osplookup-rev83558.patch uploaded by moy (license 222) res_clioriginate.c.patch uploaded by moy (license 222) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85460 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-21Merged revisions 83432 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r83432 | russell | 2007-09-21 09:37:20 -0500 (Fri, 21 Sep 2007) | 4 lines gcc 4.2 has a new set of warnings dealing with cosnt pointers. This set of 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: https://origsvn.digium.com/svn/asterisk/trunk@83433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-05Merged revisions 81599 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r81599 | russell | 2007-09-05 15:53:41 -0500 (Wed, 05 Sep 2007) | 11 lines Fix an issue that can occur when you do an attended transfer to parking. If 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: https://origsvn.digium.com/svn/asterisk/trunk@81600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10Merged revisions 78955 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r78955 | file | 2007-08-10 11:15:53 -0300 (Fri, 10 Aug 2007) | 2 lines Don't bother having the core pass through or emulate begin DTMF frames when in an ast_waitstream. It only cares about the end of DTMF. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26Do a massive conversion for using the ast_verb() macroRussell Bryant
(closes issue #10277, patches by mvanbaak) Basically, this changes ... if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3, "Something\n"); to ... ast_verb(3, "Something\n"); git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22Merged revisions 71068 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r71068 | qwell | 2007-06-22 10:00:30 -0500 (Fri, 22 Jun 2007) | 12 lines Merged revisions 71065 via svnmerge from 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: https://origsvn.digium.com/svn/asterisk/trunk@71069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14Convert uses of strdup() to ast_strdup()Russell Bryant
(issue #9983, eliel) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14Add a massive set of changes for converting to use the ast_debug() macro.Russell Bryant
(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-06Merged revisions 67924 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r67924 | file | 2007-06-06 19:38:15 -0400 (Wed, 06 Jun 2007) | 2 lines Properly handle cases where a stream can't be written to. (issue #9757 reported by junky) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06Issue 9869 - replace malloc and memset with ast_calloc, and other coding ↵Tilghman Lesher
guidelines changes git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-06Merged revisions 63152 via svnmerge from Olle Johansson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r63152 | oej | 2007-05-06 14:28:38 +0200 (Sun, 06 May 2007) | 2 lines Stop the video stream when you stop playback of all streams for a call ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-08Merged revisions 60661 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r60661 | tilghman | 2007-04-07 20:40:47 -0500 (Sat, 07 Apr 2007) | 10 lines Merged revisions 60660 via svnmerge from 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: https://origsvn.digium.com/svn/asterisk/trunk@60662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-07Add the format of the file that is currently being played to the verbose ↵Russell Bryant
message. (issue #9105, junky) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58208 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-02Merged revisions 57396 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r57396 | russell | 2007-03-01 18:20:44 -0600 (Thu, 01 Mar 2007) | 4 lines Return the correct digit that interrupted the stream. This fixes exiting the Background application when using the m option. (issue #9176, mjagdis) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@57397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-26Merged revisions 52335 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r52335 | file | 2007-01-26 18:46:47 -0500 (Fri, 26 Jan 2007) | 2 lines Fix core show file formats CLI command. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@52336 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-26Convert some more stuff to read/write lists.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@52332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23Cosmetic changes. Make main source files better conform to coding guidelines ↵Joshua Colp
and standards. (issue #8679 reported by johann8384) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16Merged revisions 51146 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r51146 | qwell | 2007-01-16 11:36:53 -0600 (Tue, 16 Jan 2007) | 6 lines Display more useful output when streaming files. Include the channel name to which the file is being played. Issue 8828, patch by junky. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51147 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27make the 'languageprefix' option default to on, and deprecate turning it offKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-27Merged revisions 48998 via svnmerge from Kevin P. Fleming
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r48998 | kpfleming | 2006-12-27 15:08:30 -0600 (Wed, 27 Dec 2006) | 3 lines move extern declaration for this option to a header file where it belongs provide an initial value for 'languageprefix' option, instead of relying on randomness to provide a useful value ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48999 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-21a quick fix to app_sms.c to get rid of cursed compiler warnings so I can ↵Steve Murphy
compile under --enable-dev-mode git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48767 65c4cc65-6c06-0410-ace0-fbb531ad65f3