Joshua Colp [Thu, 10 Jan 2008 15:07:12 +0000 (15:07 +0000)]
Don't try to copy the category from the group if no category exists.
(closes issue #11724)
Reported by: IgorG
Patches:
group_count.v1.patch uploaded by IgorG (license 20)
Philippe Sultan [Wed, 9 Jan 2008 16:44:24 +0000 (16:44 +0000)]
Set the caller id within the gtalk_alloc function.
As underlined in issue #10437 by Josh, we need to prevent a possible
memory leak. We only set the name part of the caller id, the number
part is not relevant when dealing with JIDs.
Joshua Colp [Wed, 9 Jan 2008 16:11:17 +0000 (16:11 +0000)]
Don't do conferencing totally in Zaptel if Monitor is running on the channel.
(closes issue #11709)
Reported by: BigJimmy
Patches:
patch-meetmerec uploaded by BigJimmy (license 371)
Tilghman Lesher [Wed, 9 Jan 2008 00:44:14 +0000 (00:44 +0000)]
Allow filename completion on zero-length modules, remove a memory leak, remove
a file descriptor leak, and make filename completion thread-safe.
Patched and tested by tilghman.
(Closes issue #11681)
Mark Michelson [Tue, 8 Jan 2008 23:49:11 +0000 (23:49 +0000)]
Part 1 of N of adding doxygen comments to app_queue. I picked some of the most common functions
used (which also happen to be some the biggest/ugliest functions too) to document first. I'm pretty
new to doxygen so criticism is welcome.
Mark Michelson [Tue, 8 Jan 2008 20:42:07 +0000 (20:42 +0000)]
Making some changes designed to not allow for a corrupted mailstream for a vm_state.
1. Add locking to the vm_state retrieval functions so that no linked list corruption occurs.
2. Make sure to always grab the persistent vm_state when mailstream access is necessary.
3. Correct an incorrect return value in the init_mailstream function.
Joshua Colp [Tue, 8 Jan 2008 19:53:52 +0000 (19:53 +0000)]
If no group has been provided to the GROUP_COUNT dialplan function then use the first one specific to the channel.
(closes issue #11077)
Reported by: m4him
Tilghman Lesher [Fri, 4 Jan 2008 23:03:40 +0000 (23:03 +0000)]
Fix the problem of notification of a device state change to a device with a '-'
in the name. Could probably do with a better fix in trunk, but this bug has
been open way too long without a better solution.
Reported by: stevedavies
Patch by: tilghman
(Closes issue #9668)
Mark Michelson [Wed, 2 Jan 2008 23:46:02 +0000 (23:46 +0000)]
We need to reset the membername to NULL on each iteration of this loop, otherwise the result is that
multiple members can have the same name, since the variable was not reset on each iteration of the loop.
Joshua Colp [Wed, 2 Jan 2008 20:24:09 +0000 (20:24 +0000)]
Allocate a SIP refer structure when performing a transfer using BYE with Also so that the transfer information is properly stored. (AST-2008-001)
(closes issue #11637)
Reported by: greyvoip
Mark Michelson [Wed, 2 Jan 2008 17:51:22 +0000 (17:51 +0000)]
A change to improve the accuracy of queue logging in the case where a member does not
answer during the specified timeout period. Prior to this change, there was a small chance
that the member name recorded in this case would be blank. Also prior to this change, if using
the ringall strategy, if no one answered the call during the specified timeout, the member name
listed in the queue log would randomly be one of the members that was rung.
(closes issue #11498, reported and tested by hloubser, patched by me)
Mark Michelson [Mon, 31 Dec 2007 23:43:13 +0000 (23:43 +0000)]
Avoiding a potentially bad locking situation. ast_merge_contexts_and_delete writelocks the conlock, then
calls ast_hint_extension, which attempts to readlock the same lock. Recursion with read-write locks is
dangerous, so the inner lock needs to be removed. I did this by copying the "guts" of ast_hint_extension
into ast_merge_contexts_and_delete (sans the extra lock).
(this change is inspired by the locking problems seen in issue #11080, but I have no idea if this is the
problematic area experienced by the reporters of that issue)
Mark Michelson [Fri, 28 Dec 2007 00:16:15 +0000 (00:16 +0000)]
I found a bug while browsing the queue code and managed to reproduce it in a small setup.
If a queue uses the ringall strategy, it was possible through unfortunate coincidence for a single member at a given penalty level to
make app_queue think that all members at that penalty level were unavailable and cause the members at the
next penalty level to be rung. With this patch, we will only move to the next penalty level if ALL the members
at a given penalty level are unreachable.
Joshua Colp [Thu, 27 Dec 2007 17:32:15 +0000 (17:32 +0000)]
Include types.h in chan_h323 as without it it can not be compiled on some operating systems like FreeBSD to name one.
(closes issue #11585)
Reported by: sobomax
Patches:
chan_h323.c.diff uploaded by sobomax (license 359)
Joshua Colp [Thu, 27 Dec 2007 17:27:11 +0000 (17:27 +0000)]
Use ast_strlen_zero to see if our_contact is set or not on the dialog. It is possible for it to be a pointer to NULL.
(closes issue #11557)
Reported by: FuriousGeorge
Russell Bryant [Thu, 27 Dec 2007 15:16:56 +0000 (15:16 +0000)]
Now that the contexts lock is a read/write lock, it should not be locked here
in ast_hint_state_changed(). This makes it get locked recursively which now
causes a deadlock.
(closes issue #11080, thanks to callguy for the access to a deadlocked machine)
Russell Bryant [Thu, 27 Dec 2007 14:33:21 +0000 (14:33 +0000)]
Change ast_translator_best_choice() to only pay attention to audio formats.
This fixes a problem where Asterisk claims that a translation path can not be
found for channels involving video.
(closes issue #11638)
Reported by: cwhuang
Tested by: cwhuang
Patch suggested by cwhuang, with some additional changes by me.
Tilghman Lesher [Wed, 26 Dec 2007 20:43:38 +0000 (20:43 +0000)]
Workaround for what is probably a glibc bug (but we'll see this crop up again
and again, if we don't add the workaround).
Reported by: rolek
Patch by: tilghman
(Closes issue #11601, closes issue #11426)
Russell Bryant [Wed, 26 Dec 2007 19:04:31 +0000 (19:04 +0000)]
Just in case the AST_FLAG_END_DTMF_ONLY flag was already set before starting
autoservice, remember it and ensure that the channel has the same setting when
autoservice gets stopped. (pointed out by d1mas, patched up by me)
Russell Bryant [Wed, 26 Dec 2007 18:46:39 +0000 (18:46 +0000)]
When a channel is in autoservice, mark a flag on the channel that says that
we only care about the END of a digit. That way, no magic digit emulation stuff
will happen when all we're doing is queueing up END frames.
Russell Bryant [Wed, 26 Dec 2007 17:06:26 +0000 (17:06 +0000)]
Don't store DTMF BEGIN frames while a channel is in autoservice. It's just
going to make ast_read() do a lot of extra work when the channel comes back
out of autoservice.
(closes issue #11628, patched by me)
Russell Bryant [Wed, 26 Dec 2007 17:00:03 +0000 (17:00 +0000)]
List include/asterisk/version.h as a .PHONY target because we want the commands
listed for this target to be executed regardless of whether the file exists or
not. This fixes having the version not up to date when running from svn.
(closes issue #11619, reported by plack, fixed by me)
Tilghman Lesher [Mon, 24 Dec 2007 19:36:59 +0000 (19:36 +0000)]
Race: we need to wait to queue a NewChannel event until after the channel is
inserted into the channel list. The reason is because some manager users
immediately queue requests from the channel when they see that event and are
confused when Asterisk reports no such channel. (Closes issue #11632)
Russell Bryant [Thu, 20 Dec 2007 20:08:42 +0000 (20:08 +0000)]
Fix a deadlock in d-channel handling in chan_zap.
This deadlock was introduced by the fix to ensure that channels are properly
locked when handling channel variables. There were sections of this code where
the channel pvt was locked before the channel lock, when in fact it _must_ be
the other way around.
Mark Michelson [Tue, 18 Dec 2007 17:02:48 +0000 (17:02 +0000)]
Rework deadlock avoidance used in ast_write, since it meant that agent channels which were being monitored
had one audio file recorded and one empty audio file saved.
(closes issue #11529, reported by atis patched by me)
Joshua Colp [Mon, 17 Dec 2007 22:28:09 +0000 (22:28 +0000)]
Do not try to access information about a lock when printing out a trylock attempt. It is possible for the lock that it references to no longer be valid. This would have caused segfaults or deadlocks.
(issue #BE-263)
(closes issue #11080)
Reported by: callguy
(closes issue #11100)
Reported by: callguy
Tilghman Lesher [Mon, 17 Dec 2007 21:12:42 +0000 (21:12 +0000)]
Today is tomorrow's yesterday, and yesterday's tomorrow is today, and
tomorrow's tomorrow is the day after tomorrow, so who cares if you
recycle anyway?
If this confuses you, that's nothing compared to what this fixes. ;-)
Joshua Colp [Mon, 17 Dec 2007 18:05:55 +0000 (18:05 +0000)]
If a call is received with a called number IE containing nothing go to the 's' extension.
(closes issue #9099)
Reported by: kb1_kanobe2
Patches:
20070906__9099.diff.txt uploaded by Corydon76 (license 14)
Kevin P. Fleming [Mon, 17 Dec 2007 06:44:51 +0000 (06:44 +0000)]
In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html,
rizzo brought up some issues related to the way that the metadata required
for menuselect and the rest of the build system is extracted from the source
files. Since I had a few hours to kill on an airplane today, I decided to
improve this situation... so now the system caches the extracted metadata
and uses it to build the menuselect 'tree' as much as it can. The result
of this is that when a single source file is changed, only the metadata for
that file needs to be extracted again, and the rest is used from the cache
files. I also reduced the number of forked processes required to do the
metadata extraction; it was actually possible to do most of what we needed
in the Makefiles themselves without using any shell scripts at all! On my
laptop, these changes resulted in an 80% decrease in the time required
for the 'menuselect.makeopts' automatic check to occur after editing a single
source file.
While doing this work I also cleaned up a few minor things in the Makefiles,
adding a check for 'awk' to the configure script and changed all remaining
places we use 'grep' or 'awk' to use the ones found by the configure script,
and changed the 'prep_tarball' script to build the menuselect metadata so
that tarballs of Asterisk will include it and won't require the user to
wait while it is extracted after unpacking.
Russell Bryant [Fri, 14 Dec 2007 17:36:08 +0000 (17:36 +0000)]
There are a lot of existing systems that #include non-existent files. So, to
make the transition to treating this as an error a bit less painless, just issue
a huge error message for now. Then, later, we can reinstate the code that treats
it as a failure.
Mark Michelson [Fri, 14 Dec 2007 01:24:06 +0000 (01:24 +0000)]
When compiling with DETECT_DEADLOCKS, don't spam the CLI with messages
about possible deadlocks. Instead just print the intended single message every
five seconds.
(closes issue 11537, reported and patched by dimas)