Commit Graph

28715 Commits

Author SHA1 Message Date
Kevin Harwell
c3f94de2be Update for 14.2.1 2016-12-08 12:32:42 -05:00
Kevin Harwell
4c222dc1cf Merge "res_format_attr_opus: Fix crash when fmtp contains spaces." into 14.2 2016-12-08 11:06:46 -06:00
Walter Doekes
dad046539e chan_sip: Do not allow non-SP/HTAB between header key and colon.
RFC says SIP headers look like:

    HCOLON  =  *( SP / HTAB ) ":" SWS
    SWS     =  [LWS]                    ; sep whitespace
    LWS     =  [*WSP CRLF] 1*WSP        ; linear whitespace
    WSP     =  SP / HTAB                ; from rfc2234

chan_sip implemented this:

    HCOLON  =  *( LOWCTL / SP ) ":" SWS
    LOWCTL  = %x00-1F                   ; CTL without DEL

This discrepancy meant that SIP proxies in front of Asterisk with
chan_sip could pass on unknown headers with \x00-\x1F in them, which
would be treated by Asterisk as a different (known) header.  For
example, the "To\x01:" header would gladly be forwarded by some proxies
as irrelevant, but chan_sip would treat it as the relevant "To:" header.

Those relying on a SIP proxy to scrub certain headers could mistakenly
get unexpected and unvalidated data fed to Asterisk.

This change fixes so chan_sip only considers SP/HTAB as valid tokens
before the colon, making it agree on the headers with other speakers of
SIP.

ASTERISK-26433 #close
AST-2016-009

Change-Id: I78086fbc524ac733b8f7f78cb423c91075fd489b
(cherry picked from commit 98a82190fb)
2016-12-08 09:57:42 -06:00
Joshua Colp
680404f666 res_format_attr_opus: Fix crash when fmtp contains spaces.
When an opus offer or answer was received that contained an
fmtp line with spaces between the attributes the module would
fail to properly parse it and crash due to recursion.

This change makes the module handle the space properly and
also removes the recursion requirement.

ASTERISK-26579

Change-Id: I01f53e5d9fa9f1925a7365f8d25071b5b3ac2dc3
2016-12-08 09:55:50 -06:00
Kevin Harwell
37cde9225d Update for 14.2.0 14.2.0 2016-11-23 10:47:57 -05:00
Kevin Harwell
d6c9df8b03 Update for 14.2.0-rc2 14.2.0-rc2 2016-11-22 13:52:52 -05:00
George Joseph
fc5e21ec67 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
(cherry picked from commit 34a763415f)
2016-11-22 13:35:43 -05:00
Joshua Colp
ff947c4827 Update for 14.2.0-rc1 14.2.0-rc1 2016-11-18 14:05:57 -05: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
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
Mark Michelson
d6783e8fd1 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:48:59 -05:00
George Joseph
42254406ad Merge "cli: Fix ast_el_read_char to work with libedit >= 3.1" into 14 2016-11-16 14:15:21 -06:00
Richard Mudgett
d89a1645fc 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:09 -05:00
Richard Mudgett
fb05acbb32 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:14 -05:00
George Joseph
d6f9e2b54a 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:28 -05:00
zuul
69bf9a01cd Merge "manager: Bump AMI version number." into 14 2016-11-15 19:08:03 -06:00
Joshua Colp
617b43cdaa Merge "res_ari: Add support for channel variables in ARI events." into 14 2016-11-15 13:49:51 -06:00
Joshua Colp
f1359c7dc8 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 15:02:32 +00:00
Matt Jordan
fb9b867d7d 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 15:57:08 -06:00
Matt Jordan
46bedcbbad 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 15:56:45 -06:00
Matt Jordan
62cbcb2e54 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 15:56:45 -06:00
George Joseph
ac6051c302 channel: Fix issues in hangup scenarios caused by frame deferral
ASTERISK-26343

Change-Id: I06dbf7366e26028251964143454a77d017bb61c8
(cherry picked from commit 0be46aaf6b)
(cherry picked from commit 7263a17ca0)
(cherry picked from commit ebf8d94eb2)
2016-11-14 13:47:14 -07:00
George Joseph
88111da235 Revert "Revert "Add API for channel frame deferral.""
This reverts commit b640f18a44.

Change-Id: I4ad8e7f66b3e6457ac07e7965822ae39ac08464d
2016-11-14 13:44:43 -07:00
zuul
2401e27023 Merge "res_pjsip.c: Rework endpt_send_request() req_wrapper code." into 14 2016-11-14 13:08:58 -06:00
Sebastien Duthil
eb5077fb26 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 14:00:54 -05:00
George Joseph
e2046bfaf3 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 11:16:03 -07:00
Joshua Colp
223ce4890c Merge "Fix closing rtp ports after call finished in chan_unistim." into 14 2016-11-14 07:35:18 -06:00
Joshua Colp
2fcb86d374 Merge "res_pjsip: Fix tdata leaks in off nominal paths." into 14 2016-11-14 07:12:41 -06:00
Igor Goncharovskiy
ba09e7a23f Fix closing rtp ports after call finished in chan_unistim.
Fix ASTERISK-26565 by adding ast_rtp_instance_stop before
rtp instance destroy for chan_unistim. Also several fixes
for displayed text translation.

Change-Id: If42a03eea09bd1633471406bdc829cf98bf6affc
2016-11-11 23:01:47 -05:00
Joshua Colp
cc4a2c8c76 res_pjsip_sdp_rtp: Reject offer of required SRTP without res_srtp.
When optimistic SRTP was on it was possible for us to still
set up a call without an audio stream if an offer was received
with required SRTP.

This change makes it so this scenario will now fail with a 488
response.

ASTERISK-26575

Change-Id: I7d14187037681f48879bd20319ac79d0877318f3
2016-11-11 08:17:47 -05:00
Joshua Colp
bb32bb3939 Merge "res_pjsip: Perform resolution when explicit IPv6 transport is used." into 14 2016-11-11 04:37:07 -06:00
Joshua Colp
bb0a172902 Merge "build: Fix default values for some SANITIZER options" into 14 2016-11-11 04:36:52 -06:00
Richard Mudgett
d36695e0bb res_pjsip.c: Rework endpt_send_request() req_wrapper code.
* Don't hold the req_wrapper lock too long in endpt_send_request().  We
could block the PJSIP monitor thread if the timeout timer expires.
sip_get_tpselector_from_endpoint() does a sorcery access that could take
awhile accessing a database.  pjsip_endpt_send_request() might take awhile
if selecting a transport.

* Shorten the time that the req_wrapper lock is held in the callback
functions.

* Simplify endpt_send_request() req_wrapper->timeout code.

* Removed some redundant req_wrapper->timeout_timer->id assignments.

Change-Id: I3195e3a8e0207bb8e7f49060ad2742cf21a6e4c9
2016-11-10 17:19:11 -05:00
Richard Mudgett
add253cbd0 res_pjsip: Fix tdata leaks in off nominal paths.
Change-Id: Ie83e06e88c2d60157775263b07e40b61718ac97b
2016-11-10 17:15:48 -05:00
Richard Mudgett
49dd637047 res_pjsip_registrar_expire.c: Remove extra linefeed in debug message.
Change-Id: I1f9adb911f23376503396ec8867e8005b755eb94
2016-11-10 16:59:30 -05:00
Joshua Colp
119e1fd6cf res_pjsip: Perform resolution when explicit IPv6 transport is used.
This change fixes the SIP resolver such that if an IPv6 transport
is explicitly used it will resolve NAPTR, SRV, and AAAA records.

You can explicitly use one by specifying it on an endpoint.

ASTERISK-26571

Change-Id: I2ed3ce81b43a6a8a937c0ebc1b8ed2da5ac2ef36
2016-11-10 15:10:56 +00:00