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.
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)
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 02:30:13 +0000 (02:30 +0000)]
Remove DNS lookup from sip_devicestate. This seems to come from way back when and I can't think of a reason for it being here, plus it could cause needless DNS lookups.
(closes issue #10983)
Reported by: jtodd
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:53:28 +0000 (23:53 +0000)]
Merged revisions 98946 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r98946 | russell | 2008-01-15 17:50:10 -0600 (Tue, 15 Jan 2008) | 11 lines
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:31:53 +0000 (23:31 +0000)]
Merged revisions 98943 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r98943 | russell | 2008-01-15 17:26:52 -0600 (Tue, 15 Jan 2008) | 25 lines
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 ...
Mark Michelson [Mon, 14 Jan 2008 22:11:50 +0000 (22:11 +0000)]
Big improvement for app_directory. This patch breaks the do_directory function up
so that it is more easily parsed by the human brain. It also fixes some errors. I'll quote
dimas from the original bug description:
"app_directory contained some duplicate code even before addition of 'm' option. Addition of that option doubled amount of that code. Worst of all, there are minor differences between these code block and bugs caused by these differences.
1. There is a memory leak. In the 'menu' mode, result of the convert(pos) function is not freed while it should be.
2. In the 'menu' mode check for OPT_LISTBYFIRSTNAME flag ('f' option) is not negated as result, application works in the mode opposite to what user expect (checking last name when user wants the first nd vice versa).
3. select_item function plays message for user using res = func1() || func2() || func3()... construct. This construct loses the actual value returned by ast_waitstream() for example so at the end, res does not contain digit user dialed while listening to the message.
4. (also in 1.4) application announces entries from voicemail.conf/realtime separately from entries from users.conf. I see no reason why doing so instead of building combined list.
5. Alot of duplicated code as already mentioned."
This was tested by dimas and I (I tested under valgrind). A word of caution: any bug fixes that happen
in app_directory in 1.4 will almost certainly not merge cleanly into trunk as a result of this, but it is
well worth it.
Huge thanks to dimas for this wonderful submission.
Jason Parker [Mon, 14 Jan 2008 17:40:36 +0000 (17:40 +0000)]
Add proper call forwarding (all and busy) support for chan_skinny.
Note: NoAnswer support is currently not implemented, as it would take a
significant amount of work to figure out how to do correctly.
Closes issue #11310, patches, testing, and support by DEA, mvanbaak, and myself.
Adding explicit defaults for missing options to init_queue. This is necessary because
if a user either removes or comments one of these options and reloads their queues, the
option will not reset to its default, instead maintaining the value from prior to the
reload.
Thanks to John Bigelow for pointing this error out to me.
Joshua Colp [Mon, 14 Jan 2008 15:07:30 +0000 (15:07 +0000)]
Print out a warning when spaces are used in the variable name in Set and MSet. It is extremely hard to debug this issue so this should make it easier.
(closes issue #11759)
Reported by: caio1982
Patches:
setvar_space_warning1.diff uploaded by caio1982 (license 22)
Russell Bryant [Mon, 14 Jan 2008 04:53:08 +0000 (04:53 +0000)]
Add another small option for the JACK app and JACK_HOOK function. The 'n'
option tells JACK not to start jackd automatically if it is not already
running. Otherwise, the default is that jackd will get started for you if
it isn't running already.
Russell Bryant [Sun, 13 Jan 2008 19:19:57 +0000 (19:19 +0000)]
Bring in the code from team/russell/jack/.
Add a new module, app_jack, which provides interfaces to JACK, the Jack
Audio Connection Kit (http://www.jackaudio.org/). Two interfaces are
provided; there is a JACK() application, and a JACK_HOOK() function. Both
interfaces create an input and output JACK port. The application makes
these ports the endpoint of the call. The audio coming from the channel
goes out the output port and whatever comes back in on the input port is
what gets sent to the channel. The JACK_HOOK() function turns on a JACK
audiohook on the channel. This lets you run the audio coming from a
channel through JACK, and whatever comes back in is what gets forwarded
on as the channel's audio. This is very useful for building custom
vocoders or doing recording or analysis of the channel's audio in another
application.
In case anyone is curious, the platform that inspired me to write this is
PureData (http://puredata.info/). I wrote these JACK interfaces so that I
could use Pd to do interesting things with the audio of phone calls ...
Russell Bryant [Sun, 13 Jan 2008 00:10:00 +0000 (00:10 +0000)]
Remove a duplicate lock of the audiohook lock when destroying manipulate
audiohooks. This causes an error when we attempt to destroy the lock later
when freeing the audiohook.
Add a connection timeout attribute, as that was what was intended with the
login timeout, but ODBC divides it up into 2 different timeouts.
(Closes issue #11745)
If the incoming RTP stream changes codec force the bridge to break if the other side does not support it.
(closes issue #11729)
Reported by: tsearle
Patches:
new_codec_patch_udiff.patch uploaded by tsearle (license 373)
If the channel is hungup during RECORD FILE send a result code of -1 to be uniform with everything else.
(closes issue #11743)
Reported by: davevg
Patches:
res_agi.diff uploaded by davevg (license 209)
Russell Bryant [Fri, 11 Jan 2008 19:05:24 +0000 (19:05 +0000)]
Kevin noted that the thing that I _actually_ changed here was that I converted
a value from a double, to a float, back to a double. Sure enough, when I changed
my interim variable back to a double, it still blows up. Switching all of these
to a float fixes the problem. This seems like a compiler bug where a double passed
as an argument isn't getting properly aligned, so I'll have to see if I can replicate
it with a small test program.
Russell Bryant [Fri, 11 Jan 2008 18:48:07 +0000 (18:48 +0000)]
Fix a bus error that happened when asterisk was built with optimizations on
with platforms that explode on unaligned access. I'm not exactly sure why
this fixes it, but it fixed it on the machine I was testing on. If it makes
sense to you, feel free to enlighten me. :)
Russell Bryant [Fri, 11 Jan 2008 18:26:32 +0000 (18:26 +0000)]
Blocked revisions 98265 via svnmerge
........
r98265 | russell | 2008-01-11 12:25:30 -0600 (Fri, 11 Jan 2008) | 11 lines
Backport the ability to set the ToS bits on Linux when not running as root.
Normally, we would not backport features into 1.4, but, I was convinced by the
justification supplied by the supplier of this patch. He pointed out that this
patch removes a requirement for running as root, thus reducing the potential
impacts of security issues.
Ensure the return value of ast_bridge_call is passed back up as the application return value. This is needed for transfers to function so the PBX core knows to continue execution.
(closes issue #10327)
Reported by: kkiely
Russell Bryant [Fri, 11 Jan 2008 17:17:54 +0000 (17:17 +0000)]
At one point during working on this module, I had the lin/lin16 versions of the
framein callbacks different. However, they are now the same again, so remove
the duplicate code and use the same functions for the lin/lin16 versions.
Russell Bryant [Fri, 11 Jan 2008 03:37:19 +0000 (03:37 +0000)]
- Fix the last set of places where incorrect assumptions were made about the
sample length with g722. It is _2_ samples per byte, not 1. This was all
over the place, and I believed it, and it is what caused me to take so long
to figure out what was broken.
- Update copyright information on codec_g722.
Mark Michelson [Fri, 11 Jan 2008 00:54:54 +0000 (00:54 +0000)]
Fix "core show translation" to not output information for "unknown" codecs.
This fix was made in favor of the proposed patch since it doesn't involve changing
a core codec define.
(closes issue #11722, reported and initially patched by caio1982, final patch by me)
1) When we get a translated frame out, clone it, because if the
translator pvt is freed before we use the frame, bad things happen.
2) Getting a failure from ast_sched_delete means that the schedule
ID is currently running. Don't just ignore it.
(Closes issue #11698)
Russell Bryant [Thu, 10 Jan 2008 23:16:09 +0000 (23:16 +0000)]
Fix various issues in codec_g722.
- The most common fix being made here is to fix all of the places where the
number of output samples and output bytes gets updated in the translator
state structure.
- Fix a number of other places where the number of samples provided as an
initialization value to a struct was incorrect.
Steve Murphy [Thu, 10 Jan 2008 21:46:56 +0000 (21:46 +0000)]
Merged revisions 97889 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r97889 | murf | 2008-01-10 14:37:10 -0700 (Thu, 10 Jan 2008) | 1 line
Applied the same fixes for ael.flex as was done in 97849 for ast_expr2.fl; overrode the normally generate yyfree func with our own version that checks the pointer for non-null before passing to free(). Also takes care of a little problem with 2.5.33 and the use of the __STDC_VERSION__ macro.
........
Steve Murphy [Thu, 10 Jan 2008 20:45:05 +0000 (20:45 +0000)]
Merged revisions 97849 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r97849 | murf | 2008-01-10 13:21:27 -0700 (Thu, 10 Jan 2008) | 1 line
This is a fix for 2 things: a problem Terry was having in OSX with null pointers, which was my fault, as I probably forgot to run the sed script last time I made mods. So, I moved the fix into the flex input itself. Then, I found when I used flex 2.5.33, that it was using __STDC_VERSION__, and that's not real good; so I added back in a DIFFERENT sed script to fix that little mess. Tested everything, a couple different ways. Hope I did no harm, at the least.
........
Russell Bryant [Thu, 10 Jan 2008 16:27:03 +0000 (16:27 +0000)]
Use AST_EXT_TOOL_CHECK() for the GTK check again. I changed this to an inline
implementation to fix a small bug, but after a discussion with rizzo, I went to
change it back. Also, it turns out that the implementation of the macro already
supported what was needed to fix the problem.
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)
Steve Murphy [Thu, 10 Jan 2008 00:50:39 +0000 (00:50 +0000)]
The fixes in this commit are mainly to allow compiling of trunk with --enable-dev-mode, mutex profiling, lock debugging, etc. Mainly, the version.c needs to be in the OBJS line; asterisk.h was chosen to have the prototypes for ast_get_version, ast_get_version_num; and the ASTERISK_FILE_VERSION macro needs to be used after including asterisk.h in a few files. I hope I did the right thing. If not, let me know.
Tilghman Lesher [Thu, 10 Jan 2008 00:12:35 +0000 (00:12 +0000)]
Several manager changes:
1) Add the Dialplan class, for NewExten and VarSet events, which should cut
down on the volume of traffic in the Call class.
2) Permit some commands to be run from multiple classes, such as allowing
DBGet to be run from either the System or the Reporting class.
3) Heavily document each class in the sample config, as there were several
that made no sense to be in the write= line, and two that made no sense to be
in the read= line (since they controlled no permissions there).
Terry Wilson [Wed, 9 Jan 2008 21:37:26 +0000 (21:37 +0000)]
Added a new module, res_phoneprov, which allows auto-provisioning of phones
based on configuration templates that use Asterisk dialplan function and
variable substitution. It should be possible to create phone profiles and
templates that work for the majority of phones provisioned over http. It
is currently only intended to provision a single user account per phone.
An example profile and set of templates for Polycom phones is provided.
NOTE: Polycom firmware is not included, but should be placed in
AST_DATA_DIR/phoneprov/configs to match up with the included templates.