]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
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

10 years agofuncs/func_env: Fix regression caused in FILE read operation
Matthew Jordan [Thu, 19 Mar 2015 19:19:32 +0000 (19:19 +0000)] 
funcs/func_env: Fix regression caused in FILE read operation

When r432935 was merged, it did correctly fix a situation where a FILE read
operation on the middle of a file buffer would not read the requested length
in the parameters passed to the FILE function. Unfortunately, it would also
allow the FILE function to append more bytes than what was available in the
buffer if the length exceeded the end of the buffer length.

This patch takes the minimum of the remaining bytes in the buffer along with
the calculated length to append provided by the original patch, and uses
that as the length to append in the return result. This patch also updates
the unit tests with the scenarios that were originally pointed out in
ASTERISK-21765 that the original implementation treated incorrectly.

ASTERISK-21765

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

10 years agologger: Apply default console logging when configuration cannot be loaded.
Corey Farrell [Thu, 19 Mar 2015 10:19:11 +0000 (10:19 +0000)] 
logger: Apply default console logging when configuration cannot be loaded.

When logger.conf is missing or invalid enable console logging and display
an error message.

ASTERISK-24817 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4497/

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

10 years agochan_sip: Fix dialog reference leaked to scheduler for reinvite_timeout.
Corey Farrell [Thu, 19 Mar 2015 09:39:28 +0000 (09:39 +0000)] 
chan_sip: Fix dialog reference leaked to scheduler for reinvite_timeout.

Release the scheduler reference to the dialog for reinvite timeout during
dialog_unlink_all.

ASTERISK-24876 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4491/

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

10 years agoVarious: backport of bugfixes found via chaos
Scott Griepentrog [Tue, 17 Mar 2015 22:28:41 +0000 (22:28 +0000)] 
Various: backport of bugfixes found via chaos

Using DEBUG_CHAOS several instances of a null
pointer crash, and one uninitialized variable
were uncovered and fixed.  Also added details
on why Asterisk failed to initialize.

This is a backport of the fixes from Asterisk
13.

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

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

10 years agoAudit ast_sockaddr_resolve() usage for memory leaks.
Richard Mudgett [Tue, 17 Mar 2015 21:43:32 +0000 (21:43 +0000)] 
Audit ast_sockaddr_resolve() usage for memory leaks.

Valgrind found some memory leaks associated with ast_sockaddr_resolve().
Most of the leaks had already been fixed by earlier memory leak hunt
patches.  This patch performs an audit of ast_sockaddr_resolve() and found
one more.

* Fix ast_sockaddr_resolve() memory leak in
apps/app_externalivr.c:app_exec().

* Made main/netsock2.c:ast_sockaddr_resolve() always set the addrs
parameter for safety so the pointer will never be uninitialized on return.
The same goes for res/res_pjsip_acl.c:extract_contact_addr().

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

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

10 years agomain/frame: Don't report empty disallow values as an error
Matthew Jordan [Sat, 14 Mar 2015 02:27:13 +0000 (02:27 +0000)] 
main/frame: Don't report empty disallow values as an error

In realtime, it is normal to have a database with both 'allow' and 'disallow'
columns in the schema. It is perfectly valid to have an 'allow' value of
'!all,g722,ulaw,alaw' and no 'disallow' value. Unlike in static conf files,
you can't *not* provide the disallow value. Thus, the empty disallow value
causes a spurious WARNING message, which is kind of annoying.

This patch makes it so that a 'disallow' value with no ... value ... is
ignored. Granted, you can still screw this up as well, as technically
specifying 'disallow=all,!ulaw' allows only ulaw, and then you would have no
'allow' value in your database. But really, why would you do that? WHY?

ASTERISK-16779 #close
Reported by: Atis Lezdins

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

10 years agofunc_curl: Don't hold exclusive lock when performing HTTP request.
Joshua Colp [Sat, 14 Mar 2015 01:59:31 +0000 (01:59 +0000)] 
func_curl: Don't hold exclusive lock when performing HTTP request.

This code originally kept a lock held when performing the HTTP
request to ensure that the options provided to curl remain valid.
This doesn't seem to be necessary these days and holding the lock
caused requests to happen sequentially instead of in parallel.

ASTERISK-18708 #close
Reported by: Dave Cabot

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

10 years agocore: Fix tab completion of "core set debug channel" CLI command.
Joshua Colp [Sat, 14 Mar 2015 01:36:18 +0000 (01:36 +0000)] 
core: Fix tab completion of "core set debug channel" CLI command.

The "core set debug channel" CLI command mistakenly had source filenames
added to its tab completion. This occurred because the CLI generator fell back
to the "core set debug" command which permits setting debug at a source
filename level.

ASTERISK-21038 #close
Reported by: Richard Kenner

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

10 years agoFILE: fix retrieval of file contents when offset is specified
Matthew Jordan [Sat, 14 Mar 2015 01:21:00 +0000 (01:21 +0000)] 
FILE: fix retrieval of file contents when offset is specified

The loop that reads in a file was not correctly using the offset when
determining what bytes to append to the output. This patch corrects
the logic such that the correct portion of the file is extracted when an
offset is specified.

ASTERISK-21765
Reported by: John Zhong
Tested by: Matt Jordan, Di-Shi Sun
patches:
  file_read_390821.patch uploaded by Di-Shi Sun (License 5076)

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

10 years agoapps/app_amd: Document maximum_word_length option; fix AMDCAUSE documentation
Matthew Jordan [Sat, 14 Mar 2015 00:16:56 +0000 (00:16 +0000)] 
apps/app_amd: Document maximum_word_length option; fix AMDCAUSE documentation

This patch corrects the documentation for the AMD application. Specifically:
* It documents the maximum_word_length option, which limits the maximum allowed
  length of a single utterance.
* It clarifies the AMDCAUSE values MAXWORDS and MAXWORDLENGTH. MAXWORDLENGTH
  was documented as MAXWORDS, while MAXWORDS was undocumented.

Thanks to the issue reporter, Frank DiGennaro, for pointing out the issues.

ASTERISK-19470 #close
Reported by: Frank DiGennaro

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

10 years agomain/audiohook: Update internal sample rate on reads
Matthew Jordan [Thu, 12 Mar 2015 12:57:03 +0000 (12:57 +0000)] 
main/audiohook: Update internal sample rate on reads

When an audiohook is created (which is used by the various Spy applications
and Snoop channel in Asterisk 13+), it initially is given a sample rate of
8kHz. It is expected, however, that this rate may change based on the media
that passes through the audiohook. However, the read/write operations on the
audiohook behave very differently.

When a frame is written to the audiohook, the format of the frame is checked
against the internal sample rate. If the rate of the format does not match
the internal sample rate, the internal sample rate is updated and a new SLIN
format is chosen based on that sample rate. This works just fine.

When a frame is read, however, we do something quite different. If the format
rate matches the internal sample rate, all is fine. However, if the rates
don't match, the audiohook attempts to "fix up" the number of samples that
were requested. This can result in some seriously large number of samples
being requested from the read/write factories.

Consider the worst case - 192kHz SLIN. If we attempt to read 20ms worth of
audio produced at that rate, we'd request 3840 samples (192000 / (1000 / 20)).
However, if the audiohook is still expecting an internal sample rate of 8000,
we'll attempt to "fix up" the requested samples to:

  samples_converted = samples * (ast_format_get_sample_rate(format) /
                                 (float) audiohook->hook_internal_samp_rate);

  which is:

  92160 = 3840 * (192000 / 8000)

This results in us attempting to read 92160 samples from our factories, as
opposed to the 3840 that we actually wanted. On a 64-bit machine, this
miraculously survives - despite allocating up to two buffers of length 92160
on the stack. The 32-bit machines aren't quite so lucky. Even in the case where
this works, we will either (a) get way more samples than we wanted; or (b) get
about 3840 samples, assuming the timing is pretty good on the machine.

Either way, the calculation being performed is wrong, based on the API users
expectations.

My first inclination was to allocate the buffers on the heap. As it is,
however, there's at least two drawbacks with doing this:
(1) It's a bit complicated, as the size of the buffers may change during the
    lifetime of the audiohook (ew).
(2) The stack is faster (yay); the heap is slower (boo).

Since our calculation is flat out wrong in the first place, this patch fixes
this issue by instead updating the internal sample rate based on the format
passed into the read operation. This causes us to read the correct number of
samples, and has the added benefit of setting the audihook with the right
SLIN format.

Note that this issue was caught by the Asterisk Test Suite as a result of
r432195 in the 13 branch. Because this issue is also theoretically possible
in Asterisk 11, the change is being made here as well.

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

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

10 years agoAdd support for the clang compiler; update RAII_VAR to use BlocksRuntime
Matthew Jordan [Thu, 12 Mar 2015 12:26:57 +0000 (12:26 +0000)] 
Add support for the clang compiler; update RAII_VAR to use BlocksRuntime

RAII_VAR, which is used extensively in Asterisk to manage reference counted
resources, uses a GCC extension to automatically invoke a cleanup function
when a variable loses scope. While this functionality is incredibly useful
and has prevented a large number of memory leaks, it also prevents Asterisk
from being compiled with clang.

This patch updates the RAII_VAR macro such that it can be compiled with clang.
It makes use of the BlocksRuntime, which allows for a closure to be created
that performs the actual cleanup.

Note that this does not attempt to address the numerous warnings that the clang
compiler catches in Asterisk.

Much thanks for this patch goes to:
* The folks on StackOverflow who asked this question and Leushenko for
  providing the answer that formed the basis of this code:
  http://stackoverflow.com/questions/24959440/rewrite-gcc-cleanup-macro-with-nested-function-for-clang
* Diederik de Groot, who has been extremely patient in working on getting this
  patch into Asterisk.

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

ASTERISK-24133
ASTERISK-23666
ASTERISK-20399
ASTERISK-20850 #close
Reported by: Diederik de Groot
patches:
  RAII_CLANG.patch uploaded by Diederik de Groot (License 6600)

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

10 years agores/res_config_odbc: Fix improper escaping of backslashes with MySQL
Matthew Jordan [Tue, 10 Mar 2015 21:32:25 +0000 (21:32 +0000)] 
res/res_config_odbc: Fix improper escaping of backslashes with MySQL

When escaping backslashes with MySQL, the proper way to escape the characters
in a LIKE clause is to escape the '\' four times, i.e., '\\\\'. To quote the
MySQL manual:

"Because MySQL uses C escape syntax in strings (for example, “\n” to represent
a newline character), you must double any “\” that you use in LIKE strings.
For example, to search for “\n”, specify it as “\\n”. To search for “\”,
specify it as “\\\\”; this is because the backslashes are stripped once by the
parser and again when the pattern match is made, leaving a single backslash to
be matched against."

ASTERISK-24808 #close
Reported by: Javier Acosta
patches:
  res_config_odbc.diff uploaded by Javier Acosta (License 6690)

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

10 years agoapp_voicemail: Fix crash with IMAP backends when greetings aren't present
Matthew Jordan [Tue, 10 Mar 2015 18:11:26 +0000 (18:11 +0000)] 
app_voicemail: Fix crash with IMAP backends when greetings aren't present

When an IMAP backend is in use and greetings are set to be used, but aren't
present for a user in their IMAP folder, Asterisk will crash. This occurs
due to the mailstream being set to the 'greetings' folder and being left
in that particular state, regardless of the success/failure of the attempt
to access the folder the mailstream points to. Later access of the mailstream
assumes that it points to the 'INBOX' (or some other folder), resulting in
either a crash (if the greetings folder didn't exist and the mailstream is
invalid) or an inability to read messages from the 'INBOX' folder.

This patch restores the mailstream to its correct state after accessing the
greetings. This fixes the crash, and sets the mailstream to the state that
VoiceMailMain expects.

Note that while ASTERISK-23390 also contained a patch for this issue, the
patch on ASTERISK-24786 is the one being merged here.

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

ASTERISK-23390 #close
Reported by: Ben Smithurst

ASTERISK-24786 #close
Reported by: Graham Barnett
Tested by: Graham Barnett
patches:
  app_voicemail.c.patch.SIGSEGV3rev2 uploaded by Graham Barnett (License 6685)

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

10 years agolocaltime: Fix file descriptor leak on kqueue(2) systems
Matthew Jordan [Tue, 10 Mar 2015 17:42:57 +0000 (17:42 +0000)] 
localtime: Fix file descriptor leak on kqueue(2) systems

The localtime management in the Asterisk core contains a thread that watches
for changes in the local timezone. On systems where the directory containing
/etc/localtime is modified frequently, the thread monitoring the changes will
be woken up to determine if any changes in timezone have occurred. When using
kqueue(2), this can cause a leak of file descriptors due to some improper
management of resources.

This patch updates the kqueue(2) handling in localtime, such that is no longer
leaks resources.

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

ASTERISK-24739 #close
Reported by: Ed Hynan
patches:
  11.15.0-u.diff uploaded by Ed Hynan (Licnese 6680)
  11.7.0-u.diff uploaded by Ed Hynan (License 6680)
  svn-trunk-Jan-26-2015-u.diff uploaded by Ed Hynan (License 6680)

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

10 years agochan_dahdi/sig_analog: Fix distinctive ring detection to suck less.
Richard Mudgett [Fri, 6 Mar 2015 19:52:04 +0000 (19:52 +0000)] 
chan_dahdi/sig_analog: Fix distinctive ring detection to suck less.

The distinctive ring feature interferes with detecting Caller ID and
appears to have been broken for years.  What happens is if you have a
ring-ring cadence as used in the UK you get too many DAHDI events for the
distinctive ring pattern array and Caller ID detection is aborted.  I
think when Zapata/DAHDI added the ring begin event it broke distinctive
ring.  More events happen than before and the code does no filtering of
which event times are recorded in the pattern array.

* Made distinctive ring only record the ringt count when the ring ends
instead of on just any DAHDI event.  Distinctive ring can be ring,
ring-ring, ring-ring-ring, or different ring durations for the up to three
rings.

* Fixed the distinctive ring detection enable (chan_dahdi.conf option
usedistinctiveringdetection) to be per port instead of somewhat per port
and somewhat global.  This has been broken since v1.8.

* Fixed using the default distinctive ring context when the detected
pattern does not match any configured dringX patterns.  The default
context did not get set when the previous call was a matched distinctive
ring pattern and the current call is not matched.  This has been broken
since v1.8.

* Made distinctive ring have no effect on Caller ID detection when it is
disabled.  Caller ID detection just monitors for 10 seconds before giving
up.

* Fixed leak of struct callerid_state memory when a polarity reversal
during Caller ID detection causes the incoming call to be aborted.

DAHDI-1143
AST-1545
ASTERISK-24825 #close
Reported by: Richard Mudgett

ASTERISK-17588
Reported by: Daniel Flounders

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

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

10 years agochan_sip: Fix realtime locking inversion when poking a just built peer.
Richard Mudgett [Fri, 6 Mar 2015 19:17:45 +0000 (19:17 +0000)] 
chan_sip: Fix realtime locking inversion when poking a just built peer.

When a realtime peer is built it can cause a locking inversion when the
just built peer is poked.  If the CLI command "sip show channels" is
periodically executed then a deadlock can happen because of the locking
inversion.

* Push the peer poke off onto the scheduler thread to avoid the locking
inversion of the just built realtime peer.

AST-1540
ASTERISK-24838 #close
Reported by: Richard Mudgett

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

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

10 years agoapp_voicemail: Fix compile breaking in app_voicemail with IMAP_STORAGE.
George Joseph [Thu, 5 Mar 2015 16:35:22 +0000 (16:35 +0000)] 
app_voicemail: Fix compile breaking in app_voicemail with IMAP_STORAGE.

There is a leftover "assert" in app_voicemail/__messagecount that references
variables that don't exist.  This causes the compile to fail when
--enable-dev-mode and IMAP_STORAGE are selected.

This patch removes the assert.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4461/

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

10 years agoapp_chanspy, channel: fix frame leaks
Kevin Harwell [Thu, 26 Feb 2015 17:06:01 +0000 (17:06 +0000)] 
app_chanspy, channel: fix frame leaks

Fixed a couple of frame leaks that were found during testing.

ASTERISK-24828 #close
Reported by: John Hardin
Review: https://reviewboard.asterisk.org/r/4445/

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

10 years agomake: Remove 'res_features' from libraries to link against with cygwin/mingw32
Matthew Jordan [Thu, 26 Feb 2015 04:56:28 +0000 (04:56 +0000)] 
make: Remove 'res_features' from libraries to link against with cygwin/mingw32

Both the apps and channels Makefiles still listed 'res_features' as modules to
link against when compiling for cygwin or mingw32. This module hasn't existed
for quite some time.

ASTERISK-18105 #close
Reported by: feyfre

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

10 years agochannels/chan_sip: Don't send a BYE after final response when PBX thread fails
Matthew Jordan [Thu, 26 Feb 2015 03:02:24 +0000 (03:02 +0000)] 
channels/chan_sip: Don't send a BYE after final response when PBX thread fails

When Asterisk fails to start a PBX thread for a new channel - for example, when
the maxcalls setting in asterisk.conf is exceeded - we currently send a final
response, and then attempt to send a BYE request to the UA. Since that's all
sorts of wrong, this patch fixes that by setting sipalreadygone on the sip_pvt
such that we don't get stuck sending BYE requests to something that does not
want it.

Note that this patch is a slight modification of the one on ASTERISK-15434.
For clarity, it explicitly calls sipalreadygone with the calls to transmit a
final response.

ASTERISK-21845
ASTERISK-15434 #close
Reported by: Makoto Dei
Tested by: Matt Jordan
patches:
  sip-pbxstart-failed.patch uploaded by Makoto Dei (License 5027)

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