Commit graph

28969 commits

Author SHA1 Message Date
Joshua Colp
b1f7cc4223 Merge "Add support for older name resolving version libraries like openBSD" 2016-11-22 11:54:35 -06:00
George Joseph
abae3dc36e 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:48:05 -05:00
zuul
aa9d91c290 Merge "pjproject_bundled: Improve reliability of pjproject download" 2016-11-21 06:22:07 -06:00
Joshua Colp
84e508c999 Merge "main/app.c: Transmit Silence on ControlPlayback pause" 2016-11-21 04:46:37 -06:00
zuul
120a4999f0 Merge "Add support for building RADIUS with radcli" 2016-11-20 22:57:12 -06:00
snuffy
b546497fe0 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-20 09:19:18 +11:00
Mark Michelson
7a8d6bc81b 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:31 -05:00
zuul
782985631e Merge "build: Various OpenBSD issues" 2016-11-18 08:31:46 -06:00
George Joseph
d3f070c7a2 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:36 -05:00
Joshua Colp
98b3b500dc Merge "manager: update minor version" 2016-11-18 06:58:11 -06:00
misha
e822a50f86 main/app.c: Transmit Silence on ControlPlayback pause
ASTERISK-26562 #close

Change-Id: Ie6cb0ffc2b8c775639ce7784fe96f4ea00cfa2f8
2016-11-17 12:32:29 -05:00
Joshua Colp
d3dba74017 Merge "Implement internal abstraction for iostreams" 2016-11-17 11:07:06 -06:00
Mark Michelson
d670ea6297 manager: update minor version
Based on bridge video AMI event changes, bump the minor version of AMI.

Change-Id: Idf84507354170400813cda780906c94c9f1b60b4
2016-11-17 11:53:33 -05:00
Timo Teräs
349e08cb48 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-17 16:26:21 +02:00
Joshua Colp
ed143a3b7c Merge "res_pjsip_outbound_authenticator_digest.c: Fix memory pool leak." 2016-11-17 04:56:34 -06:00
Joshua Colp
09d1958448 Merge "codec_opus: Fix warning when Opus negotiated but codec_opus not loaded." 2016-11-17 04:56:16 -06:00
zuul
8fbdedb36e Merge "res_format_attr_opus: Fix fmtp generation." 2016-11-16 23:20:04 -06:00
George Joseph
935f5d003b 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 21:31:54 -05:00
George Joseph
97b2ba472d Merge "channel: Fix issues in hangup scenarios caused by frame deferral" 2016-11-16 17:45:16 -06:00
George Joseph
b8e91bb9cc Merge "Revert "Revert "channel: Use frame deferral API for safe sleep.""" 2016-11-16 17:45:05 -06:00
George Joseph
99e97154bb Merge "Revert "Revert "autoservice: Use frame deferral API""" 2016-11-16 17:44:22 -06:00
George Joseph
013e7dd4a6 Merge "Revert "Revert "AGI: Only defer frames when in an interception routine.""" 2016-11-16 17:44:12 -06:00
George Joseph
ac0a1ee6da Merge "Revert "Revert "Add API for channel frame deferral.""" 2016-11-16 17:43:46 -06:00
zuul
d0474f6322 Merge "res/ari/resource_bridges: Add the ability to manipulate the video source" 2016-11-16 16:48:09 -06:00
Mark Michelson
dc8f99ee27 res_format_attr_opus: Fix fmtp generation.
res_format_attr_opus assumed that the string being passed into it was
empty. It tried to determine if the only thing it had written was

a=fmtp:<num>

And if it had, it would reset the string. Its calculation was off when
working with chan_sip, though. chan_sip passes the entire built SDP
rather than an empty string. This resulted in always putting an empty
fmtp line in the SDP.

ASTERISK-26520 #close
Reported by scgm11

Change-Id: Ib2e8712d26a47067e5f36d5973577added01dbb5
2016-11-16 16:49:04 -05:00
Joshua Colp
732ab6a045 Merge "apps/app_echo: Only relay a single video source change frame" 2016-11-16 14:59:50 -06:00
George Joseph
89e79a487a Merge "file.c/__ast_file_read_dirs: Fix issues on filesystems without d_type" 2016-11-16 14:17:34 -06:00
Richard Mudgett
ed9ced0531 codec_opus: Fix warning when Opus negotiated but codec_opus not loaded.
When Opus is negotiated but not loaded, the log is spammed with messages
because the system does not know how to calculate the number of samples in
a frame.

* Suppress the warning by supplying a function that assumes 20ms of
samples in the frame.  For pass through support it doesn't really seem to
matter what number of samples is returned anyway.

ASTERISK-26605 #close

Change-Id: Icf2273692f040dc2c45b01e72a790d11092f9e0f
2016-11-16 14:56:18 -05:00
Joshua Colp
1c26117dff Merge "cli: Fix ast_el_read_char to work with libedit >= 3.1" 2016-11-16 12:18:27 -06:00
Richard Mudgett
0cd0e70c16 res_pjsip_outbound_authenticator_digest.c: Fix memory pool leak.
Responding to authentication challenges leaks PJSIP memory pools.

The leak was introduced with a pjproject 2.5.5 API change.
https://trac.pjsip.org/repos/ticket/1929 changed the API usage of
pjsip_auth_clt_init() to require the new API pjsip_auth_clt_deinit() to
clean up cached authentication allocations that get allocated with
pjsip_auth_clt_reinit_req().

ASTERISK-26516 #close

Change-Id: I4473141b8c3961d0dc91c382beb3876b3efb45c8
2016-11-16 13:03:25 -05:00
Joshua Colp
24d35ff74a Merge "pjproject: Use a much higher limit for PJ_ICE_MAX_CHECKS" 2016-11-16 05:33:42 -06:00
George Joseph
3017f09f22 file.c/__ast_file_read_dirs: Fix issues on filesystems without d_type
One of the code paths in __ast_file_read_dirs will only get executed if
the OS doesn't support dirent->d_type OR if the filesystem the
particular file is on doesn't support it.  So, while standard Linux
systems support the field, some filesystems like XFS do not.  In this
case, we need to call stat() to determine whether the directory entry
is a file or directory so we append the filename to the supplied
directory path and call stat.  We forgot to truncate path back to just
the directory afterwards though so we were passing a complete file name
to the callback in the dir_name parameter instead of just the directory
name.

The logic has been re-written to only create a full_path if we need to
call stat() or if we need to descend into another directory.

Change-Id: I54e4228bd8355fad65200c6df3ec4c9c8a98dfba
2016-11-15 21:21:59 -05:00
Joshua Colp
6911f9891f Merge "manager: Bump AMI version number." 2016-11-15 19:23:08 -06:00
Joshua Colp
ceefe483cf Merge "res_ari: Add support for channel variables in ARI events." 2016-11-15 14:49:15 -06:00
Timo Teräs
070a51bf7c Implement internal abstraction for iostreams
fopencookie/funclose is a non-standard API and should not be used
in portable software. Additionally, the way FILE's fd is used in
non-blocking mode is undefined behaviour and cannot be relied on.

This introduces internal abstraction for io streams, that allows
implementing the desired virtualization of read/write operations
with necessary timeout handling.

ASTERISK-24515 #close
ASTERISK-24517 #close

Change-Id: Id916aef418b665ced6a7489aef74908b6e376e85
2016-11-15 22:25:14 +02:00
Joshua Colp
d3b61a98f4 manager: Bump AMI version number.
During the development of Asterisk 14 the behavior of
the Command AMI action was altered such that the result
was returned on lines with a prefix of "Output: ". While
this was documented in the UPGRADE.txt file it is also
reasonable that this should bump the AMI version number.

ASTERISK-26556

Change-Id: Idf1bf01608e53f7bfdf43ddb4d0683e53f74ee42
2016-11-15 10:03:11 -05:00
Matt Jordan
edd7ae85e8 pjproject: Use a much higher limit for PJ_ICE_MAX_CHECKS
The PJ_ICE_MAX_CHECKS constant is used by pjproject to determine how
many pairs of local/remote candidates will be made. If for some reason
we reach this upper bound, ICE will generally fail and no media will
flow between the browser and Asterisk.

This patch makes PJ_ICE_MAX_CHECKS set to the total possible number of
pairs of candidates we'd theoretically allow, which is
PJ_ICE_MAX_CAND^2. Prior to this patch, we simply multiplied
PJ_ICE_MAX_CAND by two; on systems with multiple interfaces (I blame
Docker), this is far too low to allow WebRTC calls to succeed.

Setting this to be PJ_ICE_MAX_CAND^2 allowed WebRTC calls to succeed
even when the system Asterisk was running on had quite a few virtual
interfaces.

Change-Id: Icd4f17de0ac9d3a83dddfc8bf1cb7616bc107d55
2016-11-14 17:03:50 -05:00
Matt Jordan
cc86329228 apps/app_echo: Only relay a single video source change frame
In 9785e8d0, app_echo was updated to relay video source updates to the
channel for the purposes of displaying video in WebRTC tests.
Unfortunately, this can cause a Kafkaesque nightmare if two or more
Local channels are in a bridge together where their ends are in
app_echo. When this situation occurs, a video update sent into app_echo
will cause the video update to be relayed to the other Local channels,
causing another round of video updates, etc. In not much time at all,
the channel length queues will be overwhelmed, channel alert pipes will
fail, and all hell will break loose as Asterisk merrily continues to
throw more video update requests onto the channels.

This patch updates app_echo to *only* relay a single video update. Once
a video update has been made, all further video updates are dropped.
This meets the intended purpose of the original patch: if we get a video
update and we're in app_echo, go ahead and ask the sender to update
themselves. However, once we've got that video stream sync'd up, don't
keep spamming the world.

Change-Id: I9210780b08d4c17ddb38599d1c64453adfc34f74
2016-11-14 17:03:32 -05:00
Matt Jordan
a72ef38113 res/ari/resource_bridges: Add the ability to manipulate the video source
In multi-party bridges, Asterisk currently supports two video modes:
 * Follow the talker, in which the speaker with the most energy is shown
   to all participants but the speaker, and the speaker sees the
   previous video source
 * Explicitly set video sources, in which all participants see a locked
   video source

Prior to this patch, ARI had no ability to manipulate the video source.
This isn't important for two-party bridges, in which Asterisk merely
relays the video between the participants. However, in a multi-party
bridge, it can be advantageous to allow an external application to
manipulate the video source.

This patch provides two new routes to accomplish this:
(1) setVideoSource: POST /bridges/{bridgeId}/videoSource/{channelId}
    Sets a video source to an explicit channel
(2) clearVideoSource: DELETE /bridges/{bridgeId}/videoSource
    Removes any explicit video source, and sets the video mode to talk
    detection

ASTERISK-26595 #close

Change-Id: I98e455d5bffc08ea5e8d6b84ccaf063c714e6621
2016-11-14 17:03:09 -05:00
George Joseph
7263a17ca0 channel: Fix issues in hangup scenarios caused by frame deferral
ASTERISK-26343

Change-Id: I06dbf7366e26028251964143454a77d017bb61c8
(cherry picked from commit 0be46aaf6b)
2016-11-14 13:18:11 -07:00
George Joseph
0dc4567133 Revert "Revert "channel: Use frame deferral API for safe sleep.""
This reverts commit e5365dada5.

Change-Id: Icc40cf0c7687454760762912dd29e4ae79e8e9ee
2016-11-14 14:15:12 -06:00
George Joseph
6d61f7bfd1 Revert "Revert "autoservice: Use frame deferral API""
This reverts commit edca6911f3.

Change-Id: I76030b87333a2c390cd05392b74b75678d78ddfa
2016-11-14 14:14:50 -06:00
George Joseph
f62c9c42fa Revert "Revert "AGI: Only defer frames when in an interception routine.""
This reverts commit 6bce938c2f.

Change-Id: Iadbf462bf2a52e8b2fa9ebc75b37b1f688ba51d9
2016-11-14 14:14:28 -06:00
George Joseph
2966fa5ad7 Revert "Revert "Add API for channel frame deferral.""
This reverts commit fa749866c1.

Change-Id: Idcd1b88fa0766b1326dcc87d8905dbc314c71bd7
2016-11-14 13:06:03 -07:00
Joshua Colp
d1739bcf07 Merge "res_pjsip.c: Rework endpt_send_request() req_wrapper code." 2016-11-14 13:21:22 -06:00
Sebastien Duthil
c6d755de11 res_ari: Add support for channel variables in ARI events.
This works the same as for AMI manager variables. Set
"channelvars=foo,bar" in your ari.conf general section, and then the
channel variables "foo" and "bar" (along with their values), will
appear in every Stasis websocket channel event.

ASTERISK-26492 #close
patches:
  ari_vars.diff submitted by Mark Michelson

Change-Id: I5609ba239259577c0948645df776d7f3bc864229
2016-11-14 13:51:56 -05:00
George Joseph
72da2ef9ff cli: Fix ast_el_read_char to work with libedit >= 3.1
Libedit 3.1 is not build with unicode on as a default and so the
prototype for the el_gets callback changed from expecting a char buffer
to accepting a wchar buffer.  If ast_el_read_char isn't changed,
the cli reads garbage from teh terminal.

Added a configure test for (*el_rfunc_t)(EditLine *, wchar_t *) and
updated ast_el_read_char to use the HAVE_ define to detemrine whether
to use char or wchar.

ASTERISK-26592 #close

Change-Id: I9099b46f68e06d0202ff80e53022a2b68b08871a
2016-11-14 13:20:38 -05:00
Tzafrir Cohen
97a75e3829 Add support for building RADIUS with radcli
Radcli is yet another RADIUS client library, generally compatible with
freeradius and radiusclient-ng.

This commit adds autoconf option for detecting it as well and changes
cdr_radius and cel_radius to use its header file in that case.

ASTERISK-26540 #close

Change-Id: I271f0715406334874865ffbce0b354b3a2ca148f
2016-11-14 19:40:03 +02:00
Joshua Colp
7540036427 Merge "res_pjsip: Fix tdata leaks in off nominal paths." 2016-11-14 06:47:37 -06:00
Joshua Colp
94f317b99a Merge "Fix closing rtp ports after call finished in chan_unistim." 2016-11-14 06:38:18 -06:00