Commit Graph

28941 Commits

Author SHA1 Message Date
zuul
1de7e0eefa Merge "tcptls: Use new certificate upon sip reload" into 14 2016-12-02 07:40:50 -06:00
Joshua Colp
7b1d990683 Merge "PJPROJECT logging: Made easier to get available logging levels." into 14 2016-12-02 05:36:49 -06:00
Joshua Colp
73f4df291c Merge "res_rtp: Fix regression when IPv6 is not available." into 14 2016-12-01 17:13:09 -06:00
zuul
194e327336 Merge "res_calendar_caldav: Add support reading gmail calendar" into 14 2016-12-01 15:23:25 -06:00
Joshua Colp
f1a7cf64e2 Merge "Frame deferral: Re-queue deferred frames one-at-a-time." into 14 2016-12-01 11:50:35 -06:00
Joshua Colp
02e3a69b07 Merge "OpenSSL 1.1.0 support" into 14 2016-12-01 05:09:04 -06:00
Guido Falsi
798179995b res_rtp: Fix regression when IPv6 is not available.
The latest Release candidate fails to create RTP streams when IPv6
is not available. Due to the changes made in September the ast_sockaddr
structure passed around to create these streams is always of AF_INET6
type, causing failure when used for IPv4. This patch adds a utility
function to check for availability of IPv6 and applies such check
at startup to determine how to create the ast_sockaddr structures.

ASTERISK-26617 #close

Change-Id: I627a4e91795e821111e1cda523f083a40d0e0c3e
2016-11-30 20:03:11 +00:00
Joshua Colp
12517ad1f3 Merge "chan_pjsip: fix switching sending codec when asymmetric_rtp_codec=no" into 14 2016-11-30 13:23:44 -06:00
Eduardo S. Libardi
e147c91a65 res_calendar_caldav: Add support reading gmail calendar
The response from gmail calendar includes the string name
"caldav:calendar-data". res_calendar_caldav implements
the example included in RFC 4791: string "C:calendar-data".
When reading the calendar, res_calendar_caldav compare the
string and if does not match just discards the event.
This commit compares the response to both strings,
successfully loading gmail calendar events.
Writing to gmail calendar is working prior to this fix.

ASTERISK-26624
Reported by: Eduardo S. Libardi

Change-Id: Ia1eef10552ae616efb645d390f5ffe81260d7d4a
2016-11-30 14:18:35 -05:00
Richard Mudgett
846c77b28c PJPROJECT logging: Made easier to get available logging levels.
Use of the new logging is as simple as issuing the new CLI command or
setting the new pjproject.conf option.

Other options that can affect the logging are how you have the pjproject
log levels mapped to Asterisk log types in pjproject.conf and if you have
configured Asterisk to log the DEBUG type messages.  Altering the
pjproject.conf level mapping shouldn't be necessary for most installations
as the default mapping is sensible.  Configuring Asterisk to log the DEBUG
message type is standard practice for collecting debug information.

* Added CLI "pjproject set log level" command to dynamically adjust the
maximum pjproject log message level.

* Added CLI "pjproject show log level" command to see the currently set
maximum pjproject log message level.

* Added pjproject.conf startup section "log_level" option to set the
initial maximum pjproject log message level so all messages could be
captured from initialization.

* Set PJ_LOG_MAX_LEVEL to 6 to compile in all defined logging levels into
bundled pjproject.  Pjproject will use the currently set run time log
level to determine if a log message is generated just like Asterisk
verbose and debug logging levels.

* In log_forwarder(), made always log enabled and mapped pjproject log
messages.  DEBUG mapped log messages are no longer gated by the current
Asterisk debug logging level.

* Removed RAII_VAR() from res_pjproject.c:get_log_level().

ASTERISK-26630 #close

Change-Id: I6dca12979f482ffb0450aaf58db0fe0f6d2e5389
2016-11-30 13:12:56 -06:00
Mark Michelson
2bc0b595a1 Frame deferral: Re-queue deferred frames one-at-a-time.
The recent change that made frame deferral into an API had a behavior
change to it. When frame deferral was completed, we would take all of
the deferred frames and queue them all onto the channel in one call to
ast_queue_frame_head(). Before frame deferral was API-ized, places that
performed manual frame deferral would actually take each deferred frame
and queue them onto the channel.

This change in behavior caused the confbridge_recording test to start
failing consistently. Without going too crazily deep into the details,
a channel was getting "stuck" in an ast_safe_sleep(). An AMI redirect
was attempting to break it out of the sleep, but because there were more
frames in the channel read queue than expected, the channel ended up
being unable to break from its sleep loop.

By restoring the behavior of individual frame queuing after deferral,
the test starts passing again.

Note, this points to a potential underlying issue pointing to an
"unbalance" that can occur when queuing multiple frames at once,
and so a follow-up issue is being created to investigate that
possibility.

Change-Id: Ied5dacacda06d343dea751ed5814a03364fe5a7d
2016-11-30 13:01:58 -05:00
Joshua Colp
36d380d71c Merge "chan_sip: Fix segfault during module unload" into 14 2016-11-30 08:13:55 -06:00
Tzafrir Cohen
0f33fa4ead OpenSSL 1.1.0 support
OpenSSL 1.1.0 includes some major changes in the interface. See
https://wiki.openssl.org/index.php/1.1_API_Changes .

Status: Right now there are still a few deprecation notes with OpenSSL
1.1.0. But it's a start.

Changes:
* CRYPTO_LOCK is no longer available. Replace it with its value for now.
  I don't completely understand what it is used for there.
* Remove several functions from libasteriskssl that seem to no longer be
  needed.
* Structures have become opaque and are accesses with accessors.
* ERR_remove_thread_state() no longer needed.
* SSLv2 code now could no longer be used in 1.1.

ASTERISK-26109 #close

Change-Id: I5e29d477d486ca29b6aae0dc2f5dff960c1cb82b
2016-11-30 08:09:13 -05:00
Alexei Gradinari
d49fbc5f4e chan_pjsip: fix switching sending codec when asymmetric_rtp_codec=no
The sending codec is switched to the receiving codec and then
is switched back to the best native codec on EVERY receiving RTP packets.
This is because after call of ast_channel_set_rawwriteformat there is call
of ast_set_write_format which calls set_format which sets rawwriteformat
to the best native format.

This patch adds a new function ast_set_write_format_path which set
specific write path on channel and uses this function to switch
the sending codec.

ASTERISK-26603 #close

Change-Id: I5b7d098f8b254ce8f45546e6c36e5d324737f71d
2016-11-30 07:55:08 -05:00
Joshua Colp
a152581464 Merge "res/res_pjsip: Fix documentation whitespace issues" into 14 2016-11-28 19:25:15 -06:00
Joshua Colp
628b69dd00 Merge "build_tools: Fix download_externals to handle certified branches" into 14 2016-11-28 16:13:59 -06:00
Matt Jordan
dc7d8037f3 res/res_pjsip: Fix documentation whitespace issues
Tabs > Spaces.

Change-Id: If1e43a71822615a898e958e0f8b2e882606f0bd0
2016-11-28 16:13:19 -05:00
George Joseph
6c15f1cac9 Merge "autoconf: more variants for OSARCH linux-gnu" into 14 2016-11-28 14:39:40 -06:00
Matt Jordan
9fe1a62f7f res_pjsip/chan_sip: Advertise 'ws' in the SIP URI transport parameter
Per RFC 7118 5.2, the SIP URI 'transport' parameter should advertise
'ws' when WebSockets are to be used as the transport. This applies to
both secure and insecure WebSockets.

There were two bugs in Asterisk with respect to this:

(1) The most egregious occurs in res_pjsip. There, we advertise 'ws' for
    insecure websockets and 'wss' for secure websockets. While this
    would seem to make sense - since 'WS' and 'WSS' are used for the Via
    Transport parameter - this is not the case for the SIP URI. This
    patch corrects that by registering the secure websockets with
    pjproject using the shorthand 'WS', and by returning 'ws' when asked
    for the transport parameter. Note that in pjproject, it is perfectly
    valid to have multiple transports use the same shorthand.

(2) In chan_sip, we return an upper-case version of the transport 'WS'
    instead of 'ws'. Since we should be strict in what we send and
    liberal in what we accept (within reason), this patch lower-cases
    the transport before appending it to the parameter.

ASTERISK-24330 #close
Reported by: cervajs, Inaki Baz Castillo

Change-Id: Iff77b645f8cc3b7cd35168a6676c26b147f22f42
2016-11-28 14:37:37 -05:00
George Joseph
a51199123f build_tools: Fix download_externals to handle certified branches
download_externals wasn't handling the "certified/13.x" version
correctly.

Change-Id: I124d195bb117ca36fd7bf1150c630f3b474a9d9a
2016-11-28 12:09:34 -05:00
Tzafrir Cohen
0169b09bee autoconf: more variants for OSARCH linux-gnu
There are quite a few odd GNU/Linux platforms. Just call all of them
linux-gnu.

Specifically this fixes building the Debian platforms mips64el and x32.
And maybe also others.

ASTERISK-26546 #close

Change-Id: I06ec4bd7f0ee1c84b6b24d81538223b07c4174b1
2016-11-28 08:00:43 -05:00
Timo Teräs
04ceef0e83 codec_dahdi: Fix poll.h include.
POSIX defines poll.h. sys/poll.h should not be used as it is c-library
internal header which may or may not exist. Notably in musl including
sys/poll.h generates warning of being incorrect.

Change-Id: Ib318c1c7142a737bcf3caa4d8d72560bebe39252
2016-11-28 12:56:45 +00:00
Michael Kuron
cbdf9cc948 chan_sip: Fix segfault during module unload
If a TCP/TLS connection was pending (not accepted and not timed out) during
unload of chan_sip, Asterisk would segfault when trying to send a signal to
a thread whose thread ID hadn't been recorded yet. This commit fixes that by
recording the thread ID before calling the blocking connect() syscall.
This was a regression introduced by 776a14386a.

The above wasn't enough to fix the segfault, which was now delayed to the
point where connect() timed out. Therefore, it was necessary to also remove
the SA_RESTART flag from the SIGURG sigaction so that pthread_kill() could be
used to interruput the connect() syscall.
This was a regression introduced by 5d313f51b9.

ASTERISK-26586 #close

Change-Id: I76fd9d47d56e4264e2629bce8ec15fecba673e7b
2016-11-26 12:18:28 -05:00
Joshua Colp
40becc5c84 Merge "addons/chan_mobile: do not use strerror_r" into 14 2016-11-23 15:32:00 -06:00
gestoip2
f8f197a6ee res_rtp_asterisk: RTT miscalculation in RTCP
When retrieving RTCP stats for PJSIP channels, RTT values are unreliable.
RTT calculation is correct, but the data representation isn't.  RTT is
represented by a 32-bit fixed-point number with the integer part in the
first 16 bits and the fractional part in the last 16 bits.  In order to
get the RTT value, the fractional part is miscalculated, there is an
unnecessary 16 bit shift that causes overflow.  Besides this there is
another mistake, when transforming the integer value to the fixed point
fractional part via bitwise operation, that loses precision.

* RTT fractional part is no longer shifted, avoiding overflow.

* RTT fractional part is transformed to its fixed-point value more
precisely.

* Fixed timeval2ntp() and ntp2timeval() second fraction conversions.

* Fixed NTP timestamp report logging.  The usec was inexplicably
multiplied by 4096.

ASTERISK-26566 #close
Reported by Hector Royo Concepcion

Change-Id: Ie09bdabfee75afb3f1b8ddfd963e5219ada3b96f
2016-11-23 11:15:25 -05:00
Michael Kuron
cc619d30bf tcptls: Use new certificate upon sip reload
Previously, a TLS server socket would only be restarted upon sip reload if the
bind address had changed. This commit adds checking for changes to TLS
parameters like certificate, ciphers, etc. so they get picked up without
requiring a reload of the entire chan_sip module. This does not affect open
connections in any way, but new connections will use the new TLS parameters.
The changes also apply to HTTP and Manager.

ASTERISK-26604 #close

Change-Id: I169e86cefc6dcd627c915134015a6a1ab1aadbe6
2016-11-22 20:18:22 +01:00
zuul
bba4204fa1 Merge "Add support for older name resolving version libraries like openBSD" into 14 2016-11-22 11:51:31 -06:00
Timo Teräs
1dc4936c38 addons/chan_mobile: do not use strerror_r
The two reasons why it might be used are that some systems do not
implement strerror in thread safe manner, and that strerror_r returns
the error code in the string in case there's no error message.

However, all of asterisk elsewhere uses strerror() and assumes it
to be thread safe. And in chan_mobile the errno is also explicitly
printed so neither of the above reasons are valid.

The reasoning to remove usage is that there are actually two versions
of strerror_r: XSI and GNU. They are incompatible in their return
value, and there's no easy way to figure out which one is being
used. glibc gives you the GNU version if _GNU_SOURCE is defined,
but the same feature test macro is needed for other symbols. On
all other systems you assumedly get XSI symbol, and compilation warnings
as well as non-working error printing.

Thus the easiest solution is to just remove strerror_r and use
strerror as rest of the code. Alternative is to introduce ast_strerror
in separate translation unit so it can request the XSI symbol in
glibc case, and replace all usage of strerror.

Change-Id: I84d35225b5642d85d48bc35fdf399afbae28a91d
2016-11-22 11:22:59 -05:00
George Joseph
34a763415f pjproject_bundled: Use $(LIB_RT) for link of libasteriskpj
libasteriskpj was hard coded to use -lrt but librt is linux specific
so we now use the LIB_RT variable which gets set by configure.

Change-Id: I41148884517e3031f7675a413d524c86e8614694
2016-11-21 11:47:45 -05:00
zuul
7ec27528b2 Merge "pjproject_bundled: Improve reliability of pjproject download" into 14 2016-11-21 06:22:09 -06:00
snuffy
729f1b63e2 Add support for older name resolving version libraries like openBSD
Fix support of OS's like openBSD that use an older nameser.h,
this change reverts the defines to the older style which on other
systems is found in nameser_compat.h

Tested on openBSD 6.0, Debian 8

ASTERISK-26608 #close

Change-Id: Iffb36caab8c5aa9dece0ce2d009041f7b56cc86a
2016-11-19 17:32:15 -05:00
Joshua Colp
002a8e4f10 Merge "main/app.c: Transmit Silence on ControlPlayback pause" into 14 2016-11-18 15:47:01 -06:00
Joshua Colp
184524a8cf Merge "Bump ARI version to 2.0.0" into 14 2016-11-18 12:35:49 -06:00
Mark Michelson
7af1aae57f Bump ARI version to 2.0.0
In order to not have version number overlap between different versions
of Asterisk, each new major version of Asterisk will mean we also bump
the ARI major version number.

This particular change does NOT introduce any known breaking changes to
ARI.

For discussion relating to this topice, see:
http://lists.digium.com/pipermail/asterisk-dev/2016-November/075964.html

Change-Id: I712ee0df177a8fe1252da2bc029705268b97b665
2016-11-18 10:56:22 -05:00
Joshua Colp
3a151b5205 Merge "build: Various OpenBSD issues" into 14 2016-11-18 08:35:57 -06:00
George Joseph
6d34d0ab36 pjproject_bundled: Improve reliability of pjproject download
The download process now has a timeout which will cause wget to retry
if it stops retrieving data for 5 seconds and fetch and curl to timeout
if the whole retrieval take smore than 30 seconds.

If the tarball retrieval works, the MD5SUM file is retrieved from
the downloads site and the md5 checksum is verified.

If either the tarball retrieval or MD5SUM retrieval fails, or the
checksums don't match, the entire process is retried once.  If it
fails again, any incomplete tarball is deleted.

.DELETE_ON_ERROR: was also added to the Makefile.  Not only does
this delete the tarball on failure, it till also delete corrupted
library files from the pjproject source directory should they
fail to build correctly.

Tested all the way back to FreeBSD 9, CentOS 6, Debian 6 and
Ubuntu 14.

Change-Id: Iea7d33b96a31622ab1b6e54baebaf271959514e1
2016-11-18 08:01:30 -05:00
misha
4e64e4f35f main/app.c: Transmit Silence on ControlPlayback pause
ASTERISK-26562 #close

Change-Id: Ie6cb0ffc2b8c775639ce7784fe96f4ea00cfa2f8
2016-11-17 12:32:16 -05:00
Mark Michelson
7a665c5c6e manager: update minor version
Based on bridge video AMI event changes, bump the minor version of AMI.

Change-Id: Idf84507354170400813cda780906c94c9f1b60b4
2016-11-17 10:52:45 -06:00
zuul
38d023c628 Merge "res_pjsip_outbound_authenticator_digest.c: Fix memory pool leak." into 14 2016-11-16 23:39:07 -06:00
George Joseph
329c554e7b Merge "res_format_attr_opus: Fix fmtp generation." into 14 2016-11-16 22:40:10 -06:00
George Joseph
54d7e65014 build: Various OpenBSD issues
OpenBSD's 'find' doesn't take the -delete argument so you have to pipe
through 'xargs rm -rf'.

'echo -e' doesn't like \t starting a line. It just prints 't' which
causes the libasteriskpj.exports file to be garbage.  They were just
cosmetic so they were removed.

librt doesn't exist so the link of libasteriskpj.so fails. It's not
actually needed for linux anyway so -lrt was removed from the link.

res_rtp_asterisk was failing to load because of an undefined
DTLS_method. '|| defined(LIBRESSL_VERSION_NUMBER)' was added to the #if
so DTLSv1_method is used instead.

ASTERISK-26608

Change-Id: I926ec95b0b69633231e3ad1d6e803b977272c49c
2016-11-16 19:24:08 -07:00
Joshua Colp
0ee5b4dbe9 Merge "codec_opus: Fix warning when Opus negotiated but codec_opus not loaded." into 14 2016-11-16 19:25:55 -06:00
George Joseph
0825528322 Revert "Revert "AGI: Only defer frames when in an interception routine.""
This reverts commit 7155020c96.

Change-Id: I4e1681d2ca8bf36eda849f129bc0dcbc39ef5bc6
2016-11-16 16:54:27 -07:00
George Joseph
6b2efc116f Revert "Revert "autoservice: Use frame deferral API""
This reverts commit 8b9996a90c.

Change-Id: Ibb2fccfc37188dc54f3776c2d5b41cc425d5cd9c
2016-11-16 16:47:12 -07:00
George Joseph
f6acb765a8 Revert "Revert "channel: Use frame deferral API for safe sleep.""
This reverts commit 97679ee846.

Change-Id: Ib68f76e75882c0230378c4fed97964988e690f3c
2016-11-16 16:46:28 -07:00
Joshua Colp
fd52740044 Merge "pjproject: Use a much higher limit for PJ_ICE_MAX_CHECKS" into 14 2016-11-16 16:56:01 -06:00
Joshua Colp
00329115e2 Merge "apps/app_echo: Only relay a single video source change frame" into 14 2016-11-16 16:55:59 -06:00
Joshua Colp
aa1482aed4 Merge "channel: Fix issues in hangup scenarios caused by frame deferral" into 14 2016-11-16 16:55:39 -06:00
Joshua Colp
caa207bc4f Merge "Revert "Revert "Add API for channel frame deferral.""" into 14 2016-11-16 16:55:32 -06:00
zuul
fdea7fe9e4 Merge "res/ari/resource_bridges: Add the ability to manipulate the video source" into 14 2016-11-16 16:48:03 -06:00