aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_musiconhold.c
AgeCommit message (Collapse)AuthorFilesLines
2009-01-09Make this compile for mvanbaakrussell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@168198 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-22Re-work ref count handling of MoH classes using astobj2 to resolve crashes.russell1-325/+441
(closes issue #13566) Reported by: igorcarneiro Tested by: russell Review: http://reviewboard.digium.com/r/106/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@166262 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-19(closes issue #13480)jpeeler1-5/+1
Reported by: tzafrir Replace a bunch of if defined checks for Zaptel/DAHDI through several new defines in dahdi_compat.h. This removes a lot of code duplication. Example from bug: #ifdef HAVE_ZAPTEL fd = open("/dev/zap/pseudo", O_RDWR); #else fd = open("/dev/dahdi/pseudo", O_RDWR); #endif is replaced with: fd = open(DAHDI_FILE_PSEUDO, O_RDRW); git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@165991 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-18Set the process group ID on the MOH process so that all children will get killedrussell1-6/+7
(closes issue #14099) Reported by: caspy Patches: res_musiconhold.c.patch.killpg.try2 uploaded by caspy (license 645) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@165661 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-16Don't try to change working directory if a directory was not configured.russell1-1/+1
(closes issue #14089) Reported by: caspy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164605 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10Oops, inverted logic for a strcasecmp check. Pointed out by mmichelson, thanks!jpeeler1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162926 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10(closes issue #13229)jpeeler1-5/+5
Reported by: clegall_proformatique Ensure that moh_generate does not return prematurely before local_ast_moh_stop is called. Also, the sleep in mp3_spawn now only occurs for http locations since it seems to have been added originally only for failing media streams. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162874 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-01fix a bunch of potential problems found by gcc 4.3.x, primarily bare strings ↵kpfleming1-4/+16
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-06-13fixed dahdi compatability header from assuming either dahdi or zaptel is ↵jpeeler1-1/+1
installed (may not have either) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@122663 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-12Adds DAHDI support alongside Zaptel. DAHDI usage favored, but all Zap stuff ↵jpeeler1-7/+9
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-05-06Switch to using ast_random() rather than just rand().qwell1-1/+1
This does not fix the bug reported, but I believe it is correct. (from issue #12446) Patches: bug_12446.diff uploaded by snuffy (license 35) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@115418 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-23Fix reload/unload for res_musiconhold module.qwell1-19/+38
(closes issue #11575) Reported by: sunder Patches: M11575_14_rev3.diff uploaded by junky (license 177) bug11575_trunk.diff.txt uploaded by jamesgolovich (license 176) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114594 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-22Trivial change to read the number of samples from a frame before calling ↵russell1-1/+1
ast_write() git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114545 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-19MOH usage information needs a terminating newline, or elsetilghman1-3/+3
"asterisk -rx 'help moh reload'" will hang. Reported via -dev list, fixed by me. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@114297 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-19Add sanity checking for position resuming. We *have* to make sure that the ↵file1-2/+8
position does not exceed the total number of files present, and we have to make sure that the position's filename is the same as previous. These values can change if a music class is reloaded and give unpredictable behavior. (closes issue #11663) Reported by: junky git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@110035 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-14Fix a potential segfault if chan (or chan->music_state) is NULL.qwell1-13/+16
Closes issue #12210, credit to edantie for pointing this out. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@108682 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-06Fix init_classes() so that classes that actually do have files loaded aren'trussell1-1/+1
treated as empty, and immediately destroyed ... git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89053 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-06If someone were to delete the files used by an existing MOH class, and thenrussell1-3/+15
issue a reload, further use of that class could result in a crash due to dividing by zero. This set of changes fixes up some places to prevent this from happening. (closes issue #10948) Reported by: jcomellas Patches: res_musiconhold_division_by_zero.patch uploaded by jcomellas (license 282) Additional changes added by me. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89037 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01Fix randomness. save_pos was being set to 0 initially instead of -1, causing ↵file1-0/+1
it to jump to position 0 when moh started. (closes issue #10859) Reported by: jamesgolovich Patches: asterisk-mohpos2.diff.txt uploaded by jamesgolovich (license 176) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84160 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-27(closes issue #10419)russell1-5/+5
Reported by: mustardman Patches: asterisk-mohposition.diff.txt uploaded by jamesgolovich (license 176) This patch fixes a few problems with music on hold. * Fix issues with starting at the beginning of a file when it shouldn't. * Fix the inuse counter to be decremented even if the class had not been set to be deleted when not in use anymore * Don't arbitrarily limit the number of MOH files to 255 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@81042 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16Fix a little race condition that could cause a crash if two channels had MOHrussell1-3/+1
stopped at the same time that were using a class that had been marked for deletion when its use count hits zero. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@79792 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16This patch fixes a bug where reloading the module with "module reload" did notrussell1-30/+48
delete classes from memory that were no longer in the config. This patch fixes that problem as well as another one. Previously, if you reloaded MOH using the "moh reload" CLI command, which behaved differently than "module reload ...", MOH had to be stopped on every channel and started again immediately. However, there was no way to tell what class was being used, so they would all fall back to the default class. (closes issue #10139) Reported by: blitzrage Patches: asterisk-10139-advanced.diff.txt uploaded by jamesgolovich (license 176) Tested by: jamesgolovich git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@79778 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-13Merged revisions 75107 via svnmerge from russell1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r75107 | russell | 2007-07-13 15:35:22 -0500 (Fri, 13 Jul 2007) | 3 lines Fix a couple potential minor memory leaks. load_moh_classes() could return without destroying the loaded configuration. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@75108 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-13Merged revisions 75059 via svnmerge from russell1-0/+3
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r75059 | russell | 2007-07-13 15:07:21 -0500 (Fri, 13 Jul 2007) | 6 lines Ensure that adding a user to the list of users of a specific music on hold class is not done at the same time as any of the other operations on this list to prevent list corruption. Using the global moh_data lock for this is not ideal, but it is what is used to protect these lists everywhere else in the module, and I am only changing what is necessary to fix the bug. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@75067 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-12Merged revisions 74814 via svnmerge from file1-9/+9
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r74814 | file | 2007-07-12 12:51:24 -0300 (Thu, 12 Jul 2007) | 2 lines Only print out a warning for situations where it is actually helpful. (issue #10187 reported by denke) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@74815 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-10fix an uninitialized variablerussell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@74323 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-09(closes issue #10123)russell1-16/+14
Reported by: blitzrage Patches submitted by: juggie, qwell, me Tested by: blitzrage When trying to find a music on hold class to use, try all of the options, instead of only the first one that is set. Also, change the MusicOnHold applications to not hang up on the channel when a class can not be found. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@74162 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-01Merged revisions 53084 via svnmerge from file1-12/+13
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r53084 | file | 2007-02-01 15:03:10 -0600 (Thu, 01 Feb 2007) | 2 lines Return previous behavior of having MOH pick up where it was left off. (issue #8672 reported by sinistermidget) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@53088 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-23Merged revisions 51512 via svnmerge from file1-0/+6
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r51512 | file | 2007-01-22 20:41:35 -0500 (Mon, 22 Jan 2007) | 2 lines Yield before reading from zaptel timing source under Solaris so that other threads get a chance to do things. (issue #7875 reported by bob) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@51513 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-11Merged revisions 48374 via svnmerge from tilghman1-0/+11
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r48374 | tilghman | 2006-12-10 18:33:59 -0600 (Sun, 10 Dec 2006) | 5 lines When doing a fork() and exec(), two problems existed (Issue 8086): 1) Ignored signals stayed ignored after the exec(). 2) Signals could possibly fire between the fork() and exec(), causing Asterisk signal handlers within the child to execute, which caused nasty race conditions. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48375 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-07Merged revisions 48356 via svnmerge from russell1-0/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r48356 | russell | 2006-12-07 13:14:13 -0500 (Thu, 07 Dec 2006) | 3 lines Ensure that the file position is not incremented beyond the total number of files available for playback. (issue #8539, ulogic) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48357 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-27Merged revisions 48045 via svnmerge from tilghman1-17/+14
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r48045 | tilghman | 2006-11-27 11:15:54 -0600 (Mon, 27 Nov 2006) | 2 lines Random MOH wasn't really random (bug 8381) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48049 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-07Merged revisions 47238 via svnmerge from russell1-0/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r47238 | russell | 2006-11-06 20:22:58 -0500 (Mon, 06 Nov 2006) | 5 lines If random order is enabled for files mode music on hold, set a random initial position, instead of always starting at the first file, and doing the random operation only when switching to the next file. (bug reported by John Lange on the asterisk-dev mailing list) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47239 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
2006-11-02Merged revisions 46964 via svnmerge from russell1-0/+4
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r46964 | russell | 2006-11-02 12:47:56 -0500 (Thu, 02 Nov 2006) | 3 lines ignore files in a music on hold directory that begin with '.' (issue #8249, cboie) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@46965 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-27We should always be using _exit() after a fork() or vfork() instead of exit().russell1-1/+1
This is because exit() does some extra cleanup which in some implementations of vfork(), for example, can actually modify the state of the parent process, causing very weird bugs or crashes. (issue #7971, Nick Gavrikov) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@46363 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-04update thread creation code a bitkpfleming1-1/+1
reduce standard thread stack size slightly to allow the pthreads library to allocate the stack+data and not overflow a power-of-2 allocation in the kernel and waste memory/address space add a new stack size for 'background' threads (those that don't handle PBX calls) when LOW_MEMORY is defined git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@44378 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-28Put in missing \ns on the end of ast_logs (issue #7936 reported by wojtekka)file1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43933 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-19do this fix properly :-)kpfleming1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43302 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-19Various updates from PCadach's chan_h323-live branchmattf1-2/+6
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43294 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-18merge qwell's CLI verbification workkpfleming1-8/+24
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43212 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-24Fix a small typo I found.qwell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41009 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-15/+8
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-03Merged revisions 38825 via svnmerge from file1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38825 | file | 2006-08-03 15:54:02 -0400 (Thu, 03 Aug 2006) | 2 lines Treat the file as invalid if we have no valid formats for it (issue #7643 reported by KNK) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38826 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-01Merged revisions 38654 via svnmerge from file1-0/+4
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r38654 | file | 2006-08-01 15:20:05 -0400 (Tue, 01 Aug 2006) | 2 lines Close the stream when file based MOH stop. This won't get rid of their position in the file but it will cause the translation path to be setup again. (issue #7634 reported by asimpson) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38655 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-19merge Russell's 'hold_handling' branch, finally implementing music-on-hold ↵kpfleming1-9/+26
handling the way it was decided at AstriDevCon Europe 2006 (and the way people really want it to be) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37988 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-05prepare Asterisk for new zaptel.h/tonezone.h installation locationskpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37027 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-24The Eurostar Commit! (it's amazing how much work you can get done on a 150 ↵kpfleming1-4/+1
minute train ride from Paris to London <G>) support the new location for zaptel.h and tonezone.h use the dependency information output by menuselect to build Makefile rules for each module for header files and libraries combine the common rules into a top-level Makefile.rules file remove all (now) unnecessary stuff from subdir Makefiles change translator API so that the newpvt() callback returns an int instead of a pointer (it no longer allocates memory) alphabetize --with-<foo> options in configure script enhance Net-SNMP support in configure script to provide a --with-netsnmp option fix support for --with-pq so that if pg-config is not found when --with-pq is specified, an error will be generated add 'optional package' usage to modules now that menuselect can output it allow res_snmp to build by default, since the new loader changes coming soon will solve the function naming problem (and users can disable it via menuselect anyway) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@35832 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-09various minor portability fixes (mostly from tholo for OpenBSD)kpfleming1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33350 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-07simplify autoconfig include mechanism (make tholo happy he can use lint ↵kpfleming1-4/+4
again :-) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32846 f38db490-d61c-443f-a65b-d21fe96a405b