Commit graph

30284 commits

Author SHA1 Message Date
Corey Farrell
adb4fdcb7b stasis: Release object if vector append fails.
Change-Id: I3e5cc669169aab6175ddfaf7486edeaeb4fdcfb1
2017-11-06 16:33:00 -05:00
Corey Farrell
2f4f216026 RTP Engine: Deal with errors returned from AST_VECTOR_REPLACE.
Check for errors from AST_VECTOR_REPLACE and clean memory if needed.

Change-Id: I124d15cc1d645f85a72a1279f623c1993b304b0b
2017-11-06 16:20:06 -05:00
Corey Farrell
5762f72425 PBX: Handle errors from AST_VECTOR_APPEND.
This resolves potentials leaks on AST_VECTOR_APPEND error in:
* ast_context_add_include2
* ast_context_add_switch2
* ast_context_add_ignorepat2

Change-Id: Ib60e95c4f622fa3b832d87227c0523a695d736b6
2017-11-06 16:16:35 -05:00
Corey Farrell
714026b32e Messaging: Report error on failure to register tech or handler.
Message tech and handler registrations use a vector which could fail to
expand.  If it does log and error and return error.

Change-Id: I593a8de81a07fb0452e9b0efd5d4018b77bca6f4
2017-11-06 16:10:56 -05:00
Corey Farrell
e43c8af77c format_cap: Fix leak on AST_VECTOR_APPEND error.
format_cap_framed_init can fail on AST_VECTOR_APPEND.  This should
report failure to the caller and clean the newly allocated frame.

Change-Id: Ica0661235bf09497bf23d844ceb01f21b41a55b0
2017-11-06 16:07:01 -05:00
Corey Farrell
64bcb65a78 stasis: Remove silly use of RAII_VAR in stasis_forward_all.
Change-Id: I46de4c968d40144d5b049966304ff66c1469fb65
2017-11-06 15:23:46 -05:00
Corey Farrell
b7e1034009 CLI: Remove unused internal command.
The internal CLI command "_command complete" was last used by Asterisk
0.2.0.  Since then we've been using "_command nummatches" and "_command
matchesarray".

Change-Id: I682fe1e21a24a3bb5bd04146e639f1c5866bcfce
2017-11-06 13:51:32 -05:00
Joshua Colp
637b37fb98 Merge "dtls: Add support for ephemeral DTLS certificates." 2017-11-06 12:22:38 -06:00
Richard Mudgett
923424019b stasis_bridges.c: Fix off-nominal json memory leaks.
Change-Id: Ib1181a36b317c86bff1ef2e44a17a0b1c73cfdc8
2017-11-06 13:11:04 -05:00
Richard Mudgett
f81970d3fc stasis_channels.c: Remove a very silly RAII_VAR().
Change-Id: I28b458b3c1a442c4ef0be7b4986a95ea4149e14f
2017-11-06 13:06:56 -05:00
Joshua Colp
36fedea8c1 res_pjsip_pubsub: Ensure remote URI contains URI only.
This change makes it so that any user of the pubsub
API that requests the remote URI receives only the URI.
Previously the entire string was returned, which could
contain a display name.

ASTERISK-27290

Change-Id: If1d0cd6630f0a264856d31d2a67933109187a017
2017-11-06 13:02:43 -05:00
Joshua Colp
3126c396b1 Merge "install_prereq: Checkout of libSRTP 2.x." 2017-11-06 11:57:58 -06:00
Richard Mudgett
9771f089f5 stasis/app.c: Optimize stasis_app_get_debug_by_name()
* Eliminate RAII_VAR()
* Short circuit application name lookup if global debug enabled.

Change-Id: I5f78b7bd6ca7fd2c3b07cbbe036c6a93b4681123
2017-11-06 12:50:23 -05:00
Richard Mudgett
ee08f10d06 Fix ast_(v)asprintf() malloc failure usage conditions.
When (v)asprintf() fails, the state of the allocated buffer is undefined.
The library had better not leave an allocated buffer as a result or no one
will know to free it.  The most likely way it can return failure is for an
allocation failure.  If the printf conversion fails then you actually have
a threading problem which is much worse because another thread modified
the parameter values.

* Made __ast_asprintf()/__ast_vasprintf() set the returned buffer to NULL
on failure.  That is much more useful than either an uninitialized pointer
or a pointer that has already been freed.  Many uses won't have to check
for failure to ensure that the buffer won't be double freed or prevent an
attempt to free an uninitialized pointer.

* stasis.c: Fixed memory leak in multi_object_blob_to_ami() allocated by
ast_asprintf().

* ari/resource_bridges.c:ari_bridges_play_helper(): Remove assignment to
the wrong thing which is now not needed even if assigning to the right
thing.

Change-Id: Ib5252fb8850ecf0f78ed0ee2ca0796bda7e91c23
2017-11-06 12:47:30 -05:00
Joshua Colp
21d408a942 Merge "configure: Add autoconf check for libopusfile." 2017-11-06 10:38:18 -06:00
Joshua Colp
68b6ebd836 Merge "Prevent unload of modules which implement an Optional API." 2017-11-06 10:11:51 -06:00
Joshua Colp
ac7ec5026c Merge "Add missing menuselect dependencies." 2017-11-06 09:26:18 -06:00
Sean Bright
ca4e6b568f res_pjsip: Ignore empty TLS configuration
When using realtime, fields that are not explicitly set by an
administrator are still presented to sorcery as empty strings. Handle
this case explicitly.

In this particular case, if any of these fields are required for TLS
support, their existence should be validated in the 'apply' handler once
we have a complete transport definition.

ASTERISK-27032 #close
Reported by: seanchann.zhou

Change-Id: Ie3b5fb421977ccdb33e415d4ec52c3fd192601b7
2017-11-06 09:15:40 -05:00
Joshua Colp
3c6fe0545a Merge "Stasis/ARI: Fix off-nominal path json memory leaks." 2017-11-06 08:15:03 -06:00
Joshua Colp
036bbe2d3f Merge "AOC: Fix AOC-S json memory leak." 2017-11-06 07:51:36 -06:00
Joshua Colp
1ee2907a16 Merge "res_stasis_mailbox.c: Fix leak of mailbox container." 2017-11-06 07:17:22 -06:00
Sean Bright
04d3785a79 dtls: Add support for ephemeral DTLS certificates.
This mimics the behavior of Chrome and Firefox and creates an ephemeral
X.509 certificate for each DTLS session.

Currently, the only supported key type is ECDSA because of its faster
generation time, but other key types can be added in the future as
necessary.

ASTERISK-27395

Change-Id: I5122e5f4b83c6320cc17407a187fcf491daf30b4
2017-11-06 08:11:48 -05:00
Joshua Colp
052d26c169 Merge "Build System: Fix build failure caused by recent CLI improvements." 2017-11-06 06:31:28 -06:00
Corey Farrell
4013bfa52b configure: Add autoconf check for libopusfile.
This check is being added to make it easier for end-users of third party
open source Opus modules.  This was removed by ASTERISK-26426 but only
the module needed to be removed.

Change-Id: I62b9cd0c4fa8a77596ab0e042948a643a1152677
2017-11-06 04:34:34 -05:00
Alexander Traud
19332e6968 tcptls: Print notice when TLS is enabled but not configured.
Asterisk can be compiled without a SSL/TLS library, without the Development
Headers of OpenSSL. However, if TLS (SIP) or Secure-WebSockets (WebRTC) was
enabled in a configuration file, Asterisk did not notice the user. Asterisk
failed silently, only the corresponding TCP ports were not open.

ASTERISK-27394
Reported-by: mossley74

Change-Id: Ib8b7539a5b2af8154c22e5f7a40fc68f95d95b93
2017-11-06 10:18:24 +01:00
Alexander Traud
2ebea5aa03 install_prereq: Checkout of libSRTP 2.x.
Since Asterisk 13.17, libSRTP 2.x is supported. Therefore, its latest version
is installed again via the script install_prereq.

ASTERISK-27356

Change-Id: I13125839a79052356469e41edacbebff0a937d39
2017-11-04 12:05:36 +01:00
Richard Mudgett
79ddcdbc70 Stasis/ARI: Fix off-nominal path json memory leaks.
Change-Id: Id569c624c426e3b22a99936473c730592d8b83fb
2017-11-03 13:14:07 -05:00
Richard Mudgett
229790ea3d AOC: Fix AOC-S json memory leak.
Change-Id: I3a1d40a41a8a7d00fa4a187de6a343a79155d3ef
2017-11-03 12:58:49 -05:00
Richard Mudgett
de4a4796d0 res_stasis_device_state.c: Optimize stasis_app_device_states_to_json()
* Eliminate RAII_VAR()
* Replace looped alloca with a char[] since that is how it is used anyway.

Change-Id: Ia27e64a884afa0f50b9ffdb1cf23da6bfa51ffdf
2017-11-03 12:43:11 -05:00
Richard Mudgett
103b05bb4b res_stasis_mailbox.c: Fix leak of mailbox container.
Change-Id: I7d33c1635713047e7d1597c9d882f7dc006d94b4
2017-11-03 12:18:08 -05:00
Corey Farrell
290bad22c9 Build System: Fix build failure caused by recent CLI improvements.
We use the editline library to help with filename completion in our CLI
interface.  Some systems failed to find the header when included from
loader.c.  This is fixed by setting the proper CFLAGS for the build of
loader.o.

ASTERISK-27378

Change-Id: Ib7fd496f1d7ed48141a2eadd5dd61cab2f2308be
2017-11-03 11:35:34 -04:00
Joshua Colp
325b5dd30f Merge "res_pjsip: Add to list of valid characters for from_user." 2017-11-03 09:06:47 -05:00
Joshua Colp
306e7912db Merge "Modules: Additional improvements to CLI completion." 2017-11-03 07:55:27 -05:00
Joshua Colp
2cafa4ef88 Merge "res/ari/resource_bridges.h: Update from 'make ari-stubs'." 2017-11-02 14:08:41 -05:00
Ben Ford
f8e0f9be22 res_pjsip: Add to list of valid characters for from_user.
Fixes a regression where some characters were unable to be used in
the from_user field of an endpoint. Additionally, the backtick was
removed from the list of valid characters, since it is not valid,
and it was replaced with a single quote, which is a valid character.

ASTERISK-27387

Change-Id: Id80c10a644508365c87b3182e99ea49da11b0281
2017-11-02 11:49:53 -05:00
Joshua Colp
7a75abdf13 Merge "core: Don't attempt to write to a stream that does not exist." 2017-11-02 11:09:41 -05:00
Joshua Colp
8701479386 core: Don't attempt to write to a stream that does not exist.
When a frame is provided to ast_write ensure that a multistream
capable channel has a stream for it before attempting to give it
to the channel driver. In some cases (such as a deferred SDP
negotiation) the stream may not yet exist.

ASTERISK-27364

Change-Id: Icf84ca982a67cdd6e9a71851eb7eb1bd0e865276
2017-11-02 05:37:48 -05:00
Corey Farrell
606ae3484a Add missing menuselect dependencies.
This adds menuselect dependencies for modules that use symbols of other
modules.

ASTERISK-27390

Change-Id: Ia2d2849f5b87a72af7324a82edc3f283eafb5385
2017-11-02 02:57:52 -04:00
Corey Farrell
b616b7e4a9 res/ari/resource_bridges.h: Update from 'make ari-stubs'.
A comment was updated when I ran 'make ari-stubs'.

Change-Id: Ib5154ae3ad72aff53374c28ead540fe349c42175
2017-11-01 23:00:00 -05:00
Corey Farrell
79f111e1f3 Prevent unload of modules which implement an Optional API.
Once an Optional API module is loaded it should stay loaded.  Unloading
an optional API module runs the risk of a crash if something else is
using it.  This patch causes all optional API providers to tell the
module loader not to unload except at shutdown.

ASTERISK-27389

Change-Id: Ia07786fe655681aec49cc8d3d96e06483b11f5e6
2017-11-01 20:46:11 -04:00
Corey Farrell
b9f457eac0 Modules: Additional improvements to CLI completion.
Replace 'needsreload' argument with a 'type' argument to specify which
type of modules you want completion.  This provides more accurate CLI
completion for load and unload commands.

* 'module unload' now excludes modules that have active references or are
  not running.
* 'module load' now excludes modules that are already running.
* 'core set debug [atleast] <level> [module]' shows running modules only.

ASTERISK-27378

Change-Id: Iea3e00054461484196c46f688f02635cc886bad1
2017-11-01 19:37:09 -04:00
Sean Bright
1bfd1cf640 pjsip_message_filter: Only do interface lookup for wildcard addresses.
Change-Id: Ie083987e69dc43b6861671c218cacacc11b2072f
2017-11-01 13:59:17 -05:00
Joshua Colp
64f1294ef2 Merge "features: Bridge application's BRIDGERESULT not appropriately set" 2017-11-01 09:22:17 -05:00
Joshua Colp
0036a00775 Merge "res_ari_channels: Fix reference leak in channel_state_invalid." 2017-11-01 07:42:08 -05:00
Kevin Harwell
1e70011710 features: Bridge application's BRIDGERESULT not appropriately set
The dialplan application "Bridge" was not setting the BRIDGERESULT to failure
when a failure did occur. Even worse if it did fail to join the bridge it would
still report success.

This patch now sets the BRIDGERESULT variable to an appropriate value for a
given condition state. Also, removed the value INCOMPATIBLE as a valid result
type since it is no longer used.

ASTERISK-27369 #close

Change-Id: I22588e7125a765edf35cff28c98ca143e9927554
2017-10-31 15:25:28 -05:00
Joshua Colp
df18445b98 Merge "Build System: Fix --disable-xmldoc option." 2017-10-31 15:14:53 -05:00
Corey Farrell
f2175c5a39 res_ari_channels: Fix reference leak in channel_state_invalid.
channel_state_invalid leaked a reference to the channel snapshot any
time it was aquired.

ASTERISK-27067 #close

Change-Id: I8c653f00416b39978513c5605c4be0f03b1df29a
2017-10-31 13:43:32 -05:00
Joshua Colp
491c8054f2 Merge "core / pjsip: Add support for grouping streams together." 2017-10-31 13:27:40 -05:00
Joshua Colp
d05391ed55 Merge "ast_coredumper: allow setting asterisk binary explicitly" 2017-10-31 06:48:16 -05:00
Joshua Colp
92b3ed4d32 Merge "Modules: Fix issues with CLI completion." 2017-10-30 17:18:59 -05:00