Steve Murphy [Wed, 21 Nov 2007 23:54:12 +0000 (23:54 +0000)]
closes issue #11285, where an unload of a module that creates a dialplan context, causes a crash when you do a 'dialplan show' of that context. This is because the registrar string is defined in the module, and the stale pointer is traversed. The reporter offered a patch that would always strdup the registrar string, which is practical, but I preferred to destroy the created contexts in each module where one is created. That seemed more symmetric. There were only 6 place in asterisk where this is done: chan_sip, chan_iax2, chan_skinny, res_features, app_dial, and app_queue. The two apps destroyed the context, but left the contexts. All is fixed now and unloads should be dialplan friendly.
Steve Murphy [Wed, 21 Nov 2007 20:38:00 +0000 (20:38 +0000)]
closes issue #11290; the proposed patch was a good guess, and would solve the bug to some extent, but was really masking the real issue, that there were bad entries in the table. This fix removes the condition that the hashtab updates be done on exten removal only when the pattern_tree was present, which is silly. The operations that apply to the pattern tree are instead made conditional. Also, threw back in routines that kpfleming deleted because of probs in the 64-bit world. Tested on both 32 and 64-bit machines (compile). Tested the reload problem with over 20 reloads, and no problems. If you find more problems, please reopen 11290.
Changing an inaccurate debug message to be less inaccurate. Under the circumstances, this
message would always report that there were 0 members available, even though that may not be true.
If a channel gets masqueraded in the middle of a park, don't play the
announcement to the masqueraded channel, and dial back to the original
channel on timeout.
Tilghman Lesher [Wed, 21 Nov 2007 18:38:18 +0000 (18:38 +0000)]
Change Read to set READSTATUS as an indication of the result
Also, some cleanup to CHANGES.
Reported by: michael-fig
Patch by: michael-fig,tilghman
(Closes issue #11004)
Mark Michelson [Wed, 21 Nov 2007 18:19:22 +0000 (18:19 +0000)]
There existed about a 1 in 4 billion chance that reading from /dev/urandom
would return LONG_MIN (1 in 9 quintillion if using 64-bit longs). Since there
is no positive equivalent of LONG_MIN, the result of labs() in this case is
unpredictable. This fixes that situation.
(closes issue #11336, reported and patched by sperreault)
Russell Bryant [Wed, 21 Nov 2007 16:24:17 +0000 (16:24 +0000)]
Fix some code that was supposed to ensure that a buffer was terminated, but was
writing to the wrong byte. Also, remove some non-thread safe test code.
(closes issue #11317)
Reported by: IgorG
Patches:
unistim-2.patch uploaded by IgorG (license 20)
- additional changes by me
Mark Michelson [Wed, 21 Nov 2007 16:08:12 +0000 (16:08 +0000)]
I introduced a deadlock avoidance into 1.4, which I attempted to port to trunk as well.
Unfortunately, since trunk uses read/write locks for the context lock, it means that I have
actually *introduced* a deadlock condition since they are not recursive. Removing this change
for now and will look into introducing a different one.
Kevin P. Fleming [Wed, 21 Nov 2007 16:07:11 +0000 (16:07 +0000)]
move these forward declarations back to asterisk.h where they belong... even though asterisk.h includes compat.h, these declarations have nothing to do with the being platform-compatible and are directly related to being part of Asterisk
Steve Murphy [Wed, 21 Nov 2007 01:09:47 +0000 (01:09 +0000)]
A free in add_pri was ultimately the source of the grief we were having with parking. This set of changes fixes that problem, and introduces some more error messages, and puts debugs into ifdefs for what could be short-term usage. Txs to Terry W. for his help, guidance, and especially patience.
Russell Bryant [Wed, 21 Nov 2007 00:21:38 +0000 (00:21 +0000)]
Merge changes from team/russell/sla_trunk_moh ...
* Added the ability to specify the music on hold class used to play into the
conference when there is only one member and the M option is used.
* Added the ability to specify a music on hold class to play instead of ringing
for the SLATrunk application.
According to comments in main/pbx.c, it is essential that if we are going to lock
the conlock as well as the hints lock, it must be locked in that respective order.
In order to prevent a potential deadlock, we need to lock the conlock prior to
locking the hints lock in ast_hint_state_changed (see the call stack example on
issue #11323 for how this can happen).
(closes issue #11323, reported by eelcob, suggestion for patch by eelcob, patch by me)
Luigi Rizzo [Tue, 20 Nov 2007 16:12:10 +0000 (16:12 +0000)]
Fix building of modules under cygwin.
After this commit we can actually load modules under windows,
and we can start debugging more interesting problems related
to the load order and functionality of modules.
Joshua Colp [Tue, 20 Nov 2007 15:00:41 +0000 (15:00 +0000)]
Minor documentation tweak and if an incorrect parameter is given to core show translation return the usage information.
(closes issue #11316)
Reported by: eliel
Patches:
translate.c.patch uploaded by eliel (license 64)
Mark Michelson [Mon, 19 Nov 2007 23:24:35 +0000 (23:24 +0000)]
Changed the "busy-level" option in sip.conf to "busylevel" to be more parallel
with the SIPPEER() argument of the same name. The deprecation procedure is not
being used here since this is a trunk-only option.
(closes issue #11307, reported by pj, patched by me)
Steve Murphy [Mon, 19 Nov 2007 22:55:38 +0000 (22:55 +0000)]
These changes were made in response to niklas@tese.se's letter of 11-17-2007, where he had 20 and 201 in two different contexts, included in the same context. In that particular case, we were behaving the same as 1.4, but after experimenting, I quickly found that if 20 and 201 were in the same extension, 1.4 would return 201, and this code returns 20. These changes now enable the current code to replicate the behavior of 1.4 in respect to MATCHMORE in cases like this.
Tilghman Lesher [Mon, 19 Nov 2007 20:13:40 +0000 (20:13 +0000)]
Change delimiter of SIPPEER to be comma (instead of pipe) and further deprecate the old ':' delimiter
Reported by: pj
Patch by: tilghman
Closes issue #11305
Luigi Rizzo [Mon, 19 Nov 2007 19:36:32 +0000 (19:36 +0000)]
move the declaration of struct ast_channel ast_frame and ast_module
to compat.h so it is always available - hopefully this will let
us reduce the number of inclusions of channel.h and frame.h
Print out the correct filename (features.conf) in the log message when parkpos options are incorrect.
(closes issue #11295)
Reported by: Laureano
Patches:
res_features.c.patch uploaded by Laureano (license 265)
Clarify documentation a bit, include that a frame has to pass through the core in order for the Local channel optimization to happen.
(closes issue #11246)
Reported by: jon
Olle Johansson [Mon, 19 Nov 2007 08:34:26 +0000 (08:34 +0000)]
Make some notes about a problem I found with the OPTIONs handler while working with
the bug tracker. Since we don't authenticate devices (peers/users) on OPTIONS we don't
have the proper context set for the user/peer.
However, we might not want to process an authentication for every OPTIONS, so we could
have a config option for this, "optionsforceok" to always answer 200 OK on the request
and not check device or destination, nor add a SDP. If Asterisk sends the OPTIONs request,
it doesn't care about the reply. Some devices use OPTIONs to discover capabilities,
since we should answer like an INVITE from the device and we need to support that properly
too, which we don't today.
Joshua Colp [Sun, 18 Nov 2007 17:01:41 +0000 (17:01 +0000)]
Change how we handle alloca to conform with how it is suggested in the autoconf manual for AC_FUNC_ALLOCA. FreeBSD 6 now builds again and no other platforms should be broken by this.
Joshua Colp [Sat, 17 Nov 2007 23:03:16 +0000 (23:03 +0000)]
Use autoconf logic to determine the presence of PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP and PTHREAD_MUTEX_RECURSIVE_NP. Enclose error message from network.h in "
Steve Murphy [Sat, 17 Nov 2007 17:46:36 +0000 (17:46 +0000)]
a quick fix to pbx_dundi.c to make it so it will compile. Hope I did the right thing. And some additions to removal of extens to take care of hashtab pointers in all cases.
Luigi Rizzo [Sat, 17 Nov 2007 17:27:26 +0000 (17:27 +0000)]
as discussed some time ago on the -dev list, create embedde object
with a .eo suffix even if they are coming from .cc sources.
This simplifies the handling in the build scripts.