ensure that components of chan_misdn.so are built using any special build options that the configure script generated (reported by Philipp Kempgen on asterisk-dev)
Tilghman Lesher [Mon, 4 Feb 2008 21:06:09 +0000 (21:06 +0000)]
Cross-platform fix: OS X now deprecates the use of the daemon(3) API.
(closes issue #11908)
Reported by: oej
Patches:
20080204__bug11908.diff.txt uploaded by Corydon76 (license 14)
Tested by: Corydon76
Russell Bryant [Fri, 1 Feb 2008 23:06:32 +0000 (23:06 +0000)]
Change the SDP_SAMPLE_RATE macro. It turns out that even though G.722 is 16 kHz,
it is supposed to specified as 8 kHz in the RTP, and RTP timestamps are supposed
to be calculated based on 8 kHz. (Apparently this is due to a bug in a spec, but
people follow it anyway, because it's the spec ...)
Tilghman Lesher [Fri, 1 Feb 2008 21:54:28 +0000 (21:54 +0000)]
Fix the VM_DUR variable for forwarded voicemail, and fixed several other bugs
while I'm in the area.
(closes issue #11615)
Reported by: jamessan
Patches:
20071226__bug11615__2.diff.txt uploaded by Corydon76 (license 14)
Tested by: Corydon76, jamessan
Jason Parker [Fri, 1 Feb 2008 17:41:40 +0000 (17:41 +0000)]
Remove a needless (and incorrect) call to feof() after fgets().
This would have exited the loop early if you had an authentication file with no newline at the end.
Russell Bryant [Fri, 1 Feb 2008 17:23:47 +0000 (17:23 +0000)]
Don't overwrite the last character of a line if it's not a newline. This would
happen if the last line in the file doesn't have a newline.
(pointed out by Qwell)
Russell Bryant [Fri, 1 Feb 2008 00:32:49 +0000 (00:32 +0000)]
Add some more sanity checking on IAX2 dial strings for the case that no peer
or hostname was provided, which is the one part of the dial string that is
absolutely required. If it's not there, bail out.
(closes issue #11897)
Reported by sokhapkin
Patch by me
Russell Bryant [Thu, 31 Jan 2008 23:10:06 +0000 (23:10 +0000)]
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
Mark Michelson [Thu, 31 Jan 2008 21:00:24 +0000 (21:00 +0000)]
1. Prevent the addition of an extra '/' to the beginning of an absolute pathname.
2. If ast_monitor_change_fname is called and the new filename is the same as the old, then exit early and don't set the
filename_changed field in the monitor structure. Setting it in this case was causing ast_monitor_stop to erroneously
delete them.
Joshua Colp [Wed, 30 Jan 2008 15:41:04 +0000 (15:41 +0000)]
Fix an issue where if a frame of higher sample size preceeded a frame of lower sample size and ast_slinfactory_read was called with a sample size of the combined values or higher a crash would happen.
(closes issue #11878)
Reported by: stuarth
Jason Parker [Wed, 30 Jan 2008 15:34:37 +0000 (15:34 +0000)]
Change default config to use descending channel order of groups, rather than ascending.
Fixes a potential source of confusion in glare-type situations.
Mark Michelson [Wed, 30 Jan 2008 15:23:00 +0000 (15:23 +0000)]
Fix a logic error with regards to autofill. Prior to this change, it was possible
for a caller to go out of turn if autofill were enabled and callers ahead in the queue were attempting
to call a member. This change fixes this.
Russell Bryant [Mon, 28 Jan 2008 17:15:41 +0000 (17:15 +0000)]
Make some deadlock related fixes. These bugs were discovered and reported
internally at Digium by Steve Pitts.
- Fix up chan_local to ensure that the channel lock is held before the local
pvt lock.
- Don't hold the channel lock when executing the timing function, as it can
cause a deadlock when using chan_local. This actually changes the code back
to be how it was before the change for issue #10765. But, I added some other
locking that I think will prevent the problem reported there, as well.
Tilghman Lesher [Sun, 27 Jan 2008 21:59:53 +0000 (21:59 +0000)]
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`
Kevin P. Fleming [Thu, 24 Jan 2008 21:57:41 +0000 (21:57 +0000)]
make these macros not assume that the only other field in the structure is 'argc'... this is true when someone uses AST_DECLARE_APP_ARGS, but it's perfectly reasonable to define your own structure as long as it has the right fields
Russell Bryant [Wed, 23 Jan 2008 17:46:55 +0000 (17:46 +0000)]
ChanSpy issues a beep when it starts at the beginning of a list of channels to
potentially spy on. However, if there were no matching channels, it would beep
at you over and over, which is pretty annoying. Now, it will only beep once in
the case that there are no channels to spy on, but it will still beep again once
it reaches the beginning of the channel list again.
Tilghman Lesher [Wed, 23 Jan 2008 04:31:51 +0000 (04:31 +0000)]
When we reset the password via an external command, we should also reset the
password stored in the in-memory list, too (otherwise it doesn't really take
effect).
(closes issue #11809)
Reported by: davetroy
Patches:
fix_externpass.diff uploaded by davetroy (license 384)
Olle Johansson [Tue, 22 Jan 2008 20:56:09 +0000 (20:56 +0000)]
Thanks to Russell's education I realize that BUFSIZ has changed since I learned the C language
over 20 years ago... Resetting chan_sip to the size of BUFSIZ that I expected in my old
head to avoid to heavy memory allocations on some systems.
Tilghman Lesher [Tue, 22 Jan 2008 16:54:06 +0000 (16:54 +0000)]
Ensure that we can get an address even when we don't have a default route.
(closes issue #9225)
Reported by: junky
Patches:
20080122__bug9225.diff.txt uploaded by Corydon76 (license 14)
Tested by: oej, loloski, sergee
Mark Michelson [Mon, 21 Jan 2008 23:55:26 +0000 (23:55 +0000)]
Fixing an issue wherein monitoring local channels was not possible. During a channel
masquerade, the monitors on the two channels involved are swapped. In 99% of the cases
this results in the desired effect. However, if monitoring a local channel, this caused
the monitor which was on the local channel to get moved onto a channel which is immediately
hung up after the masquerade has completed. By swapping the monitors prior to the masquerade,
we avoid the problem by tricking the masquerade into placing the monitor back onto the channel
where we want it.
During the investigation of the issue, the channel's monitor was the only thing that was swapped
in such a manner which did not make sense to have done. All other variable swapping made sense.
Tilghman Lesher [Mon, 21 Jan 2008 18:11:07 +0000 (18:11 +0000)]
Permit the user to specify number of seconds that a connection may remain idle,
which fixes a crash on reconnect with the MyODBC driver.
(closes issue #11798)
Reported by: Corydon76
Patches:
20080119__res_odbc__idlecheck.diff.txt uploaded by Corydon76 (license 14)
Tested by: mvanbaak
Russell Bryant [Sat, 19 Jan 2008 10:05:27 +0000 (10:05 +0000)]
Fix a couple of memory leaks with frame handling. Specifically,
ast_frame_free() needed to be called on the frame that came from the translator
to signed linear.
Russell Bryant [Fri, 18 Jan 2008 21:37:21 +0000 (21:37 +0000)]
Revert adding the packed attribute, as it really doesn't make sense why that
would do any good. Fix the real bug, which is to do the check to see if the
frame came from a translator at the beginning of ast_frame_free(), instead of
at the end. This ensures that it always gets checked, even if none of the
parts of the frame are malloc'd, and also ensures that we aren't looking at
free'd memory in the case that it is a malloc'd frame.
(closes issue #11792, reported by explidous, patched by me)
Russell Bryant [Fri, 18 Jan 2008 21:22:21 +0000 (21:22 +0000)]
Since we're relying on the offset between the frame and the beginning of the translator
pvt struct, set the packed attribute to make sure we get to the right place.
(potential fix for issue #11792)
Terry Wilson [Fri, 18 Jan 2008 17:13:00 +0000 (17:13 +0000)]
This should at least temporarily fix a problem where the 't' Dial
option is incorrectly passed to the transferee when built-in
attended transfers are used. There is still a problem with 'T',
but better to fix some problems than no problems while we work
on it.
Russell Bryant [Thu, 17 Jan 2008 22:37:22 +0000 (22:37 +0000)]
Have IAX2 optimize the codec translation path just like chan_sip does it. If
the caller's codec is in our codec list, move it to the top to avoid transcoding.
Kevin P. Fleming [Thu, 17 Jan 2008 21:31:56 +0000 (21:31 +0000)]
we should only send the Set-Cookie header to the browser on the first response after creating a manager session, not on every response (doing so causes the browser to clear any local cookies it may have associated with the session)
Russell Bryant [Wed, 16 Jan 2008 22:36:24 +0000 (22:36 +0000)]
Add an unused pointer to the ast_channel struct. This makes the ast_channel structure
retain the same size as it had in previous 1.4 releases. Also, all of the offsets for
members in the structure are still the same (except for the two pointers that got replaced
for the new spy/whisper architecture.)
Mark Michelson [Wed, 16 Jan 2008 17:20:11 +0000 (17:20 +0000)]
Fix a deadlock in chan_local in local_hangup. There was contention because
the local_pvt was held and it was attempting to lock a channel, which is the
incorrect locking order.
Joshua Colp [Wed, 16 Jan 2008 15:08:24 +0000 (15:08 +0000)]
Introduce a lock into the dialing API that protects it when destroying the structure.
(closes issue #11687)
Reported by: callguy
Patches:
11687.diff uploaded by file (license 11)
Joshua Colp [Wed, 16 Jan 2008 03:07:24 +0000 (03:07 +0000)]
Don't drop the old record route information when dealing with packets related to a reinvite.
(closes issue #11545)
Reported by: kebl0155
Patches:
reinvite-patch.txt uploaded by kebl0155 (license 356)
Joshua Colp [Wed, 16 Jan 2008 01:13:27 +0000 (01:13 +0000)]
Add autoconf logic for speexdsp. Later versions use a separate library for some things so we need to use it if present in codec_speex.
(closes issue #11693)
Reported by: yzg
Russell Bryant [Tue, 15 Jan 2008 23:50:10 +0000 (23:50 +0000)]
Change a buffer in check_auth() to be a thread local dynamically allocated
buffer, instead of a massive buffer on the stack. This fixes a crash reported
by Qwell due to running out of stack space when building with LOW_MEMORY defined.
On a very related note, the usage of BUFSIZ in various places in chan_sip is
arbitrary and careless. BUFSIZ is a system specific define. On my machine,
it is 8192, but by definition (according to google) could be as small as 256.
So, this buffer in check_auth was 16 kB. We don't even support SIP messages
larger than 4 kB! Further usage of this define should be avoided, unless it
is used in the proper context.
Russell Bryant [Tue, 15 Jan 2008 23:26:52 +0000 (23:26 +0000)]
Commit a fix for some memory access errors pointed out by the valgrind2.txt
output on issue #11698.
The issue here is that it is possible for an instance of a translator to get
destroyed while the frame allocated as a part of the translator is still being
processed. Specifically, this is possible anywhere between a call to ast_read()
and ast_frame_free(), which is _a lot_ of places in the code. The reason this
happens is that the channel might get masqueraded during this time. During a
masquerade, existing translation paths get destroyed.
So, this patch fixes the issue in an API and ABI compatible way. (This one is
for you, paravoid!)
It changes an int in ast_frame to be used as flag bits. The 1 bit is still used
to indicate that the frame contains timing information. Also, a second flag has
been added to indicate that the frame came from a translator. When a frame with
this flag gets released and has this flag, a function is called in translate.c to
let it know that this frame is doing being processed. At this point, the flag gets
cleared. Also, if the translator was requested to be destroyed while its internal
frame still had this flag set, its destruction has been deffered until it finds out
that the frame is no longer being processed.
Admittedly, this feels like a hack. But, it does fix the issue, and I was not able
to think of a better solution ...