]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
10 years agores_http_websocket: Properly encode 64 bit payload 92/992/1
Mark Michelson [Wed, 29 Jul 2015 19:35:58 +0000 (14:35 -0500)] 
res_http_websocket: Properly encode 64 bit payload

A test agent was continuously failing all ARI tests when run against
Asterisk 13. As it turns out, the reason for this is that on those test
runs, for some reason we decided to use the super extended 64 bit
payload length for websocket text frames instead of the extended 16 bit
payload length. For 64-bit payloads, the expected byte order over the
network is

7, 6, 5, 4, 3, 2, 1, 0

However, we were sending the payload as

3, 2, 1, 0, 7, 6, 5, 4

This meant that we were saying to expect an absolutely MASSIVE payload
to arrive. Since we did not follow through on this expected payload
size, the client would sit patiently waiting for the rest of the payload
to arrive until the test would time out.

With this change, we use the htobe64() function instead of htonl() so
that a 64-bit byte-swap is performed instead of a 32 bit byte-swap.

Change-Id: Ibcd8552392845fbcdd017a8c8c1043b7fe35964a

10 years agoLocal channels: Alternate solution to ringback problem. 55/955/2
Mark Michelson [Thu, 23 Jul 2015 18:11:42 +0000 (13:11 -0500)] 
Local channels: Alternate solution to ringback problem.

Commit 54b25c80c8387aea9eb20f9f4f077486cbdf3e5d solved an issue where a
specific scenario involving local channels and a native local RTP bridge
could result in ringback still being heard on a calling channel even
after the call is bridged.

That commit caused many tests in the testsuite to fail with alarming
consequences, such as not sending DialBegin and DialEnd events, and
giving incorrect hangup causes during calls.

This commit reverts the previous commit and implements and alternate
solution. This new solution involves only passing AST_CONTROL_RINGING
frames across local channels if the local channel is in AST_STATE_RING.
Otherwise, the frame does not traverse the local channels. By doing
this, we can ensure that a playtones generator does not get started on
the calling channel but rather is started on the local channel on which
the ringing frame was initially indicated.

ASTERISK-25250 #close
Reported by Etienne Lessard

Change-Id: I3bc87a18a38eb2b68064f732d098edceb5c19f39

10 years agoMerge "audiohook: Read the correct number of samples based on audiohook format."...
Mark Michelson [Wed, 22 Jul 2015 18:19:14 +0000 (13:19 -0500)] 
Merge "audiohook: Read the correct number of samples based on audiohook format." into 11

10 years agoLocal channels: Do not block control -1 payloads. 49/949/1
Mark Michelson [Wed, 22 Jul 2015 14:46:29 +0000 (09:46 -0500)] 
Local channels: Do not block control -1 payloads.

Control frames with a -1 payload are used as a special signal to stop
playtones generators on channels. This indication is sent both by
app_dial as well as by ast_answer() when a call is answered in case any
tones were being generated on a calling channel.

This control frame type was made to stop traversing local channel pairs
as an optimization, because it was thought that it was unnecessary to
send these indications, and allowing such unnecessary control frames to
traverse the local channels would cause the local channels to optimize
away less quickly.

As it turns out, through some special magic dialplan code, it is
possible to have a tones being played on a non-local channel, and it is
important for the local channel to convey that the tones should be
stopped. The result of having tones continue to be played on the
non-local channel is that the tones play even once the channel has been
bridged. By not blocking the -1 control frame type, we can ensure that
this situation does not happen.

ASTERISK-25250 #close
Reported by Etienne Lessard

Change-Id: I40227e4249d6d61dc6a9b08bbe9ee3aa18be7e30

10 years agoaudiohook: Read the correct number of samples based on audiohook format. 44/944/1
Joshua Colp [Wed, 22 Jul 2015 10:16:40 +0000 (07:16 -0300)] 
audiohook: Read the correct number of samples based on audiohook format.

Due to changes in audiohooks to support different sample rates the
underlying storage of samples is in the format of the audiohook
itself and not of the format being requested. This means that if a
channel is using G722 the samples stored will be at 16kHz. If
something subsequently reads from the audiohook at a format which
is not the same sample rate as the audiohook the number of samples
needs to be adjusted.

Given the following example:
1. Channel writing into audiohook at 16kHz (as it is using G722).
2. Chanspy reading from audiohook at 8kHz.

The original code would read 160 samples from the audiohook for
each 20ms of audio. This is incorrect. Since the audio in the
audiohook is at 16kHz the actual number needing to be read is 320.
Failure to read this much would cause the audiohook to reset
itself constantly as the buffer became full.

This change adjusts the requested number of samples by determining
the duration of audio requested and then calculating how many
samples that would be in the audiohook format.

ASTERISK-25247 #close

Change-Id: Ia91ce516121882387a315fd8ee116b118b90653d

10 years agoDocumentation: chan_sip doesn't support WS or WSS in outbound register. 38/938/2
Rusty Newton [Mon, 20 Jul 2015 22:16:36 +0000 (17:16 -0500)] 
Documentation: chan_sip doesn't support WS or WSS in outbound register.

 * In sip.conf.sample fix sentence where we said that WS or WSS are supported
   transports for use in an outbound register definition. They are not
   supported in that case.

ASTERISK-24853 #close
Reported by: PSDK

Change-Id: I3d698bc6302b9d00a0a995b5c4ad9a42d69b48ca

10 years agores/res_musiconhold: Add a warning when MOH does not exist 33/933/1
Michael Cargile [Thu, 16 Jul 2015 14:13:10 +0000 (10:13 -0400)] 
res/res_musiconhold: Add a warning when MOH does not exist

Change-Id: Ifdfbd0b97cf31478d29923ec30aabce28d01740b

10 years agosig_pri.h: force_restart_unavailable_chans in wrong scope 23/923/2
Patric Marschall [Fri, 17 Jul 2015 09:59:19 +0000 (11:59 +0200)] 
sig_pri.h: force_restart_unavailable_chans in wrong scope

In channels/sig_pri.h, struct sig_pri_span, the field
force_restart_unavailable_chans is only defined if

#if defined(HAVE_PRI_MCID) is true.

All other occurences of force_restart_unavailable_chans are outside of the

#if defined(HAVE_PRI_MCID)
endif

scope.

ASTERISK-25257 #close
Reported by: Patric Marschall

Change-Id: I071de89cc2cd0d85927a013036e235851f672549

10 years agoapps/app_dictate: Fix typo in attribution 94/894/1
Matt Jordan [Wed, 15 Jul 2015 15:31:51 +0000 (10:31 -0500)] 
apps/app_dictate: Fix typo in attribution

Last time I checked, it's "Sangoma", not "Samgoma". Thanks to Brian
(GameGamer43) for pointing that out.

Change-Id: I43d7b196f6d7a2b2517b84915e3a8dfbc2894106

10 years agotests/test_devicestate: Add additional tests for the device state API 83/783/2
Matt Jordan [Sat, 27 Jun 2015 22:53:37 +0000 (17:53 -0500)] 
tests/test_devicestate: Add additional tests for the device state API

This patch adds more tests that exercise the device state API. This includes:

* Tests that cover adding a device state provider, as well as deleting a
  device state provider. This also verifies that you cannot add an
  already added device state provider, and cannot delete an already
  deleted device state provider.
* A test that covers changing device state and receiving said updates
  from a device state subscriber. This also covers hitting both the
  device state cache as well as a custom device state provider.
* A test that covers converting device state to channel state and device
  state values to a string representation and back.
* A test that covers obtaining device state from an active channel and a
  channel driver that provides its own device state.

Change-Id: I2adca67ffb405cd8625a5d6df1e3f9b3d945c08d

10 years agomain/devicestate: Prevent duplicate registration of device state providers 82/782/2
Matt Jordan [Sat, 27 Jun 2015 22:51:43 +0000 (17:51 -0500)] 
main/devicestate: Prevent duplicate registration of device state providers

Currently, the device state provider API will allow you to register a
device state provider with the same case insensitive name more than
once. This could cause strange issues, as the duplicate device state
providers will not be queried when a device's state has to be polled.
This patch updates the API such that a device state provider with the
same name as one that has already registered will be rejected.

Change-Id: I4a418a12280b7b6e4960bd44f302e27cd036ceb2

10 years agores_rtp_asterisk: Ensure DTLS timeout timer is -1 if DTLS is not used. 09/809/1
Joshua Colp [Wed, 8 Jul 2015 09:21:16 +0000 (06:21 -0300)] 
res_rtp_asterisk: Ensure DTLS timeout timer is -1 if DTLS is not used.

This change fixes a bug where the DTLS timeout timer would be
initialized to 0 if DTLS was not used for an RTP session.

ASTERISK-25103

Change-Id: If8d26bb054f1d300838850da5b8db9044c2fe2ac

10 years agores_rtp_asterisk: Prevent simultaneous access to DTLS SSL context. 86/786/3
Joshua Colp [Wed, 1 Jul 2015 12:55:47 +0000 (09:55 -0300)] 
res_rtp_asterisk: Prevent simultaneous access to DTLS SSL context.

This change moves logic for setting up the DTLS SSL contexts to
when the SDP is done being processed instead of when ICE negotiation
completes. It also stops handshakes from being initiated when we
are acting as a server.

Manipulating the SSL context when ICE negotiation has completed
is problematic as the SSL context is not protected and if acting
as a client the remote side may have started DTLS negotiation
already.

The retransmission timeout timer code has also been split up
and simplified some. Both RTP and RTCP now have their own timers
and the points at which the timer is stopped and started is now
more specific. When a packet is sent the timer is started. When
a response is received but before it is processed the timer is
stopped. This provides a guarantee that the timeout is not
occurring while the response is processed.

ASTERISK-22805 #close
ASTERISK-24550 #close
ASTERISK-24651 #close
ASTERISK-24832 #close
ASTERISK-25103 #close
ASTERISK-25127 #close

Change-Id: Ib75ea2546f29d6efc3d2d37c58df6986c7bd9b91

10 years agoMerge "chan_sip: Fix early call pickup caused deadlock." into 11
Joshua Colp [Sun, 5 Jul 2015 00:09:19 +0000 (19:09 -0500)] 
Merge "chan_sip: Fix early call pickup caused deadlock." into 11

10 years agoMerge "chan_vpb.cc: Fix compiler warning Jenkins found." into 11
Joshua Colp [Thu, 2 Jul 2015 14:47:44 +0000 (09:47 -0500)] 
Merge "chan_vpb.cc: Fix compiler warning Jenkins found." into 11

10 years agoMerge "res_timing: Don't close FD 0 when out of open files." into 11
Joshua Colp [Thu, 2 Jul 2015 12:53:28 +0000 (07:53 -0500)] 
Merge "res_timing: Don't close FD 0 when out of open files." into 11

10 years agoMerge "rtp_engine: Skip useless self-assignment in ast_rtp_engine_unload_format....
Joshua Colp [Thu, 2 Jul 2015 12:52:22 +0000 (07:52 -0500)] 
Merge "rtp_engine: Skip useless self-assignment in ast_rtp_engine_unload_format." into 11

10 years agoMerge "astfd: Fix buffer overflow in DEBUG_FD_LEAKS." into 11
Joshua Colp [Thu, 2 Jul 2015 12:51:36 +0000 (07:51 -0500)] 
Merge "astfd: Fix buffer overflow in DEBUG_FD_LEAKS." into 11

10 years agoMerge "chan_mgcp: Don't call close on fd -1." into 11
Joshua Colp [Thu, 2 Jul 2015 12:50:28 +0000 (07:50 -0500)] 
Merge "chan_mgcp: Don't call close on fd -1." into 11

10 years agochan_sip: Fix early call pickup caused deadlock. 71/771/2
Walter Doekes [Thu, 2 Jul 2015 11:25:36 +0000 (13:25 +0200)] 
chan_sip: Fix early call pickup caused deadlock.

If non-magic pickup (no "pickup-" in callid) is used, chan_sip locks the
channel it wants to pick up, and a bit further down, it locks the
channel list when allocating a new channel.

That causes a deadlock when another part of the code traverses over the
channel list, locking all the channels one by one.

This changeset fixes it by releasing the locks before calling sip_new
and reacquiring them afterwards.  Unfortunately this involves doing the
checks we already did again (because the channel may have changed).

While trying to avoid duplicate code, I did some refactoring for
readability:
- if refer_locked == 1, we guarantee there is a locked channel
- magic_callid holds a cached version of !ast_strlen_zero(pickup.exten)

This is for branch 11 only. It appears that the changed code in 13 does
not lock the components like it does in 11 and below. Reproducing the
deadlock on 13 has thusfar failed.

ASTERISK-25213 #close

Change-Id: Ie1d15bec7d634035f48892e1ed6227411d7de2c1

10 years agochan_mgcp: Don't call close on fd -1. 68/768/1
Walter Doekes [Thu, 2 Jul 2015 11:19:34 +0000 (13:19 +0200)] 
chan_mgcp: Don't call close on fd -1.

ASTERISK-25220 #close

Change-Id: Ic48f3a82f51ada87f2fb0e016c9efe0ad56f1ee3

10 years agortp_engine: Skip useless self-assignment in ast_rtp_engine_unload_format. 65/765/1
Walter Doekes [Thu, 2 Jul 2015 11:10:59 +0000 (13:10 +0200)] 
rtp_engine: Skip useless self-assignment in ast_rtp_engine_unload_format.

When running valgrind on Asterisk, it complained about:

    ==32423== Source and destination overlap in memcpy(0x85a920, 0x85a920, 304)
    ==32423==    at 0x4C2F71C: memcpy@@GLIBC_2.14 (in /usr/lib/valgrind/...)
    ==32423==    by 0x55BA91: ast_rtp_engine_unload_format (rtp_engine.c:2292)
    ==32423==    by 0x4EEFB7: ast_format_attr_unreg_interface (format.c:1437)

The code in question is a struct assignment, which may be performed by
memcpy as a compiler optimization. It is changed to only copy the struct
contents if source and destination are different.

ASTERISK-25219 #close

Change-Id: I6d3546c326b03378ca8e9b8cefd41c16e0088b9a

10 years agoastfd: Fix buffer overflow in DEBUG_FD_LEAKS. 62/762/1
Walter Doekes [Thu, 2 Jul 2015 10:16:26 +0000 (12:16 +0200)] 
astfd: Fix buffer overflow in DEBUG_FD_LEAKS.

If DEBUG_FD_LEAKS was used and more file descriptors than the default of
1024 were available, some DEBUG_FD_LEAKS-patched functions would
overwrite memory past the fixed-size (1024) fdleaks buffer.

This change:
- adds bounds checks to __ast_fdleak_fopen and __ast_fdleak_pipe
- consistently uses ARRAY_LEN() instead of sizeof() or 1023 or 1024
- stores pointers to constants instead of copying the contents
- reorders the fdleaks struct for possibly tighter packing
- adds a tiny bit of documentation

ASTERISK-25212 #close

Change-Id: Iacb69e7701c0f0a113786bd946cea5b6335a85e5

10 years agores_timing: Don't close FD 0 when out of open files. 59/759/1
Walter Doekes [Thu, 2 Jul 2015 09:57:44 +0000 (11:57 +0200)] 
res_timing: Don't close FD 0 when out of open files.

This fixes so a failure to get a timer file descriptor does not cascade
to closing FD 0.

On error, both res_timing_kqueue and res_timing_timerfd would call the
destructor before setting the file handle. The file handle had been
initialized to 0, causing FD 0 to be closed. This in turn, resulted in
floods of "CLI>" messages and an unusable terminal.

ASTERISK-19277 #close
Reported by: Barry Chern

Change-Id: I147d7e33726c6e5a2751928d56561494f5800350

10 years agochan_vpb.cc: Fix compiler warning Jenkins found. 58/758/1
Richard Mudgett [Wed, 1 Jul 2015 22:25:31 +0000 (17:25 -0500)] 
chan_vpb.cc: Fix compiler warning Jenkins found.

Change-Id: I0ec7fd10d56d90d5a60b12b5a7d6807f265ac5e0

10 years agoChannel alert pipe: improve diagnostic error return 55/755/1
Scott Griepentrog [Wed, 1 Jul 2015 18:34:46 +0000 (13:34 -0500)] 
Channel alert pipe: improve diagnostic error return

When a frame is queued on a channel, any failure in
ast_channel_alert_write is logged along with errno.

This change improves the diagnostic message through
aligning the errno value with actual failure cases.

ASTERISK-25224
Reported by: Andrey Biglari

Change-Id: I1bf7b3337ad392789a9f02c650589cd065d20b5b

10 years agoMakefile: Remove coverage files on 'make clean' 43/743/1
Matt Jordan [Sat, 27 Jun 2015 23:47:19 +0000 (18:47 -0500)] 
Makefile: Remove coverage files on 'make clean'

This patch updates a variety of Makefiles in Asterisk's build system to
remove .gcda and .gcno files when 'make clean' is executed. These files
are generated when '--enable-coverage' is passed to the Asterisk
configure script.

Change-Id: Ib70b41eea2ee2908885bff02e80faf9f40c84602

10 years agomain/pbx: Resolve case sensitivity regression in PBX hints 38/738/1
Matt Jordan [Sat, 27 Jun 2015 01:38:58 +0000 (20:38 -0500)] 
main/pbx: Resolve case sensitivity regression in PBX hints

When 8297136f was merged for ASTERISK-25040, a regression was introduced
surrounding the case sensitivity of device names within hints.
Previously, device names - such as 'sip/foo' - were compared in a case
insensitive fashion. Thus, 'sip/foo' was equivalent to 'SIP/foo'. After
that patch, only the case sensitive name would match, i.e., 'SIP/foo'.
As a result, some dialplan hints stopped working.

This patch re-introduces case insensitive matching for device names in
hints.

ASTERISK-25040

ASTERISK-25202 #close

Change-Id: If5046a7d14097e1e3c12b63092b9584bb1e9cb4c

10 years agoMerge "chan_sip: Prevent deadlock when performing BYE with Also transfer." into 11
Matt Jordan [Tue, 16 Jun 2015 14:59:31 +0000 (09:59 -0500)] 
Merge "chan_sip: Prevent deadlock when performing BYE with Also transfer." into 11

10 years agochan_sip.c: Update dialog fromtag after request with auth 32/632/6
Damian Ivereigh [Thu, 11 Jun 2015 13:18:48 +0000 (23:18 +1000)] 
chan_sip.c: Update dialog fromtag after request with auth

If a client sends and INVITE which is 401 rejected, then subsequently
sends a new INVITE with the auth info and uses a different fromtag
from the first INVITE, Asterisk will accept the new INVITE as part of
the original dialog - match_req_to_dialog() specifically ignores the
fromtag. However it does not update the stored dialog with the new
fromtag.

This results in Asterisk being unable to match future packets that are
part of this dialog (such as the ACK to the OK or the OK to the BYE),
and the call is dropped.

This problem was originally found when using an NEC-i SV8100-GE (NEC SIP
Card).

* After a successful match of a packet to the dialog, if the packet is
  not a SIP_RESPONSE, authentication is present and the fromtags are
  different, the stored fromtag is updated with the one from the recent
  INVITE.

ASTERISK-25154 #close
Reported by: Damian Ivereigh
Tested by: Damian Ivereigh

Change-Id: I5c16cf3b409e5ef9f2b2fe974b6bd2a45a6aa17e

10 years agochan_sip: Prevent deadlock when performing BYE with Also transfer. 44/644/2
Mark Michelson [Thu, 11 Jun 2015 21:44:19 +0000 (16:44 -0500)] 
chan_sip: Prevent deadlock when performing BYE with Also transfer.

When a BYE with an Also header is successfully processed, and the sender
of the BYE is bridged with another channel, chan_sip will unlock the
owner of the dialog on which the BYE was received, call ast_async_goto()
on the bridged channel, and then re-lock the owner. The reason for this
locking behavior is that ast_async_goto() can result in a masquerade,
which requires that the involved channels are unlocked.

The problem here is that this causes a locking inversion since the
dialog's lock is held when re-locking the owner channel after the async
goto. The lock order is supposed to be channel and then sip_pvt.

The fix proposed is simple. In addition to unlocking the owner channel
before the ast_async_goto() call, also unlock the sip_pvt. Then relock
both after ast_async_goto() returns, being sure to lock the channel and
then the sip_pvt.

ASTERISK-25139 #close
Reported by Gregory Massel

Change-Id: I72c4fc295ec8573bee599e8e9213c5350a3cd224

10 years agoMerge "weakref attribute detection broken with gcc 4.6 and higher" into 11
Joshua Colp [Wed, 10 Jun 2015 17:13:17 +0000 (12:13 -0500)] 
Merge "weakref attribute detection broken with gcc 4.6 and higher" into 11

10 years agoFix unsafe uses of ast_context pointers. 81/481/3
Corey Farrell [Sun, 17 May 2015 04:04:16 +0000 (00:04 -0400)] 
Fix unsafe uses of ast_context pointers.

Although ast_context_find, ast_context_find_or_create and
ast_context_destroy perform locking of the contexts table,
any context pointer can become invalid at any time that the
contexts table is unlocked. This change adds locking around
all complete operations involving these functions.

Places where ast_context_find was followed by ast_context_destroy
have been replaced with calls ast_context_destroy_by_name.

ASTERISK-25094 #close
Reported by: Corey Farrell

Change-Id: I1866b6787730c9c4f3f836b6133ffe9c820734fa

10 years agoCLI: Cosmetic issue - core show uptime 86/586/2
ibercom [Thu, 4 Jun 2015 12:14:13 +0000 (14:14 +0200)] 
CLI: Cosmetic issue - core show uptime

Show uptime information ends with an unnecessary space.

Now NEEDCOMMA is better defined.

Change-Id: I11b360504a0703309ff51772ff8f672287f3c5a1

10 years agoweakref attribute detection broken with gcc 4.6 and higher 74/574/4
ibercom [Wed, 3 Jun 2015 00:06:46 +0000 (02:06 +0200)] 
weakref attribute detection broken with gcc 4.6 and higher

GCC 4.7 Manual:
http://gcc.gnu.org/onlinedocs/gcc-4.7.4/gcc/Function-Attributes.html

weakref ("target")

A weak reference is an alias that does not by itself require a definition
to be given for the target symbol.

ASTERISK-22559 #close
Reported by: Ibercom

Change-Id: I36a136cae947b65187a697533416f9ff9a0b8cdf

10 years agoFix buffer overflow in slin sample frames generation. 56/556/1
Ivan Poddubny [Sun, 31 May 2015 16:33:37 +0000 (19:33 +0300)] 
Fix buffer overflow in slin sample frames generation.

The length of frames retured by sample functions was twice as large as
real, what caused global buffer overflow caught by AddressSanitizer.

ASTERISK-24717 #close
Reported by: Badalian Vyacheslav

Change-Id: Iec2fe682aef13e556684912f906bedf7c18229c6

10 years agoAstobj2: Correctly treat hash_fn returning INT_MIN 32/532/3
Ivan Poddubny [Sun, 24 May 2015 18:47:16 +0000 (21:47 +0300)] 
Astobj2: Correctly treat hash_fn returning INT_MIN

The code in astobj2_hash.c wrongly assumed that abs(int) is always > 0.
However, abs(INT_MIN) = INT_MIN and is still negative, as well as
abs(INT_MIN) % num_buckets, and as a result this led to a crash.

One way to trigger the bug is using host=::80 or 0.0.0.128 in peer
configuration section in chan_sip or chan_iax.

This patch takes the remainder before applying abs, so that bucket
number is always in range.

ASTERISK-25100 #close
Reported by: Mark Petersen

Change-Id: Id6981400ad526f47e10bcf7b847b62bd2785e899

10 years agoMerge "audiohook.c: Difference in read/write rates caused continuous buffer resets...
Matt Jordan [Thu, 21 May 2015 12:22:07 +0000 (07:22 -0500)] 
Merge "audiohook.c: Difference in read/write rates caused continuous buffer resets" into 11

10 years agoMerge "Logger: Reset defaults before processing config." into 11
Matt Jordan [Thu, 21 May 2015 12:21:50 +0000 (07:21 -0500)] 
Merge "Logger: Reset defaults before processing config." into 11

10 years agoLogger: Reset defaults before processing config. 02/502/1
Corey Farrell [Thu, 21 May 2015 01:53:46 +0000 (21:53 -0400)] 
Logger: Reset defaults before processing config.

Reset options to default values before reloading config.  This ensures
that if a setting is removed or commented out of the configuration file
it is unset on reload.

ASTERISK-25112 #close
Reported by: Corey Farrell

Change-Id: Id24bb1fb0885c2c14cf8bd6f69a0c2ee7cd6c5bd

10 years agochan_sip/sdp_crypto.c: allow SDP crypto tag to be up to 9 digits 97/497/2
Corey Edwards [Wed, 20 May 2015 19:45:37 +0000 (13:45 -0600)] 
chan_sip/sdp_crypto.c: allow SDP crypto tag to be up to 9 digits

ASTERISK-24887 #close
Reported by: Makoto Dei
Tested by: tensai

Change-Id: I6a96f572adb17f76b3acafe503a01c48eb5dd9bf

10 years agoaudiohook.c: Difference in read/write rates caused continuous buffer resets 62/462/6
Kevin Harwell [Thu, 14 May 2015 20:13:58 +0000 (15:13 -0500)] 
audiohook.c: Difference in read/write rates caused continuous buffer resets

Currently, everytime a sample rate change occurs (on read or write) the
associated factory buffers are reset. If the requested sample rate on a
read differed from that of a write then the buffers are continually reset
on every read and write. This has the side effect of emptying the buffer,
thus there being no data to read and then write to a file in the case of
call recording.

This patch fixes it so that an audiohook_list's rate always maintains the
maximum sample rate among hooks and formats. Audiohook sample rates are
only overwritten by this value when slin native compatibility is turned on.
Also, the audiohook sample rate can only overwrite the list's sample rate
when its rate is greater than that of the list or if compatibility is
turned off. This keeps the rate from constantly switching/resetting.

ASTERISK-24944 #close
Reported by: Ronald Raikes

Change-Id: Idab4dfef068a7922c09cc631dda27bc920a6c76f

10 years agoMessage.c: Clear message channel frames on cleanup 70/470/1
Jonathan Rose [Wed, 13 May 2015 20:41:07 +0000 (15:41 -0500)] 
Message.c: Clear message channel frames on cleanup

The message channel is a special channel that doesn't actually process frames.
However, certain actions can cause frames to be placed in the channel's read
queue including the Hangup application which is called on the channel after
each message is processed. Since the channel will continually be reused for
many messages, it's necessary to flush these frames at some point.

ASTERISK-25083 #close
Reported by: Jonathan Rose

Change-Id: Idf18df73ccd8c220be38743335b5c79c2a4c0d0f

10 years agoMerge "main/manager.c: Bugfix sort action_manager by alphabetically" into 11
Joshua Colp [Thu, 14 May 2015 10:03:16 +0000 (05:03 -0500)] 
Merge "main/manager.c: Bugfix sort action_manager by alphabetically" into 11

10 years agoMerge "General: Fix recent menuselect-related cross compile regression" into 11
Joshua Colp [Wed, 13 May 2015 19:21:51 +0000 (14:21 -0500)] 
Merge "General: Fix recent menuselect-related cross compile regression" into 11

10 years agoMerge "chan_dahdi/sig_pri: Fix crash on ISDN call hangup collision." into 11
Joshua Colp [Wed, 13 May 2015 17:55:08 +0000 (12:55 -0500)] 
Merge "chan_dahdi/sig_pri: Fix crash on ISDN call hangup collision." into 11

10 years agoMerge "res_config_mysql: Fix broken column type checking" into 11
Joshua Colp [Wed, 13 May 2015 17:26:19 +0000 (12:26 -0500)] 
Merge "res_config_mysql: Fix broken column type checking" into 11

10 years agomain/manager.c: Bugfix sort action_manager by alphabetically 58/458/1
Rodrigo Ramírez Norambuena [Tue, 5 May 2015 01:11:56 +0000 (21:11 -0400)] 
main/manager.c: Bugfix sort action_manager by alphabetically

Fix the alphabetic order added on ast_manager_register_struct. The order
for struct manager_action added is not working, this change fixes the
problem.

Change-Id: I149da0cd06c3c4445d7516cc303358e9f26f8b4b

10 years agores_config_mysql: Fix broken column type checking 55/455/1
Alexandre Fournier [Fri, 8 May 2015 23:01:26 +0000 (01:01 +0200)] 
res_config_mysql: Fix broken column type checking

MySQL configuration engine contains a bug in require_mysql(). This
function is used for column type checking in tables. This bug only
affects DATETIME, DATE and FLOAT types.

It came from mixing the first condition (switch-case-like
if/then/else), to check the expected column type, with the second
condition, to check the actual column type against the expected column
type. Both conditions must be checked separately in order to avoid the
execution of the wrong block.

ASTERISK-18252 #comment This patch might fix the issue
Reported by: Gareth Blades

ASTERISK-25041 #close
Reported by: Alexandre Fournier
Tested by: Alexandre Fournier

Change-Id: I0b8bf7e68ab938be8e6525a249260cb648cb0bfa

10 years agores_rtp_asterisk: Correction for the limit which detects that a packet is DTLS. 52/452/1
Yousf Ateya [Sun, 10 May 2015 12:37:54 +0000 (14:37 +0200)] 
res_rtp_asterisk: Correction for the limit which detects that a packet is DTLS.

First byte of DTLS packet shall be in range 20-63, not 20-64. Refer to RFC
https://tools.ietf.org/html/rfc5764#section-5.1.2 for correct values.

Change-Id: Iae6fa0d72b37c36a27fe40686e0ae6fba3afec31

10 years agoMerge "cdr_pgsql: Use PQescapeStringConn for escaping names." into 11
Joshua Colp [Wed, 13 May 2015 09:36:34 +0000 (04:36 -0500)] 
Merge "cdr_pgsql: Use PQescapeStringConn for escaping names." into 11

10 years agochan_dahdi/sig_pri: Fix crash on ISDN call hangup collision. 45/445/1
Richard Mudgett [Tue, 12 May 2015 22:34:45 +0000 (17:34 -0500)] 
chan_dahdi/sig_pri: Fix crash on ISDN call hangup collision.

If an ISDN call is hungup by both sides at the same time a crash could
happen.

* Added missing NULL checks for the owner channel after calling
pri_queue_pvt_cause_data() in two places.  Code after those calls need to
check the owner channel pointer for NULL before use because
pri_queue_pvt_cause_data() needs to do deadlock avoidance to lock the
owner and the owner may get hung up.

ASTERISK-21893 #close
Reported by:  Alexandr Gordeev

Change-Id: Ica3e266ebc7a894b41d762326f08653e1904bb9a

10 years agoGeneral: Fix recent menuselect-related cross compile regression 44/444/1
Sebastian Kemper [Sun, 10 May 2015 07:26:30 +0000 (09:26 +0200)] 
General: Fix recent menuselect-related cross compile regression

MAKE_MENUSELECT currently sets CC to CC, which is the compiler for the
target platform. But menuselect is to be run on the build system, so
BUILD_CC needs to be used instead - like it was in the past, before the
recent changes (https://reviewboard.asterisk.org/r/4370/). This is the
patch for ASTERISK-25074.

ASTERISK-25074 #close
Reported by: Sebastian Kemper
Tested by: Sebastian Kemper

Change-Id: I8a2b1fc5deb6ad2b80f49baca35b1b13d468ebf8

10 years agoMerge "Fix processing of asterisk.conf debug=yes." into 11
Joshua Colp [Tue, 12 May 2015 16:57:01 +0000 (11:57 -0500)] 
Merge "Fix processing of asterisk.conf debug=yes." into 11

10 years agoFix processing of asterisk.conf debug=yes. 37/437/2
Corey Farrell [Tue, 12 May 2015 06:31:58 +0000 (02:31 -0400)] 
Fix processing of asterisk.conf debug=yes.

The code which reads asterisk.conf supports processing the debug
option with ast_true, but ast_true returns -1.  This causes debug
to still be off, convert to 1 so debug will be on as requested.

ASTERISK-25042
Reported by: Corey Farrell

Change-Id: I3c898b7d082d914b057e111b9357fde46bad9ed6

10 years agocdr_pgsql: Use PQescapeStringConn for escaping names. 40/440/1
Rodrigo Ramírez Norambuena [Sat, 2 May 2015 04:43:22 +0000 (00:43 -0400)] 
cdr_pgsql: Use PQescapeStringConn for escaping names.

Use function PQescapeStringConn for escaping the name
of the table and schema instead of doing it manually.

Change-Id: I6709165e2d00463e9c813d24f17830ad4910b599

10 years agopbx/pbx_spool: Fix issue when call files were executed too early 34/434/2
Ivan Poddubny [Mon, 11 May 2015 12:07:31 +0000 (12:07 +0000)] 
pbx/pbx_spool: Fix issue when call files were executed too early

pbx_spool used to delete/move the call file upon successful outgoing
call completion, but did not delete it from in-memory list of files
(dirlist, used only when compiled with inotify/kqueue support).
That resulted in an extra attempt to process that filename after
retrytime seconds.
Then, if a new file with the same name appears that is scheduled
in future further than the completed one plus its retrytime,
then it gets executed earlier than expected.

This patch fixes remove_from_queue function to also remove the entry
from the dirlist.

ASTERISK-17069 #close
Reported by: Jeremy Kister

ASTERISK-24442 #close
Reported by: tootai

Change-Id: If9ec9b88073661ce485d6b008fd0b2612e49a28b

10 years agoMerge "tcptls: Avoiding ERR_remove_state in OpenSSL." into 11
Matt Jordan [Fri, 8 May 2015 20:55:38 +0000 (15:55 -0500)] 
Merge "tcptls: Avoiding ERR_remove_state in OpenSSL." into 11

10 years agoMerge "res_rtp_asterisk: Issue ERROR if res_srtp is not found." into 11
Matt Jordan [Fri, 8 May 2015 20:54:53 +0000 (15:54 -0500)] 
Merge "res_rtp_asterisk: Issue ERROR if res_srtp is not found." into 11

10 years agores_rtp_asterisk: Issue ERROR if res_srtp is not found. 08/408/3
Sean Bright [Fri, 8 May 2015 15:39:42 +0000 (15:39 +0000)] 
res_rtp_asterisk: Issue ERROR if res_srtp is not found.

While trying to get WebRTC working with chan_pjsip, I was running
into the following error:

    Attempted to set an invalid DTLS-SRTP configuration on RTP
    instance...

Josh helpfully pointed out that res_srtp.so might not be loaded, and
sure enough, it wasn't. This patch adds a ERROR indiciating as much
to hopefully help others having a similar problem.

Change-Id: I13aa477b47b299876728a21b130998a0ea6cd19f

10 years agosounds: Add Swedish sounds to Makefile and XML 13/413/1
Rusty Newton [Thu, 7 May 2015 22:49:07 +0000 (17:49 -0500)] 
sounds: Add Swedish sounds to Makefile and XML

Added the necessary lines to the Makefile and sounds.xml so we'll have the
Swedish sounds in all available formats in menuselect.

See also: Swedish sounds were added into the core sounds release 1.4.27.

ASTERISK-24744 #close

Reported by: Tove Hjelm
Tested by: Rusty Newton

Change-Id: Ib6f4fd177afd1667b2402735034001d4d055a908

10 years agotcptls: Avoiding ERR_remove_state in OpenSSL. 06/406/1
Alexander Traud [Tue, 5 May 2015 16:35:16 +0000 (18:35 +0200)] 
tcptls: Avoiding ERR_remove_state in OpenSSL.

ERR_remove_state was deprecated with OpenSSL 1.0.0 and was replaced by
ERR_remove_thread_state. ERR_load_SSL_strings and ERR_load_BIO_strings were
called by SSL_load_error_strings already and got removed. These changes allow
OpenSSL forks like BoringSSL to be used with Asterisk.

ASTERISK-25043 #close
Reported by: Alexander Traud
patches:
  asterisk_with_BoringSSL.patch uploaded by Alexander Traud (License 6520)

Change-Id: If1c0871ece21a7e0763fafbd2fa023ae49d4d629
(cherry picked from commit 247fef66537b59649e7571d64e2c574a106dbd65)

10 years agodoc: Make progdocs play nice with git 02/402/2
George Joseph [Thu, 7 May 2015 19:54:35 +0000 (13:54 -0600)] 
doc: Make progdocs play nice with git

Moved contrib/asterisk-ng-doxygen to doc/asterisk-ng-doxygen.in

Changed /Makefile to copy asterisk-ng-doxygen.in to
asterisk-ng-doxygen then modify it with version instead of
modifying asterisk-ng-doxygen directly.  Updated clean
targets as well.

Updated /.gitignore and doc/.gitignore.

Change-Id: I38712d3e334fa4baec19d30d05de8c6f28137622

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