Continue channel opaque-ification by wrapping all of the stringfields.
Eventually, we will restrict what can actually set these variables, but
the purpose for now is to hide the implementation and keep people from
adding code that directly accesses the channel structure. Semantic
changes will follow afterward.
Review: https://reviewboard.asterisk.org/r/1661/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This is a feature patch which allows an 'announcement' option to be specified in
musiconhold.conf which should be set to the name of a sound. If a valid sound is
specified for this option, then it will be played on that music on hold class whenever
a channel bound to that class is put on hold as well as when Asterisk is able to detect
that a song has ended before starting the next song (excludes external players).
(closes ASTERISK-18977)
Reported by: Timo Teräs
Patches:
asterisk-moh-announcement.diff uploaded by Timo Teräs (license 5409)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
There are many benefits to making the ast_channel an opaque handle, from
increasing maintainability to presenting ways to kill masquerades. This patch
kicks things off by taking things a field at a time, renaming the field to
'__do_not_use_${fieldname}' and then writing setters/getters and converting the
existing code to using them. When all fields are done, we can move ast_channel
to a C file from channel.h and lop off the '__do_not_use_'.
This patch sets up main/channel_interal_api.c to be the only file that actually
accesses the ast_channel's fields directly. The intent would be for any API
functions in channel.c to use the accessor functions. No more monkeying around
with channel internals. We should use our own APIs.
The interesting changes in this patch are the addition of
channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to
channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to
use accessor functions when ast_channel is really opaque), and some re-working
of the way channel iterators/callbacks are handled so as to avoid creating fake
ast_channels on the stack to pass in matching data by directly accessing fields
(since "name" is a stringfield and the fake channel doesn't init the
stringfields, you can't use the ast_channel_name_set() function). I went with
ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a
setter.
The majority of the grunt-work for this change was done by writing a semantic
patch using Coccinelle ( http://coccinelle.lip6.fr/ ).
Review: https://reviewboard.asterisk.org/r/1655/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Prior to this patch, res_musiconhold existed at the same module priority level
as the timing sources that it depends on. This would cause a problem when
music on hold was reloaded, as the timing source could be changed after
res_musiconhold was processed. This patch adds a new module priority level,
AST_MODPRI_TIMING, that the various timing modules are now loaded at. This
now occurs before loading other resource modules, such that the timing source
is guaranteed to be set prior to resolving the timing source dependencies.
(closes issue ASTERISK-17474)
Reporter: Luke H
Tested by: Luke H, Vladimir Mikhelson, zzsurf, Wes Van Tlghem, elguero, Thomas Arimont
Patches:
asterisk-17474-dahdi_timing-infinite-wait-fix_v3_branch-1.8.diff uploaded by elguero (License #5026)
asterisk-17474-dahdi_timing-infinite-wait-fix_v3_branch-10.diff uploaded by elguero (License #5026)
asterisk-17474-dahdi_timing-infinite-wait-fix_v3.diff uploaded by elguero (License #5026)
Review: https://reviewboard.asterisk.org/r/1578/
........
Merged revisions 349194 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 349195 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
As a result of the fix for ASTERISK-18039, realtime caching MOH no longer
properly resumes playing back a file between different holds in the same call.
This is because scanning for new files causes the existing file array to be
emptied and we were just comparing that the saved pointer to the filename
matched the pointer to the filename in a particular position in the array. An
easy fix is to save the filename instead of a pointer to it and then do a
strcmp instead of comparing the addresses.
(closes issue ASTERISK-18912)
Review: https://reviewboard.asterisk.org/r/1596/
........
Merged revisions 346030 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 346031 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346033 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/10
................
r334357 | rmudgett | 2011-09-02 16:08:16 -0500 (Fri, 02 Sep 2011) | 26 lines
Merged revisions 334355 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r334355 | rmudgett | 2011-09-02 15:59:49 -0500 (Fri, 02 Sep 2011) | 19 lines
MusicOnHold has extra unref which may lead to memory corruption and crash.
The problem happens when a call is disconnected and you had started a MOH
class that does not use the files mode. If you define REF_DEBUG and
recreate the problem, it will announce itself with the following warning:
Attempt to unref mohclass 0xb70722e0 (default) when only 1 ref remained,
and class is still in a container!
* Fixed moh_alloc() and moh_release() functions not handling the
state->class reference consistently.
(closes issue ASTERISK-18346)
Reported by: Mark Murawski
Patches:
jira_asterisk_18346_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: rmudgett, Mark Murawski
Review: https://reviewboard.asterisk.org/r/1404/
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/10
................
r331039 | kmoore | 2011-08-08 15:53:30 -0500 (Mon, 08 Aug 2011) | 18 lines
Merged revisions 331038 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r331038 | kmoore | 2011-08-08 15:52:45 -0500 (Mon, 08 Aug 2011) | 11 lines
In-queue MOH stops after a periodic announcement
If the seek value is past the end of file when resuming G.722 MOH, MOH will
cease to function for the duration of the MOH session through all starts and
stops until saved state is cleared. Adjusting the code to guarantee a single
valid read (which is already assumed) fixes the bug.
(closes issue ASTERISK-18077)
Review: https://reviewboard.asterisk.org/r/1328/
Tested-by: Jonathan Rose <jrose@digium.com>
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r325821 | jrose | 2011-06-30 14:17:32 -0500 (Thu, 30 Jun 2011) | 10 lines
Fixes an issue with Music on Hold classes losing files in playlist when realtime is used.
The bug occurs rather intermittently and I relied on the reporters to test the patch.
After a sanity check and some testing, I'm giving it an OK.
(closes issue ASTERISK-17875)
Reported by: David Cunningham
Patches:
res_musiconhold.c.mohrt17875_v1 uploaded by Igor Goncharovsky (license #5009)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@325864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal. For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal
The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs. Functionally
no change in behavior should be present in this patch. Thanks to twilson
and russell for all the time they spent reviewing these changes.
Review: https://reviewboard.asterisk.org/r/1083/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r292376 | tilghman | 2010-10-19 19:40:29 -0500 (Tue, 19 Oct 2010) | 5 lines
Oops. This module uses the generic timer and no longer uses DAHDI.
This causes a problem with the Solaris and other system builds that have gcc
4.1 (where optional_api is non-optional).
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.8
................
r292050 | tzafrir | 2010-10-16 12:47:00 +0200 (ש', 16 אוק 2010) | 22 lines
Merged revisions 292049 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r292049 | tzafrir | 2010-10-16 12:03:04 +0200 (ש', 16 אוק 2010) | 15 lines
Base directory for MOH should be ASTDATADIR
If the directive 'directory' is relative, make it relative to the
datadir, rather than to the varlibdir. In the sample configuration
it is relative ('moh').
This has no effect unless you have actively set the datadir explicitly
(at build time or at run time).
(closes issue #16906)
Patches:
moh_datadir uploaded by tzafrir (license 46)
Review: https://reviewboard.asterisk.org/r/974/
........
................
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The result for moh_register was not verified to guarantee
the mohclass as added to the container.
(closes issue #16993)
Reported by: dmitri
Patches:
res_musiconhold_rtclass2.patch uploaded by dmitri (license 1001)
moh_crash2.diff uploaded by dvossel (license 671)
Tested by: dmitri
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r260345 | mmichelson | 2010-04-30 15:08:15 -0500 (Fri, 30 Apr 2010) | 18 lines
Fix potential crash from race condition due to accessing channel data without the channel locked.
In res_musiconhold.c, there are several places where a channel's
stream's existence is checked prior to calling ast_closestream on it. The issue
here is that in several cases, the channel was not locked while checking the
stream. The result was that if two threads checked the state of the channel's
stream at approximately the same time, then there could be a situation where
both threads attempt to call ast_closestream on the channel's stream. The result
here is that the refcount for the stream would go below 0, resulting in a crash.
I have added proper channel locking to res_musiconhold.c to ensure that
we do not try to check chan->stream without the channel locked. A Digium customer
has been using this patch for several weeks and has not had any crashes since
applying the patch.
ABE-2147
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@260346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Classes are now tracked past removal from the core container, and module
removal is actively prevented until all references are freed.
* A hanging reference stored in the channel has been removed. This could have
caused a mismatch and the music state not properly cleared, if two or more
reloads occurred between MOH being stopped and MOH being restarted.
* In certain circumstances, duplicate classes were possible.
* A race existed at reload time between a process being killed and the thread
responsible for reading from the related pipe respawning that process.
* Several reference counts have also been corrected. At least one could have
caused deleted classes to stick around forever, consuming resources. This
originally manifested as MOH external processes that were not killed at
reload time.
(closes issue #16279, closes issue #16207)
Reported by: parisioa, dcabot
Patches:
20091202__issue16279__2.diff.txt uploaded by tilghman (license 14)
Tested by: parisioa, tilghman
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r222152 | kpfleming | 2009-10-05 20:16:36 -0500 (Mon, 05 Oct 2009) | 20 lines
Fix ao2_iterator API to hold references to containers being iterated.
See Mantis issue for details of what prompted this change.
Additional notes:
This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK
has become an enum instead of a macro, with a name that fits our
naming policy; also, it is now necessary to call
ao2_iterator_destroy() on any iterator that has been
created. Currently this only releases the reference to the container
being iterated, but in the future this could also release other
resources used by the iterator, if the iterator implementation changes
to use additional resources.
(closes issue #15987)
Reported by: kpfleming
Review: https://reviewboard.asterisk.org/r/383/
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r201600 | russell | 2009-06-18 10:24:31 -0500 (Thu, 18 Jun 2009) | 29 lines
Fix memory corruption and leakage related reloads of non files mode MoH classes.
For Music on Hold classes that are not files mode, meaning that we are executing
an application that will feed us audio data, we use a thread to monitor the
external application and read audio from it. This thread also makes use of the
MoH class object. In the MoH class destructor, we used pthread_cancel() to ask
the thread to exit. Unfortunately, the code did not wait to ensure that the
thread actually went away. What needed to be done is a pthread_join() to ensure
that the thread fully cleans up before we proceed. By adding this one line, we
resolve two significant problems:
1) Since the thread was never joined, it never fully goes away. So, on every
reload of non-files mode MoH, an unused thread was sticking around.
2) There was a race condition here where the application monitoring thread
could still try to access the MoH class, even though the thread executing
the MoH reload has already destroyed it.
(issue #15109)
Reported by: jvandal
(issue #15123)
Reported by: axisinternet
(issue #15195)
Reported by: amorsen
(issue AST-208)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Move MusicOnHold, SetMusicOnHold, StartMusicOnHold, StopMusicOnHold static
documentation to the new AstXML form.
(issue #15245)
Reported by: eliel
Patches:
res_musiconhold_static_conversion.txt uploaded by lmadsen (license 10)
(with some fixes and formatting by me)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199413 65c4cc65-6c06-0410-ace0-fbb531ad65f3