]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
10 years agocontrib/editors: Fix vim syntax highlighting of comments in config files 97/397/1
Ivan Poddubny [Mon, 4 May 2015 19:43:20 +0000 (19:43 +0000)] 
contrib/editors: Fix vim syntax highlighting of comments in config files

 * Added a lookbehind to one-line comment matcher to skip escaped
   semicolons.
 * Added support for block comments.

Change-Id: Id17dfaeda8ed4be572e8107a0c010066584aaee7

10 years agochan_dahdi: Improve force_restart_unavailable_chans option description. 84/384/1
Richard Mudgett [Wed, 6 May 2015 21:00:40 +0000 (16:00 -0500)] 
chan_dahdi: Improve force_restart_unavailable_chans option description.

ASTERISK-25034
Reported by: Richard Mudgett

Change-Id: I1ff8f02124d2f4abd632a050da52c64285bb7f30

10 years agoapp_queue: Fix queue_log EXITWITHTIMEOUT containing only 1 parameter 68/368/1
Ivan Poddubny [Tue, 5 May 2015 19:48:36 +0000 (19:48 +0000)] 
app_queue: Fix queue_log EXITWITHTIMEOUT containing only 1 parameter

This patch fixes EXITWITHTIMEOUT queue_log entry to always come with 3
parameters: position, original position and waiting time.

ASTERISK-25038 #close
Reported by: Etienne Lessard

Change-Id: I0c62045922e26bee2125e93aee1dee17eee79618

10 years agoMerge "cdr/cdr_csv.c: Add a new option to enable columns added in Asterisk 1.8" into 11
Matt Jordan [Mon, 4 May 2015 14:25:55 +0000 (09:25 -0500)] 
Merge "cdr/cdr_csv.c: Add a new option to enable columns added in Asterisk 1.8" into 11

10 years agoMerge "res_odbc: Use negative connection cache for all connections" into 11
Matt Jordan [Mon, 4 May 2015 12:46:00 +0000 (07:46 -0500)] 
Merge "res_odbc: Use negative connection cache for all connections" into 11

10 years agores_odbc: Use negative connection cache for all connections 83/183/5
Martin Tomec [Tue, 21 Apr 2015 16:52:22 +0000 (18:52 +0200)] 
res_odbc: Use negative connection cache for all connections

Apply the negative connection cache setting to all connections,
even those that are not pooled. This ensures that the connection
will not be re-established before the negative connection cache
time is met.

ASTERISK-22708 #close

Change-Id: I431cc2e8584ab0b6908b3523d0a0e18c9a527271

10 years agoMerge "Update configure.ac/Makefile for clang" into 11
Matt Jordan [Mon, 4 May 2015 09:03:14 +0000 (04:03 -0500)] 
Merge "Update configure.ac/Makefile for clang" into 11

10 years agoUpdate configure.ac/Makefile for clang 43/343/1
Diederik de Groot [Mon, 20 Apr 2015 18:03:56 +0000 (20:03 +0200)] 
Update configure.ac/Makefile for clang

Created autoconf/ast_check_raii.m4: contains AST_CHECK_RAII which
checks compiler requirements for RAII:
gcc: -fnested-functions support
clang: -fblocks (and if required -lBlocksRuntime)
The original check was implemented in configure.ac and now has it's
own file. This function also sets C_COMPILER_FAMILY to either gcc or
clang for use by makefile

Created autoconf/ast_check_strsep_array_bounds.m4 (contains
AST_CHECK_STRSEP_ARRAY_BOUNDS):
which checks if clang is able to handle the optimized strsep & strcmp
functions (linux). If not, the standard libc implementation should be
used instead. Clang + the optimized macro's work with:
strsep(char *, char []), but not with strsepo(char *, char *).
Instead of replacing all the occurences throughout the source code,
not using the optimized macro version seemed easier

See 'define __strcmp_gc(s1, s2, l2) in bits/string2.h':
llvm-comment: Normally, this array-bounds warning are suppressed for
macros, so that unused paths like the one that accesses __s1[3] are
not warned about.  But if you preprocess manually, and feed the
result to another instance of clang, it will warn about all the
possible forks of this particular if statement. Instead of switching
of this optimization, another solution would be to run the preproces-
sing step with -frewrite-includes, which should preserve enough
information so that clang should still be able to suppress the diag-
nostic at the compile step later on.

See also "https://llvm.org/bugs/show_bug.cgi?id=20144"
See also "https://llvm.org/bugs/show_bug.cgi?id=11536"

Makefile.rules: If C_COMPILER_FAMILY=clang then add two warning
suppressions:
-Wno-unused-value
-Wno-parentheses-equality
In an earlier review (reviewboard: 4550 and 4554), they were deemed a
nuisace and less than benefitial.

configure.ac:
Added AST_CHECK_RAII() see earlier
Added AST_CHECK_STRSEP_ARRAY_BOUNDS() see earlier
Removed moved content

ASTERISK-24917
Change-Id: I12ea29d3bda2254ad3908e279b7effbbac6a97cb
(cherry picked from commit 9c3ed428759a83a2b80106e605fe43dda0569425)

10 years agoMerge "Build System: Prevent unneeded changes to asterisk/buildopts.h." into 11
Matt Jordan [Sun, 3 May 2015 14:20:08 +0000 (09:20 -0500)] 
Merge "Build System: Prevent unneeded changes to asterisk/buildopts.h." into 11

10 years agoMerge "v11: More files to ignore." into 11
Matt Jordan [Sat, 2 May 2015 15:20:16 +0000 (10:20 -0500)] 
Merge "v11: More files to ignore." into 11

10 years agoMerge "main/pbx: Improve performance of dialplan reloads with a large number of hints...
Matt Jordan [Sat, 2 May 2015 15:16:35 +0000 (10:16 -0500)] 
Merge "main/pbx: Improve performance of dialplan reloads with a large number of hints" into 11

10 years agoBuild System: Prevent unneeded changes to asterisk/buildopts.h. 30/330/1
Corey Farrell [Wed, 29 Apr 2015 08:03:00 +0000 (04:03 -0400)] 
Build System: Prevent unneeded changes to asterisk/buildopts.h.

* Add AST_DEVMODE to BUILDOPTS
* Remove CFLAGS that do not effect ABI from BUILDOPTS.
* Use BUILDOPTS to generate AST_BUILDOPT_SUM.
* Remove loop that defined AST_MODULE_*

These changes ensure that only ABI effecting options are considered for
AST_BUILDOPT_SUM.  This also reduces unneeded full system rebuilds caused
by enabling or disabling one module that another is dependent on.

ASTERISK-25028 #close
Reported by: Corey Farrell

Change-Id: I2c516d93df9f6aaa09ae079a8168c887a6ff93a2

10 years agov11: More files to ignore. 27/327/1
Richard Mudgett [Fri, 1 May 2015 17:23:53 +0000 (12:23 -0500)] 
v11: More files to ignore.

Change-Id: If5eef47d03399ff93e3f2f490780144971f6b64a

10 years agomain/pbx: Improve performance of dialplan reloads with a large number of hints 14/314/5
Matt Jordan [Wed, 29 Apr 2015 19:49:23 +0000 (14:49 -0500)] 
main/pbx: Improve performance of dialplan reloads with a large number of hints

The PBX core maintains two hash tables for hints: a container of the
actual hints (hints), along with a container of devices that are watching that
hint (hintdevices). When a dialplan reload occurs, each hint in the hints
container is destroyed; this requires a lookup in the container of devices to
find the device => hint mapping object. In the current code, this performs an
ao2_callback, iterating over each of the device to hint objects in the
hintdevices container. For a large number of hints, this is extremely
expensive: dialplan reloads with 20000 hints could take several minutes
in just this phase.

This patch improves the performance of this step in the dialplan reloads
by caching which devices are watching a hint on the hint object itself.
Since we don't want to create a circular reference, we just cache the
name of the device. This allows us to perform a smarter ao2_callback on
the hintdevices container during hint removal, hashing on the name of the
device and returning an iterator to the matching names. The overall
performance improvement is rather large, taking this step down to a number of
seconds as opposed to minutes.

In addition, this patch also registers the hint containers in the PBX
core with the astobj2 library. This allows for reasonable debugging to
hash collisions in those containers.

ASTERISK-25040 #close
Reported by: Matt Jordan

Change-Id: Iedfc97a69d21070c50fca42275d7b3e714e59360
(cherry picked from commit 80c0756f7386452fddab3324fa6a71933cde006e)

10 years agoMerge "include/asterisk/vector.h: Backport vector.h to Asterisk 11" into 11
Mark Michelson [Thu, 30 Apr 2015 16:57:00 +0000 (11:57 -0500)] 
Merge "include/asterisk/vector.h: Backport vector.h to Asterisk 11" into 11

10 years agoinclude/asterisk/vector.h: Backport vector.h to Asterisk 11 13/313/1
Matt Jordan [Thu, 30 Apr 2015 16:04:04 +0000 (11:04 -0500)] 
include/asterisk/vector.h: Backport vector.h to Asterisk 11

Vectors are very useful constructs. As a container, they prevent having
to calloc/realloc arrays manually. They also have advantages over linked
lists, which require elements in the list to be a struct. This patch
backports vectors to Asterisk 11 for use in future patches.

Change-Id: Idc9d74d246a0158b0b36ccb250e7acc71bab078d

10 years agochan_dahdi: Add the chan_dahdi.conf force_restart_unavailable_chans option. 03/303/2
Richard Mudgett [Wed, 29 Apr 2015 22:28:07 +0000 (17:28 -0500)] 
chan_dahdi: Add the chan_dahdi.conf force_restart_unavailable_chans option.

Some telco switches occasionally ignore ISDN RESTART requests.  The fix
for ASTERISK-19608 added an escape clause for B channels in the restarting
state if the telco ignores a RESTART request.  If the telco fails to
acknowledge the RESTART then Asterisk will assume the telco acknowledged
the RESTART on the second call attempt requesting the B channel by the
telco.  The escape clause is good for dealing with RESTART requests in
general but it does cause the next call for the restarting B channel to be
rejected if the telco insists the call must go on that B channel.

chan_dahdi doesn't really need to issue a RESTART request in response to
receiving a cause 44 (Requested channel not available) code.  Sending the
RESTART in such a situation is not required (nor prohibited) by the
standards.  I think chan_dahdi does this for historical reasons to deal
with buggy peers to get channels unstuck in a similar fashion as the
chan_dahdi.conf resetinterval option.

* Add the chan_dahdi.conf force_restart_unavailable_chans compatability
option that when disabled will prevent chan_dahdi from trying to RESTART
the channel in response to a cause 44 code.

ASTERISK-25034 #close
Reported by: Richard Mudgett

Change-Id: Ib8b17a438799920f4a2038826ff99a1884042f65

10 years agocdr/cdr_csv.c: Add a new option to enable columns added in Asterisk 1.8 45/345/1
Rodrigo Ramírez Norambuena [Thu, 30 Apr 2015 11:34:21 +0000 (07:34 -0400)] 
cdr/cdr_csv.c: Add a new option to enable columns added in Asterisk 1.8

This patch adds a new option to cdr.conf, 'newcdrcolumns', that will handle CDR
columns added in Asterisk 1.8. The columns are:
 * peeraccount
 * linkedid
 * sequence
When enabled, the columns in the database entry will be populated with the data
from the CDR.

ASTERISK-24976 #close

Change-Id: I51a57063f4ae5e194a9d933a8df45dc8a4534f0b

10 years agoMerge "res_fax: allow 2400 transmission rate according to v.27ter standard" into 11
Matt Jordan [Wed, 29 Apr 2015 21:42:30 +0000 (16:42 -0500)] 
Merge "res_fax: allow 2400 transmission rate according to v.27ter standard" into 11

10 years agomain/rtp_engine: Fix DTLS double-free introduced by 0b6410c4f8 02/302/1
Matt Jordan [Wed, 29 Apr 2015 21:15:43 +0000 (16:15 -0500)] 
main/rtp_engine: Fix DTLS double-free introduced by 0b6410c4f8

The patch in 0b6410c4f8 did correctly fix a memory leak of the DTLS
structures in the RTP engine. However, when a 'core reload' is issued, a
double free of the memory pointed to by the char *'s in the DTLS
configuration struct can occur, as ast_rtp_dtls_cfg_free does not set
the pointers to NULL when they are freed.

This patch sets those pointers to NULL, preventing a second call to
ast_rtp_dtls_cfg_free from corrupting memory.

ASTERISK-25022

Change-Id: I820471e6070a37e3c26f760118c86770e12f6115

10 years agores_fax: allow 2400 transmission rate according to v.27ter standard 94/294/2
Kevin Harwell [Wed, 29 Apr 2015 18:19:58 +0000 (13:19 -0500)] 
res_fax: allow 2400 transmission rate according to v.27ter standard

A previous set of patches (see: ASTERISK-22790 & ASTERISK-23231) made it so
a v.27 modem was not allowed to have a minimum transmission rate of 2400 bits
per second. This reverts all or some of those patches since according to the
v.27ter standard a rate of 2400 bits per second is also supported.

One of the original patches also added 9600 bits per second support for v.27.
This patch also removes that since v.27ter only supports 2400/4800 bits per
second.

Also, since Asterisk specifically supports v.27ter the enum was renamed to
better reflect this.

ASTERISK-24955 #close
Reported by: Matt Jordan

Change-Id: I4b9dfb6bf7eff08463ab47ee1a74224f27cae733

10 years agoFixup UPGRADE.txt so new notes go in correct section for next release. 99/299/1
Richard Mudgett [Wed, 29 Apr 2015 20:03:00 +0000 (15:03 -0500)] 
Fixup UPGRADE.txt so new notes go in correct section for next release.

Change-Id: I7080d32b559f8c5d06ddd3198e0cd6e342bac841

10 years agoMerge "rtp_engine: Prevent unnecessary memory increases during calls." into 11
Joshua Colp [Wed, 29 Apr 2015 19:13:47 +0000 (14:13 -0500)] 
Merge "rtp_engine: Prevent unnecessary memory increases during calls." into 11

10 years agortp_engine: Prevent unnecessary memory increases during calls. 91/291/1
Mark Michelson [Wed, 29 Apr 2015 16:46:48 +0000 (11:46 -0500)] 
rtp_engine: Prevent unnecessary memory increases during calls.

The doxygen for ast_rtp_codecs_payloads_copy() states:

"This copies the payloads from the codecs0 structure to the codecs1
structure, overwriting any current values."

However, in practice, the overwriting of current values was not
happening. Instead, a new RTP codec payload object would be appended to
the codecs1 structure instead of replacing the corresponding object.

This patch corrects this behavior by overwriting the object in the
codecs1 structure if it exists already. If it does not already exist,
then create a new copy and link it in.

Tests of "memory show summary rtp_engine.c" had previously shown
additional allocations being performed any time that Asterisk processed
an incoming SDP. Scenarios involving lots of reinvites resulted in lots
of allocations. With this patch, I can perform as many reinvites as
I want and see no memory increases from the RTP engine.

ASTERISK-24916 #close
Reported by Christophe Osuna

Change-Id: I9a90bc3f564535bc767bf2fc0c455d5f065cea75

10 years agoaddons/res_config_mysql: Don't mutate va_list parameters 77/277/1
Ivan Poddubny [Wed, 29 Apr 2015 06:24:58 +0000 (06:24 +0000)] 
addons/res_config_mysql: Don't mutate va_list parameters

The realtime API passes down the va_list argument to each RT engine in
failover chain until one succeeds. MySQL engine used to access the
variable argument list with va_arg, which mutates the va_list, so the
next engine in failover chain gets invalid agrument list.
This patch uses va_copy to preserve the original va_list argument intact.

ASTERISK-19538 #close
Reported by: alexat
Tested by: Ivan Poddubny

Change-Id: I7738b9f98bde81ddfbc2c0fa579d85a0c3e580ae

10 years agoMerge "Example script for scan-build (the llvm static analyzer)" into 11
Joshua Colp [Tue, 28 Apr 2015 12:15:17 +0000 (07:15 -0500)] 
Merge "Example script for scan-build (the llvm static analyzer)" into 11

10 years agoMerge "res_rtp_asterisk: Resolve 2 discrete memory leaks in DTLS" into 11
Matt Jordan [Tue, 28 Apr 2015 12:11:46 +0000 (07:11 -0500)] 
Merge "res_rtp_asterisk: Resolve 2 discrete memory leaks in DTLS" into 11

10 years agores_rtp_asterisk: Resolve 2 discrete memory leaks in DTLS 68/268/4
Steve Davies [Tue, 28 Apr 2015 10:38:30 +0000 (11:38 +0100)] 
res_rtp_asterisk: Resolve 2 discrete memory leaks in DTLS

ao2 ref leak in res_rtp_asterisk.c when a DTLS policy is created.
The resources are linked into a table, but the original alloc refs
are never released. ast_strdup leak in rtp_engine.c. If
ast_rtp_dtls_cfg_copy() is called twice on the same destination struct,
a pointer to an alloc'd string is overwritten before the string is free'd.

ASTERISK-25022
Reported by: one47

Change-Id: I62a8ceb8679709f6c3769136dc6aa9a68202ff9b

10 years agoMerge "cdr/cdr_odbc.c: Added to record new columns add on CDR 1.8 Asterisk Version...
Joshua Colp [Tue, 28 Apr 2015 11:55:10 +0000 (06:55 -0500)] 
Merge "cdr/cdr_odbc.c: Added to record new columns add on CDR 1.8 Asterisk Version" into 11

10 years agocdr/cdr_odbc.c: Added to record new columns add on CDR 1.8 Asterisk Version 57/257/3
Rodrigo Ramírez Norambuena [Wed, 15 Apr 2015 23:55:33 +0000 (20:55 -0300)] 
cdr/cdr_odbc.c: Added to record new columns add on CDR 1.8 Asterisk Version

Add new column to INSERT new columns added in cdr 1.8 version. The columns are:
 * peeraccount
 * linkedid
 * sequence
This feature is configurable in cdr_odbc.conf using a new configuration
option, 'newcdrcolumns'.

ASTERISK-24976 #close

Change-Id: Ibe0c7540a88305c6012786f438a0813ad8b19127

10 years agoMerge "Clang: Fix some more tautological-compare warnings." into 11
Matt Jordan [Sun, 26 Apr 2015 20:53:40 +0000 (15:53 -0500)] 
Merge "Clang: Fix some more tautological-compare warnings." into 11

10 years agoMerge "app_confbridge: Default the template option to a compatible default profile...
Matt Jordan [Fri, 24 Apr 2015 18:06:59 +0000 (13:06 -0500)] 
Merge "app_confbridge: Default the template option to a compatible default profile." into 11

10 years agoapp_confbridge: Default the template option to a compatible default profile. 42/242/6
Kevin Harwell [Thu, 23 Apr 2015 20:05:07 +0000 (15:05 -0500)] 
app_confbridge: Default the template option to a compatible default profile.

Confbridge dynamic profiles did not have a default profile unless you
explicitly used Set(CONFBRIDGE(bridge,template)=default_bridge). If a
template was not set prior to the bridge being created then some
options were left with no default values set. This patch makes it so
the default templates are set to the default bridge and user profiles.

ASTERISK-24749 #close
Reported by: philippebolduc

Change-Id: I1bd6e94b38701ac2112d842db68de63d46f60e0a

10 years agoClang: Fix some more tautological-compare warnings. 53/253/1
Matt Jordan [Fri, 24 Apr 2015 15:23:06 +0000 (10:23 -0500)] 
Clang: Fix some more tautological-compare warnings.

clang can warn about a so called tautological-compare, when it finds
comparisons which are logically always true, and are therefore deemed
unnecessary.

Example:
unsigned int x = 4;
if (x > 0) // x is always going to be bigger than 0

Enum Case:
Each enumeration is its own type. Enums are an integer type but they do not
have to be *signed*. C leaves it up to the compiler as an implementation
option what to consider the integer type of a particular enumeration is.
Gcc treats an enum without negative values as an int while clang treats this
enum as an unsigned int.

rmudgett & mmichelson:
cast the enum to (unsigned int) in assert. The cast does have an effect.
For gcc, which seems to treat all enums as int, the cast to unsigned int
will eliminate the possibility of negative values being allowed. For
clang, which seems to treat enums without any negative members as
unsigned int, the cast will have no effect. If for some reason in the
future a negative value is ever added to the enum the assert will still
catch the negative value.

ASTERISK-24917

Change-Id: Ief23ef68916192b9b72dabe702b543ecfeca0b62

10 years agoExample script for scan-build (the llvm static analyzer) 50/250/1
Diederik de Groot [Mon, 20 Apr 2015 18:06:20 +0000 (20:06 +0200)] 
Example script for scan-build (the llvm static analyzer)

 - Added Pre-amble (Options / Flags / Usage Example / GNU License)
 - Extended Configurability
 - Made Executable

ASTERISK-24917
Change-Id: I70405fe54e4be7dbfbcb62e291690069b88617a8

10 years agoClang: change previous tautological-compare fixes. 35/235/1
Diederik de Groot [Thu, 23 Apr 2015 13:00:42 +0000 (15:00 +0200)] 
Clang: change previous tautological-compare fixes.

clang can warn about a so called tautological-compare, when it finds
comparisons which are logically always true, and are therefor deemed
unnecessary.

Exanple:
unsigned int x = 4;
if (x > 0)    // x is always going to be bigger than 0

Enum Case:
Each enumeration is its own type. Enums are an integer type but they
do not have to be *signed*. C leaves it up to the compiler as an
implementation option what to consider the integer type of a particu-
lar enumeration is. Gcc treats an enum without negative values as
an int while clang treats this enum as an unsigned int.

rmudgett & mmichelson: cast the enum to (unsigned int) in assert.
The cast does have an effect. For gcc, which seems to treat all enums
as int, the cast to unsigned int will eliminate the possibility of
negative values being allowed. For clang, which seems to treat enums
without any negative members as unsigned int, the cast will have no
effect. If for some reason in the future a negative value is ever
added to the enum the assert will still catch the negative value.

ASTERISK-24917

Change-Id: I0557ae0154a0b7de68883848a609309cdf0aee6a

10 years ago.gitignore: Add .gcno and .gcda 27/227/1
George Joseph [Wed, 22 Apr 2015 21:32:53 +0000 (15:32 -0600)] 
.gitignore:  Add .gcno and .gcda

Products of --enable-coverage

Change-Id: Ie20882d64b60692e2c941ea8872ab82a86ce77a3

10 years agoFix/Update clang-RAII macro implementation 92/192/1
Diederik de Groot [Mon, 20 Apr 2015 18:01:35 +0000 (20:01 +0200)] 
Fix/Update clang-RAII macro implementation

- When you need to refer to 'variable XXX' outside a block, it needs
to be declared as '__block XXX', otherwise it will not be available with-
in the block, making updating that variable hard to do, and ast_free
lead to issues.

- Removed the #error message
because it creates complications when compiling external projects
against asterisk For example when using a different compiler than the
one used to compile asterisk. The warning/error should be generated
during the configure process not the compilation process

ASTERISK-24917
Change-Id: I12091228090e90831bf2b498293858f46ea7a8c2

10 years agoCheck for ao2_alloc failure in __ast_channel_internal_alloc. 88/188/1
Corey Farrell [Tue, 21 Apr 2015 20:17:33 +0000 (16:17 -0400)] 
Check for ao2_alloc failure in __ast_channel_internal_alloc.

Fix a crash that could occur in __ast_channel_internal_alloc if
ao2_alloc fails.

ASTERISK-24991 #close

Change-Id: I4ca89189eb22f907408cb87d0a1645cfe1314a90

10 years agochan_dahdi/sig_pri: Make post AMI HangupRequest events on PRI channels. 71/171/1
Richard Mudgett [Mon, 20 Apr 2015 23:00:34 +0000 (18:00 -0500)] 
chan_dahdi/sig_pri: Make post AMI HangupRequest events on PRI channels.

The chan_dahdi channel driver is a very old driver.  The ability for it to
support ISDN was added well after the initial analog support.  Setting the
softhangup flags is a carry over from the original analog code.  The
driver was not updated to call ast_queue_hangup() which will post the AMI
HangupRequest event.

* Changed sig_pri.c to call ast_queue_hangup() instead of setting the
softhangup flag when the remote party initiates a hangup.

ASTERISK-24895 #close
Reported by: Andrew Zherdin

Change-Id: I5fe2e48556507785fd8ab8e1c960683fd5d20325

10 years agoMerge "UPGRADE: Fix upgrade notes" into 11
Matt Jordan [Mon, 20 Apr 2015 11:30:27 +0000 (06:30 -0500)] 
Merge "UPGRADE: Fix upgrade notes" into 11

10 years agoMerge "main/pbx: Don't attempt to destroy a previously destroyed exten/priority tuple...
Matt Jordan [Mon, 20 Apr 2015 11:29:48 +0000 (06:29 -0500)] 
Merge "main/pbx: Don't attempt to destroy a previously destroyed exten/priority tuple" into 11

10 years agomain/pbx: Don't attempt to destroy a previously destroyed exten/priority tuple 54/154/1
Matt Jordan [Sun, 19 Apr 2015 20:49:43 +0000 (15:49 -0500)] 
main/pbx: Don't attempt to destroy a previously destroyed exten/priority tuple

When a PBX registrar is unloaded, it will fail to remove its extension from
the context root_table if a dialplan application used by that extension is
still loaded. This can be the case for AGI, which can be unloaded after several
of the standard PBX providers. Often, this is harmless; however, if the
extension's priorities are removed during the failed unloading *and* the
dialplan application later unregisters, it leaves a ticking timebomb for the
next PBX provider that attempts to iterate over the extensions. When that
occurs, the peer_table pointer on the extension will already be set to NULL.
The current code does not check to see if the pointer is NULL before passing
it to a hashtab function this is not NULL tolerant.

Since it is possible for the peer_table to be NULL when we normally would not
expect that to be the case, the solution in this patch is to simply skip over
processing an extension's priorities if peer_table is NULL.

Prior to this patch, the tests/pbx/callerid_match test would crash during
module unload. With this patch, the test no longer crashes after running.

ASTERISK-24774 #close
Reported by: Corey Farrell

Change-Id: I2bbeecb7e0f77bac303a1b9135e4cdb4db6d4c40

10 years agoUPGRADE: Fix upgrade notes 51/151/2
Matt Jordan [Sun, 19 Apr 2015 04:49:37 +0000 (23:49 -0500)] 
UPGRADE: Fix upgrade notes

The next expected release from the 11 branch is 11.18.0. This patch
updates the UPGRADE notes to reflect that.

Change-Id: I8e6e9d62b3916484a68733cfc8d64b3709adb0c2

10 years agoFix issue with AST_THREADSTORAGE_RAW when DEBUG_THREADLOCALS is enabled. 41/141/2
Corey Farrell [Fri, 17 Apr 2015 21:19:24 +0000 (17:19 -0400)] 
Fix issue with AST_THREADSTORAGE_RAW when DEBUG_THREADLOCALS is enabled.

When DEBUG_THREADLOCALS is enabled it causes the threadlocal cleanup to be
called as a function.  This causes a compile error with raw threadstorage as
it uses NULL for cleanup.  This fix uses a macro that provides NULL when
DEBUG_THREADLOCALS is disabled, and replaces the call to "c_cleanup(data);"
with "{};" when DEBUG_THREADLOCALS is enabled.

ASTERISK-24975 #close
Reported by: Ashley Sanders

Change-Id: I3ef7428ee402816d9fcefa1b3b95830c00d5c402

10 years agoMore .gitignore updates 30/130/1
George Joseph [Wed, 15 Apr 2015 21:08:09 +0000 (15:08 -0600)] 
More .gitignore updates

Added .pyc and .sha1 to the top-level .gitignore.

Change-Id: I7dfc4f554d54d22947b38140d3305007503cc16a
Tested-by: George Joseph <george.joseph@fairview5.com>
10 years agoMerge "Build System: Replace comment about setting menuselect defaults." into 11
Matt Jordan [Wed, 15 Apr 2015 18:35:54 +0000 (13:35 -0500)] 
Merge "Build System: Replace comment about setting menuselect defaults." into 11

10 years agocel_pgsql: Fix name string for log on unable allocate memory. 14/114/2
Rodrigo Ramírez Norambuena [Tue, 14 Apr 2015 18:16:45 +0000 (15:16 -0300)] 
cel_pgsql: Fix name string for log on unable allocate memory.

The LOG_ERROR has reference to CDR instead of CEL  for LENGTHEN_BUF1 and
LENGTHEN_BUF2.

ASTERISK-24965 #close
Reported by: Rodrigo Ramirez Norambuena

Change-Id: Icc818697d7d66d34bfe3048cdd15ca2b06c89744

10 years agoBuild System: Replace comment about setting menuselect defaults. 12/112/2
Corey Farrell [Tue, 14 Apr 2015 18:48:59 +0000 (14:48 -0400)] 
Build System: Replace comment about setting menuselect defaults.

The Makefile claims that you can set default menuselect options by creating
~/.asterisk.makeopts or /etc/asterisk.makeopts, but those files have never
been respected in Asterisk 11 or 13.  This changes the comment to accurately
reflect that these files are not automatically used by the build system.

ASTERISK-13721 #close
Reported by: pj

Change-Id: Ibde804ff196283def49ccb9432fbf224a22586e2

10 years agocdr_pgsql: Fix CLI "cdr show pgsql status" command. 08/108/1
Rodrigo Ramírez Norambuena [Sun, 12 Apr 2015 14:08:30 +0000 (11:08 -0300)] 
cdr_pgsql: Fix CLI "cdr show pgsql status" command.

The command always showed the usage information.

* Fix the error in command validation for CLI_SHOWUSAGE.

ASTERISK-24959 #close
Reported by: Rodrigo Ramirez Norambuena

Change-Id: I584f0936bb01001336a468a55c1d05d79fe795d5
(cherry picked from commit 23a180cade51e84b9def65b05759c3cb9feba225)

10 years agoMerge ".gitignore updates for 11" into 11
Matt Jordan [Tue, 14 Apr 2015 17:38:41 +0000 (12:38 -0500)] 
Merge ".gitignore updates for 11" into 11

10 years agoBackport menuselect to 12,11,1.8 96/96/5
George Joseph [Tue, 14 Apr 2015 00:34:55 +0000 (18:34 -0600)] 
Backport menuselect to 12,11,1.8

Backport menuselect from 13->12->11->1.8

Change-Id: I54c4dd2bdacd3c9d858be3acab08706941f2e585

10 years ago.gitignore updates for 11 03/103/3
George Joseph [Tue, 14 Apr 2015 01:17:29 +0000 (19:17 -0600)] 
.gitignore updates for 11

Added bootstrap products
Added channels/h323/Makefile
Added res/pjproject

Change-Id: I6b3bc56bf7bdaee0554f36fc2ce3a77e9eaf8aa3

10 years agoFixing extconf compile 88/88/1
David M. Lee [Mon, 13 Apr 2015 19:41:40 +0000 (14:41 -0500)] 
Fixing extconf compile

During the mass code deletion for clang support, a stray backslash was
left behind that was causing utils to fail to compile.

Change-Id: I60e5fa58c9a5b248bde23aaada79ff663f87a2a1

10 years agoMerge "build_tools/make_version: Update version parsing for Git migration" into 11
Matt Jordan [Mon, 13 Apr 2015 17:03:18 +0000 (12:03 -0500)] 
Merge "build_tools/make_version: Update version parsing for Git migration" into 11

10 years agobuild_tools/make_version: Update version parsing for Git migration 77/77/1
Matt Jordan [Mon, 13 Apr 2015 14:54:18 +0000 (09:54 -0500)] 
build_tools/make_version: Update version parsing for Git migration

External systems - such as the Asterisk Test Suite - require knowledge of the
upstream branch. Unfortunately, after moving to Git, the Asterisk version
currently consists of only a 'GIT" prefix followed by an object blob,
e.g., GIT-as08d7. This makes it difficult for such systems to know what
features are available in a particular check out of Asterisk.

This patch fixes this by hardcoding the branch in a variable in the
make_version script. Since the mainline branches are not changed often -
typically only once a year - this is a reasonable approach to solving
the problem, and is more reliable than parsing the output of 'git branch
-vv'. Branches that track off of an upstream primary branch will then get the
benefit of knowing which mainline branch they are currently based off
of.

ASTERISK-24954 #close

Change-Id: I8090d5d548b6d19e917157ed530b914b7eaf9799

10 years agogit migration: Remove support for file versions 61/61/3
Matt Jordan [Sun, 12 Apr 2015 17:59:22 +0000 (12:59 -0500)] 
git migration: Remove support for file versions

Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file.
As a result, this patch removes Asterisk's support for showing source file
versions.

Specifically, it does the following:
* main/asterisk:
  - Refactor the file_version structure to reflect that it no longer
    tracks a version field.
  - Alter the "core show file version" CLI command such that it always
    reports the version of Asterisk. The file version is no longer
    available.

* main/manager: The Version key now always reports the Asterisk version.

* UPGRADE: Add notes for:
  - Modification to the ModuleCheck AMI Action.
  - Modification to the CLI "core show file version" command.

Change-Id: Ia932d3c64cd18a14a3c894109baa657ec0a85d28

10 years agoMerge topic '11-git-ignore' into 11
Matt Jordan [Sun, 12 Apr 2015 20:27:10 +0000 (15:27 -0500)] 
Merge topic '11-git-ignore' into 11

* changes:
  .gitignore: Ignore tarballs (*.gz)
  Add .gitignore and .gitreview files

10 years agomain/editline: Add .gitignore. 67/67/1
Corey Farrell [Sun, 12 Apr 2015 11:12:45 +0000 (07:12 -0400)] 
main/editline: Add .gitignore.

This patch adds a .gitignore for main/editline to ignore all build results.

Change-Id: I68c7bf375ea46282689e5a706534b69fca233b5d

10 years ago.gitignore: Ignore tarballs (*.gz) 65/65/1
Matt Jordan [Sun, 12 Apr 2015 04:22:59 +0000 (23:22 -0500)] 
.gitignore: Ignore tarballs (*.gz)

This patch updates the root .gitignore file to ignore files with a .gz
extension. This will cause git to ignore downloaded sound tarballs in
the the sounds/ directory.

Change-Id: Ic153642236ea8aee100443b94c563d0318711af3

10 years agoAdd .gitignore and .gitreview files 64/64/1
George Joseph [Sat, 11 Apr 2015 18:20:07 +0000 (12:20 -0600)] 
Add .gitignore and .gitreview files

Add the .gitignore and .gitreview files to the asterisk repo.

NB:  You can add local ignores to the .git/info/exclude file
without having to do a commit.

Common ignore patterns are in the top-level .gitignore file.
Subdirectory-specific ignore patterns are in their own .gitignore
files.

Change-Id: I2b7513fc9acf5d432cf9587c25faa9786af14abf
Tested-by: George Joseph
10 years agomain/event: Remove unnecessary assignment of negative value to enum
Matthew Jordan [Sat, 11 Apr 2015 15:34:43 +0000 (15:34 +0000)] 
main/event: Remove unnecessary assignment of negative value to enum

When cleaning up some clang compiler warnings, the comparison of a negative
value to an unsigned enum was removed. However, the initial assignment of a
negative value to said enum remained in the variable declaration. This patch
removes that assignment.

Thanks to ibercom in #asterisk-bugs for pointing it out.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434708 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix various warnings for tests
Matthew Jordan [Sat, 11 Apr 2015 15:26:15 +0000 (15:26 +0000)] 
clang compiler warnings: Fix various warnings for tests

This patch fixes a variety of clang compiler warnings for unit tests. This
includes autological comparison issues, ignored return values, and
interestingly enough, one embedded function. Fun!

Review: https://reviewboard.asterisk.org/r/4555

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4555.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434705 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agotranslate.c: Only select audio codecs to determine the best translation choice.
Richard Mudgett [Fri, 10 Apr 2015 16:25:13 +0000 (16:25 +0000)] 
translate.c: Only select audio codecs to determine the best translation choice.

Given a source capability of h264 and ulaw, a destination capability of
h264 and g722 then ast_translator_best_choice() would pick h264 as the
best choice even though h264 is a video codec and Asterisk only supports
translation of audio codecs.  When the audio starts flowing, there are
warnings about a codec mismatch when the channel tries to write a frame to
the peer.

* Made ast_translator_best_choice() only select audio codecs.

* Restore a check in channel.c:set_format() lost after v1.8 to prevent
trying to set a non-audio codec.

This is an intermediate patch for a series of patches aimed at improving
translation path choices for ASTERISK-24841.

This patch is a complete enough fix for ASTERISK-21777 as the v11 version
of ast_translator_best_choice() does the same thing.  However, chan_sip.c
still somehow tries to call ast_codec_choose() which then calls
ast_best_codec() with a capability set that doesn't contain any audio
formats for the incoming call.  The remaining warning message seems to be
a benign transient.

ASTERISK-21777 #close
Reported by: Nick Ruggles

ASTERISK-24380 #close
Reported by: Matt Jordan

Review: https://reviewboard.asterisk.org/r/4605/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434614 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochannels/chan_iax2: Improve POKE expiration time calculation for lossy networks
Matthew Jordan [Fri, 10 Apr 2015 12:35:49 +0000 (12:35 +0000)] 
channels/chan_iax2: Improve POKE expiration time calculation for lossy networks

POKE is used to check for peer availability; however, in networks with packet
loss, the current calculations may result in POKE expiration times that are too
short. This patch alters the expiration/retry time logic to take into account
the last known qualify round trip time, as opposed to always using a static
value for each peer.

Review: https://reviewboard.asterisk.org/r/4536

ASTERISK-22352 #close
Reported by: Frederic Van Espen

ASTERISK-24894 #close
Reported by: Y Ateya
patches:
  poke_noanswer_duration.diff submitted by Y Ateya (License 6693)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434564 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix autological comparisons
Matthew Jordan [Thu, 9 Apr 2015 12:47:09 +0000 (12:47 +0000)] 
clang compiler warnings: Fix autological comparisons

This fixes autological comparison warnings in the following:
 * chan_skinny: letohl may return a signed or unsigned value, depending on the
   macro chosen
 * func_curl: Provide a specific cast to CURLoption to prevent mismatch
 * cel: Fix enum comparisons where the enum can never be negative
 * enum: Fix comparison of return result of dn_expand, which returns a signed
   int value
 * event: Fix enum comparisons where the enum can never be negative
 * indications: tone_data.freq1 and freq2 are unsigned, and hence can never be
   negative
 * presencestate: Use the actual enum value for INVALID state
 * security_events: Fix enum comparisons where the enum can never be negative
 * udptl: Don't bother to check if the return value from encode_length is less
   than 0, as it returns an unsigned int
 * translate: Since the parameters are unsigned int, don't bother checking
   to see if they are negative. The cast to unsigned int would already blow
   past the matrix bounds.

Review: https://reviewboard.asterisk.org/r/4533
ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4533.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434469 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoapps/app_queue: Prevent possible crash when evaluating queue penalty rules
Matthew Jordan [Thu, 9 Apr 2015 02:03:57 +0000 (02:03 +0000)] 
apps/app_queue: Prevent possible crash when evaluating queue penalty rules

Although it only occurred once, a crash occurred when a queue attempted to
evaluate a queue penalty rule that appeared to have already been destroyed.
In many locations in app_queue, a test is done to see if qe->pr is NULL;
however, when we dispose of a queue's penalty rules, we don't set the pointer
to NULL after free'ing it. This patch does that to prevent any dangling
pointers from lingering on the queue object.

Review: https://reviewboard.asterisk.org/r/4522

ASTERISK-23319 #close
Reported by: Vadim
patches:
  rb4552.patch submitted by Stefan Engström (License 6691)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434448 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoSecurity/tcptls: MitM Attack potential from certificate with NULL byte in CN.
Jonathan Rose [Wed, 8 Apr 2015 16:11:53 +0000 (16:11 +0000)] 
Security/tcptls: MitM Attack potential from certificate with NULL byte in CN.

When registering to a SIP server with TLS, Asterisk will accept CA signed
certificates with a common name that was signed for a domain other than the
one requested if it contains a null character in the common name portion of
the cert. This patch fixes that by checking that the common name length
matches the the length of the content we actually read from the common name
segment. Some certificate authorities automatically sign CA requests when
the requesting CN isn't already taken, so an attacker could potentially
register a CN with something like www.google.com\x00www.secretlyevil.net
and have their certificate signed and Asterisk would accept that certificate
as though it had been for www.google.com - this is a security fix and is
noted in AST-2015-003.

ASTERISK-24847 #close
Reported by: Maciej Szmigiero
Patches:
 asterisk-null-in-cn.patch submitted by mhej (license 6085)
........

Merged revisions 434337 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434338 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochan_iax2: Fix mixup of code/declarations
Matthew Jordan [Wed, 8 Apr 2015 14:53:43 +0000 (14:53 +0000)] 
chan_iax2: Fix mixup of code/declarations

Interestingly enough, clang doesn't care about this.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434334 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochan_iax2: Fix crash caused by unprotected access to iaxs[peer->callno]
Matthew Jordan [Wed, 8 Apr 2015 11:59:10 +0000 (11:59 +0000)] 
chan_iax2: Fix crash caused by unprotected access to iaxs[peer->callno]

This patch fixes an access to the peer callnumber that is unprotected by a
corresponding mutex. The peer->callno value can be changed by multiple threads,
and all data inside the iaxs array must be procted by a corresponding lock
of iaxsl.

The patch moves the unprotected access to a location where the mutex is
safely obtained.

Review: https://reviewboard.asterisk.org/r/4599/

ASTERISK-21211 #close
Reported by: Jaco Kroon
patches:
  asterisk-11.2.1-iax2_poke-segfault.diff submitted by Jaco Kroon (License 5671)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434291 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochan_sip: Handle IPv4 mapped IPv6 clients when NAT is enabled
Matthew Jordan [Wed, 8 Apr 2015 11:51:24 +0000 (11:51 +0000)] 
chan_sip: Handle IPv4 mapped IPv6 clients when NAT is enabled

When udpbindaddr is set to the IPv6 bind all address of '::', Asterisk will
attempt to handle both IPv4 and IPv6 addresses, although the information will
be stored in a struct with an AF_INET6 address type. However, the current
NAT handling code won't handle the IPv4 mapped IPv6 addresses correctly.
This patch adds an additional check for the mapped address case, allowing
the NAT code to handle clients even when the address is IPv6.

Review: https://reviewboard.asterisk.org/r/4563/

ASTERISK-18032 #close
Reported by: Christoph Timm
patches:
  nat_with_ipv6.diff submitted by Valentin Vidić (License 6697)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434288 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix pointer-bool-converesion warnings
Matthew Jordan [Wed, 8 Apr 2015 11:42:10 +0000 (11:42 +0000)] 
clang compiler warnings: Fix pointer-bool-converesion warnings

This patch fixes several warnings pointed out by the clang compiler.
* app_minivm: Fixed evaluation of etemplate->locale, which will always
  evaluate to 'true'. This patch changes the evaluation to use
  ast_strlen_zero.
* app_queue:
  - Fixed evaluation of qe->parent->monfmt, which always evaluates to
    true. Instead, we just check to see if the dereferenced pointer
    evaluates to true.
  - Fixed evaluation of mem->state_interface, wrapping it with a call to
    ast_strlen_zero.

Review: https://reviewboard.asterisk.org/r/4541

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4541.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434285 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoVoicemail API: fix handling of full mailbox
Scott Griepentrog [Tue, 7 Apr 2015 19:34:35 +0000 (19:34 +0000)] 
Voicemail API: fix handling of full mailbox

Changes to an error code in svn r115582 was
the accidental cause of message deletion on
a full (by maxmsg) Old mailbox folder.

This restores the original handling marking
the message to be left in the Inbox.

ASTERISK-24942 #close
Review: https://reviewboard.asterisk.org/r/4595/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434260 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix sometimes-initialized warning in func_math
Matthew Jordan [Tue, 7 Apr 2015 02:09:19 +0000 (02:09 +0000)] 
clang compiler warnings: Fix sometimes-initialized warning in func_math

This patch fixes a bug in a unit test in func_math where a variable could be
passed to ast_free that wasn't allocated. This patch corrects the issue and
ensures that we only attempt to free a variable if we previously allocated
it.

Review: https://reviewboard.asterisk.org/r/4552

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4552.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434190 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix non-literal-null-conversion warnings
Matthew Jordan [Tue, 7 Apr 2015 01:58:57 +0000 (01:58 +0000)] 
clang compiler warnings: Fix non-literal-null-conversion warnings

Clang will flag errors when a char pointer is set to '\0', as opposed to a
value that the char pointer points to. This patch fixes this warning
in a variety of locations.

Review: https://reviewboard.asterisk.org/r/4551

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4551.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434187 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agobuild: Fixes for gcc 5 compilation
George Joseph [Mon, 6 Apr 2015 18:58:30 +0000 (18:58 +0000)] 
build: Fixes for gcc 5 compilation

These are fixes for compilation under gcc 5.0...

chan_sip.c:    In parse_request needed to make 'lim' unsigned.
inline_api.h:  Needed to add a check for '__GNUC_STDC_INLINE__' to detect C99
               inline semantics (same as clang).
ccss.c:        In ast_cc_set_parm, needed to fix weird comparison.
dsp.c:         Needed to work around a possible compiler bug.  It was throwing
               an array-bounds error but neither
               sgriepentrog, rmudgett nor I could figure out why.
manager.c:     In action_atxfer, needed to correct an array allocation.

This patch will go to 11, 13, trunk.

Review: https://reviewboard.asterisk.org/r/4581/
Reported-by: Jeffrey Ollie
Tested-by: George Joseph
ASTERISK-24932 #close

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434113 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Remove large chunks of unused code from extconf
Matthew Jordan [Mon, 6 Apr 2015 18:07:35 +0000 (18:07 +0000)] 
clang compiler warnings: Remove large chunks of unused code from extconf

This patch fixes a warning caught by clang, in which it detected that large
chunks of extconf were unused. Frankly, I wish we could pretend that all of
extconf was unused, but alas, that is not yet the case.

Review: https://reviewboard.asterisk.org/r/4553

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4553.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434093 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix sometimes-uninitialized warning in pbx_config
Matthew Jordan [Mon, 6 Apr 2015 18:03:23 +0000 (18:03 +0000)] 
clang compiler warnings: Fix sometimes-uninitialized warning in pbx_config

This patch fixes a warning caught by clang, in which a char pointer could be
assigned to before it was initialized. The patch re-organizes the code to
ensure that the pointer is always initialized, even on off nominal paths.

Review: https://reviewboard.asterisk.org/r/4529

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4529.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434090 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix format specified in framehook
Matthew Jordan [Mon, 6 Apr 2015 17:51:59 +0000 (17:51 +0000)] 
clang compiler warnings: Fix format specified in framehook

This patch fixes an invalid format specifier used in the formatting of an
ERROR message in the framehook code. The format specifier specifies a
type of 'unsigned short', but the argument passed to it is of type 'int'.
The patch changes the format specifier to 'i'.

Review: https://reviewboard.asterisk.org/r/4540

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4535.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@434087 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoBackport revision 429223 from Asterisk 13
Mark Michelson [Wed, 1 Apr 2015 20:43:31 +0000 (20:43 +0000)] 
Backport revision 429223 from Asterisk 13

The bug fixed by that patch exists in Asterisk 11 as
well, so the fix should be applied there.

When connecting to a remote Asterisk console, the buffer
used to read the initial hostname/pid/version from the
main Asterisk process did not ensure the input was
NULL-terminated, and the buffer was small for certain
use cases. This patch expands the buffer to be 256
bytes and ensures the input it reads is NULL-terminated.

ASTERISK-21854 #close
Reported by klaus3000

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433919 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agochan_sip: Fix expression in unit test /channels/chan_sip/test_sip_rtpqos.
Richard Mudgett [Tue, 31 Mar 2015 16:47:42 +0000 (16:47 +0000)] 
chan_sip: Fix expression in unit test /channels/chan_sip/test_sip_rtpqos.

Fix misplaced parentheses in original fabs() expression.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433816 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix an ABI compatibility issue with ast_log_safe for modules.
Corey Farrell [Mon, 30 Mar 2015 11:40:33 +0000 (11:40 +0000)] 
Fix an ABI compatibility issue with ast_log_safe for modules.

Binary modules are sometimes built against the latest release of
Asterisk in each branch, and need to be compatible with all
releases of that branch.  This change ensures that utils.h only
uses ast_log_safe from the core.  For modules and utilities ast_log
is used instead.

Review: https://reviewboard.asterisk.org/r/4548/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433772 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix -Wabsolute-value warnings
Matthew Jordan [Mon, 30 Mar 2015 02:44:21 +0000 (02:44 +0000)] 
clang compiler warnings: Fix -Wabsolute-value warnings

This patch fixes several warnings caught by clang - in this case, usage of the
abs function on non-integer values. This patch uses labs and fabs, as
appropriate, in the various affected files.

Review: https://reviewboard.asterisk.org/r/4525

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4525.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433749 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix invalid enum conversion
Matthew Jordan [Mon, 30 Mar 2015 02:35:12 +0000 (02:35 +0000)] 
clang compiler warnings: Fix invalid enum conversion

This patch fixes some invalid enum conversion warnings caught by clang. In
particular, several functions in chan_sip mixed usage of the st_refresher_param
enum and st_refresher enum. This patch corrects that.

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4535.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433746 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agomain/stdtime/localtime: Fix warning introduced in r433720
Matthew Jordan [Mon, 30 Mar 2015 02:28:47 +0000 (02:28 +0000)] 
main/stdtime/localtime: Fix warning introduced in r433720

The patch in r433720 caused a warning to be kicked back by gcc. It occurred
due to this check in unistd.h:

    if (__nbytes > __bos0 (__buf))
        return __read_chk_warn (__fd, __buf, __nbytes, __bos0 (__buf));

That is, if __nbytes is greater than the result of GCC's built-in object size
for the struct, we'll kick back a warning.

As it turns out, this is because there is an error in the code in the patch.
We are passing the address of the pointer to the struct, not iev, which is a
pointer to the struct. Hence, the number of bytes is probably going to be lot
larger than the number of bytes that make up a pointer! This patch changes
the code just read from the pointer to the struct - which fixes the warning.

ASTERISK-24917

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433743 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Ignore -Wunused-command-line-argument
Matthew Jordan [Mon, 30 Mar 2015 01:56:08 +0000 (01:56 +0000)] 
clang compiler warnings: Ignore -Wunused-command-line-argument

Asterisk's build system has a tendency to pass include directives for libraries
to everything compiled within a particular group of source files. This means
we pass the header for libxml2 to things that don't necessarily need it. As a
result, we ignore this particular warning.

Review: https://reviewboard.asterisk.org/r/4545/

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4545.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433720 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix warning for -Wgnu-variable-sized-type-not-at-end
Matthew Jordan [Mon, 30 Mar 2015 01:51:59 +0000 (01:51 +0000)] 
clang compiler warnings: Fix warning for -Wgnu-variable-sized-type-not-at-end

This patch fixes a warning caught by clang, wherein a variable sized struct is
not located at the end of a struct. While the code in question actually
expected this, this is a good warning to watch for. Hence, this patch refactors
the code in question to not have two variable length elements in the same
struct.

Review: https://reviewboard.asterisk.org/r/4530/

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4530.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433717 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix a variety of "unused" warnings
Matthew Jordan [Sat, 28 Mar 2015 12:53:50 +0000 (12:53 +0000)] 
clang compiler warnings: Fix a variety of "unused" warnings

This patch fixes the -Wunused-value -Wunused-variable -Wunused-const-variable
errors caught by clang. Specifically:

* apps/app_queue.c: removed unused qpm_cmd_usage[], qum_cmd_usage[],
                    qsmp_cmd_usage[]
* cel/cel_sqlite3_custom.c: removed unused name[] = "cel_sqlite3_custom"
* codecs/gsm/src/gsm_create.c: removed unused ident[] = "$Header$"
* funcs/func_env.c:729: Fixed ast_str_append_substr.
* main/editline/np/strlcat.c: removed unused rcsid variable
* main/editline/np/strlcpy.c: removed unused rcsid variable
* utils/conf2ael.c: removed unused cfextension_states
* utils/extconf.c: removed unused cfextension_states

Review: https://reviewboard.asterisk.org/r/4526

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4526.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433693 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix -Wself-assign
Matthew Jordan [Sat, 28 Mar 2015 12:47:19 +0000 (12:47 +0000)] 
clang compiler warnings: Fix -Wself-assign

Assigning a variable to itself isn't super useful. However, the WAV format
modules make use of this in order to perform byte endian checks. This patch
works around the warning by only performing the self assignment if we are
going to do more than just assign it to ourselves. Which is odd, but true.

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4544.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433690 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix -Wparantheses-equality warnings
Matthew Jordan [Sat, 28 Mar 2015 12:39:08 +0000 (12:39 +0000)] 
clang compiler warnings: Fix -Wparantheses-equality warnings

Clang will treat ((a == b)) as a warning, as it reasonably expects that the
developer may have intended to write (a == b) or ((a = b)). This patch cleans
up all instances where equality, not assignment, was intended between two
parantheses.

Review: https://reviewboard.asterisk.org/r/4531/

ASTERISK-24917
Repoted by: dkdegroot
patches:
  rb4531.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433687 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix -Wbitfield-constant-conversion warning
Matthew Jordan [Sat, 28 Mar 2015 12:30:51 +0000 (12:30 +0000)] 
clang compiler warnings: Fix -Wbitfield-constant-conversion warning

In chan_iax2, we attempt to assign a -1 to a bitfield. This gets caught by
clang, as it will truncate the -1 to a 1 implicitly.

Instead, we just assign the value a '1'.

Review: https://reviewboard.asterisk.org/r/4537/

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4537.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433683 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoclang compiler warnings: Fix -Wunused-function
Matthew Jordan [Sat, 28 Mar 2015 12:17:45 +0000 (12:17 +0000)] 
clang compiler warnings: Fix -Wunused-function

This patch fixes clang compilers warnings for unused functions. Specifically:
 * channels/chan_iax2: removed user_ref function
 * main/dsp.c: removed goertzel_update function

Review: https://reviewboard.asterisk.org/r/4527

ASTERISK-24917
Reported by: dkdegroot
patches:
  rb4527.patch submitted by dkdegroot (License 6600)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433678 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix link error for utils/aelparse.
Corey Farrell [Fri, 27 Mar 2015 12:25:05 +0000 (12:25 +0000)] 
Fix link error for utils/aelparse.

Use the standard ast_log instead of ast_log_safe for STANDALONE programs.

Review: https://reviewboard.asterisk.org/r/4538/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433549 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoImproved and portable ast_log recursion avoidance
Corey Farrell [Fri, 27 Mar 2015 07:06:24 +0000 (07:06 +0000)] 
Improved and portable ast_log recursion avoidance

This introduces a new logger routine ast_log_safe.  This routine should be
used for all error messages in code that can be run as a result of ast_log.
ast_log_safe does nothing if run recursively.  All error logging in
astobj2.c, strings.c and utils.h have been switched to ast_log_safe.

This required adding support for raw threadstorage.  This provides direct
access to the void* pointer in threadstorage.  In ast_log_safe, NULL is used
to signify that this thread is not already running ast_log_safe, (void*)1 when
it is already running.  This was done since it's critical that ast_log_safe
do nothing that could log during recursion checking.

ASTERISK-24155 #close
Reported by: Timo Teräs
Review: https://reviewboard.asterisk.org/r/4502/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433522 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix compile errors caused by r4500 / r4501.
Corey Farrell [Thu, 26 Mar 2015 23:04:43 +0000 (23:04 +0000)] 
Fix compile errors caused by r4500 / r4501.

* Add ast_register_cleanup to utils/clicompat.c to deal with
  any utils that copy sources from main.
* Asterisk 13+: remove unused variables from core_local.c.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433499 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoReplace most uses of ast_register_atexit with ast_register_cleanup.
Corey Farrell [Thu, 26 Mar 2015 22:16:31 +0000 (22:16 +0000)] 
Replace most uses of ast_register_atexit with ast_register_cleanup.

Since 'core stop now' and 'core restart now' do not stop modules,
it is unsafe for most of the core to run cleanups.  Originally all
cleanups used ast_register_atexit, and were only changed when it
was shown to be unsafe.  ast_register_atexit is now used only when
absolutely required to prevent corruption and close child processes.

Exceptions that need to use ast_register_atexit:
* CDR: Flush records.
* res_musiconhold: Kill external applications.
* AstDB: Close the DB.
* canary_exit: Kill canary process.

ASTERISK-24142 #close
Reported by: David Brillert

ASTERISK-24683 #close
Reported by: Peter Katzmann

ASTERISK-24805 #close
Reported by: Badalian Vyacheslav

ASTERISK-24881 #close
Reported by: Corey Farrell

Review: https://reviewboard.asterisk.org/r/4500/
Review: https://reviewboard.asterisk.org/r/4501/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433495 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoapp_confbridge: file playback blocks dtmf
Kevin Harwell [Thu, 26 Mar 2015 17:00:39 +0000 (17:00 +0000)] 
app_confbridge: file playback blocks dtmf

Attempting to execute DTMF in a confbridge while file playback (prompt,
announcement, etc) is occurring is not allowed. You have to wait until
the sound file has completed before entering DTMF. This patch fixes it
so that app_confbridge now monitors for dtmf key presses during menu
driven file playback. If a key is pressed playback stops and it executes
the matched menu option.

ASTERISK-24864 #close
Reported by: Steve Pitts
Review: https://reviewboard.asterisk.org/r/4477/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433445 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agores_xmpp: Buddies are always auto-registered when processing the roster
Matthew Jordan [Wed, 25 Mar 2015 15:29:39 +0000 (15:29 +0000)] 
res_xmpp: Buddies are always auto-registered when processing the roster

Due to a quirk in the configuration handling of res_xmpp, the 'autoregister'
setting was never actually processed. This was due to not properly copying
over the global settings to the client settings when applying the
configuration to the run-time object.

ASTERISK-14233
ASTERISK-24780 #close
Reported by: Simon Arlott
patches:
  asterisk-13.1.0-24780 uploaded by Simon Arlott (License 5756)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433395 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix compilations errors on 64-bit OpenBSD systems
Matthew Jordan [Sun, 22 Mar 2015 23:55:25 +0000 (23:55 +0000)] 
Fix compilations errors on 64-bit OpenBSD systems

In versiong 5.5, OpenBSD went to 64-bit time values. This requires a cast to
(long) when printing members of certain time structs.

Review: https://reviewboard.asterisk.org/r/4507

ASTERISK-24879 #close
Reported by: snuffy
Tested by: snuffy
patches:
  openbsd-time64.diff uploaded by snuffy (License 5024)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433268 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix compilation issues for OpenBSD
Matthew Jordan [Sun, 22 Mar 2015 20:32:17 +0000 (20:32 +0000)] 
Fix compilation issues for OpenBSD

This patch addresses compilation issues for OpenBSD. Specifically, it
addresses:
 * It allows including <sys/vmmeter.h> in asterisk.c
 * Provides a needed (size_t) cast in xmldoc.c

In 13+, it also addresses a conditional inclusion in loader.c.

Review: https://reviewboard.asterisk.org/r/4506

ASTERISK-24880 #close
Reported by: snuffy
Tested by: snuffy
patches:
  misc-openbsd.diff uploaded by snuffy (License 5024)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433245 65c4cc65-6c06-0410-ace0-fbb531ad65f3