Commit Graph

29401 Commits

Author SHA1 Message Date
Richard Mudgett
593f789563 stasis_bridges.c: Fix off-nominal json memory leaks.
Change-Id: Ib1181a36b317c86bff1ef2e44a17a0b1c73cfdc8
2017-11-06 12:09:27 -06:00
Joshua Colp
56e32ca355 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 18:00:38 +00:00
Richard Mudgett
6bc8af2433 stasis_channels.c: Remove a very silly RAII_VAR().
Change-Id: I28b458b3c1a442c4ef0be7b4986a95ea4149e14f
2017-11-06 11:58:57 -06:00
Richard Mudgett
33d02f5090 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 11:49:41 -06:00
Richard Mudgett
9013415593 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 11:46:06 -06:00
Jenkins2
ad7860fd19 Merge "install_prereq: Checkout of libSRTP 2.x." into 13 2017-11-06 11:29:23 -06:00
Jenkins2
55001ea31e Merge "configure: Add autoconf check for libopusfile." into 13 2017-11-06 11:05:55 -06:00
Jenkins2
0eee42626a Merge "Prevent unload of modules which implement an Optional API." into 13 2017-11-06 09:41:29 -06:00
Jenkins2
19c9200429 Merge "Add missing menuselect dependencies." into 13 2017-11-06 08:46:22 -06:00
Joshua Colp
1479d2603e Merge "Stasis/ARI: Fix off-nominal path json memory leaks." into 13 2017-11-06 08:39:20 -06:00
Sean Bright
250c173cfb 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:10 -05:00
Jenkins2
6e34cf6af7 Merge "AOC: Fix AOC-S json memory leak." into 13 2017-11-06 07:19:41 -06:00
Jenkins2
22602ec7dd Merge "res_stasis_mailbox.c: Fix leak of mailbox container." into 13 2017-11-06 06:27:29 -06:00
Jenkins2
686d11837e Merge "Build System: Fix build failure caused by recent CLI improvements." into 13 2017-11-06 05:58:51 -06:00
Alexander Traud
7dd2b18e32 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 04:28:13 -05:00
Corey Farrell
b5331af53b 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:21:12 -05:00
Alexander Traud
5f4197735d 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 06:08:44 -05:00
Richard Mudgett
3bce5a9dfa Stasis/ARI: Fix off-nominal path json memory leaks.
Change-Id: Id569c624c426e3b22a99936473c730592d8b83fb
2017-11-03 13:08:33 -05:00
Richard Mudgett
675e50b903 AOC: Fix AOC-S json memory leak.
Change-Id: I3a1d40a41a8a7d00fa4a187de6a343a79155d3ef
2017-11-03 12:51:02 -05:00
Richard Mudgett
4ea61eef94 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:40:53 -05:00
Richard Mudgett
8ec2db7084 res_stasis_mailbox.c: Fix leak of mailbox container.
Change-Id: I7d33c1635713047e7d1597c9d882f7dc006d94b4
2017-11-03 12:14:09 -05:00
Corey Farrell
d3cfcc0da6 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 10:39:38 -05:00
Joshua Colp
543d8ee388 Merge "res_pjsip: Add to list of valid characters for from_user." into 13 2017-11-03 08:11:59 -05:00
Jenkins2
a1d6920745 Merge "Modules: Additional improvements to CLI completion." into 13 2017-11-03 07:46:19 -05:00
Ben Ford
ffcb7e2a25 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:48:05 -05:00
Corey Farrell
bfb0f27c87 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-02 07:31:20 -05:00
Corey Farrell
7c35740ba1 Add missing menuselect dependencies.
This adds menuselect dependencies for modules that use symbols of other
modules.

ASTERISK-27390

Change-Id: Ia2d2849f5b87a72af7324a82edc3f283eafb5385
2017-11-02 03:11:32 -04:00
Corey Farrell
73a5e9f0e9 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 21:07:15 -04:00
Sean Bright
d524ad523d pjsip_message_filter: Only do interface lookup for wildcard addresses.
Change-Id: Ie083987e69dc43b6861671c218cacacc11b2072f
2017-11-01 14:59:13 -04:00
Kevin Harwell
a7c00707a5 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:08:38 -05:00
Jenkins2
ae2687494a Merge "ast_coredumper: allow setting asterisk binary explicitly" into 13 2017-10-31 07:00:50 -05:00
Jenkins2
71d3f2cb90 Merge "Build System: Fix --disable-xmldoc option." into 13 2017-10-31 06:17:48 -05:00
Jenkins2
6b14200093 Merge "Modules: Fix issues with CLI completion." into 13 2017-10-30 17:04:04 -05:00
Jenkins2
a87391cfcb Merge "app_agent_spool: Fix typo in dtmf features usage desctiption" into 13 2017-10-30 11:25:35 -05:00
Jenkins2
835db751e1 Merge "ast_coredumper: Add gzipping of binaries and display of signal info" into 13 2017-10-30 10:19:55 -05:00
Tzafrir Cohen
1b535d8457 ast_coredumper: allow setting asterisk binary explicitly
Adds an extra option, --asterisk-bin=<path> to ast_coredumper. If
provided, the binary given to gdb will be the parameter, rather than
asterisk from the PATH.

ASTERISK-27380 #close

Change-Id: I25f5b91eb75059b0fb2f142e468c26b283b0a9f3
2017-10-30 09:58:48 -05:00
Corey Farrell
cee81b3c8b Modules: Fix issues with CLI completion.
* Stop using ast_module_helper to check if a module is loaded, use
  ast_module_check instead (app_confbridge and app_meetme).
* Stop ast_module_helper from listing reload classes when needsreload
  was not requested.

ASTERISK-27378

Change-Id: Iaed8c1e4fcbeb242921dbac7929a0fe75ff4b239
2017-10-30 00:40:12 -05:00
Igor Goncharovskiy
8436f1d35a app_agent_spool: Fix typo in dtmf features usage desctiption
Fix typo, that specify usage wrong option 'dtmf-features' for CHANNEL() function
instead of correct 'dtmf_features'

ASTERISK-27377 #close

Change-Id: I15ecc829c1035b359584673e12cdb5c9291ac930
2017-10-29 06:18:21 +06:00
Corey Farrell
987b16e8f9 res_pjsip_pubsub: Resolve potential crash in allocate_subscription.
When allocate_subscription fails to initialize fields of the new sub it
calls destroy_subscription.

Change-Id: I5b79c915ec216dc00c13c1e4172137864a4bec85
2017-10-27 13:53:30 -05:00
Joshua Colp
2e5e7e0b14 Merge "codec.c: Defensively check the returned samples." into 13 2017-10-27 09:05:53 -05:00
Jenkins2
a1467ab7bc Merge "app_voicemail.c: Fix compiler warning with IMAP build." into 13 2017-10-27 08:28:43 -05:00
Joshua Colp
40d30cd70e Merge "res_pjsip: Add 'ip' as a valid option to 'identify_by' on endpoint." into 13 2017-10-26 18:28:13 -05:00
Richard Mudgett
2db97ee219 app_voicemail.c: Fix compiler warning with IMAP build.
ASTERISK-27181

Change-Id: Ic4468b49860bd7f67e922baf4c9e96828c184d17
2017-10-26 12:18:00 -05:00
Richard Mudgett
ca7f3d297b codec.c: Defensively check the returned samples.
Earlier versions of the codec_opus samples_count callback can return
negative error values on undecodable frames.  This resulted in a divide by
zero exception.

* Added a defensive check in ast_codec_samples_count() for a "negative"
samples count return value.  Log the event and set the count to zero.

ASTERISK-27194

Change-Id: Icf69350307ecbbc80a3d74de46af9bd80ea17819
2017-10-26 11:48:23 -05:00
Joshua Colp
7385d1e017 res_pjsip: Add 'ip' as a valid option to 'identify_by' on endpoint.
When the identify_by option on an endpoint is set to ip it will
only be identified using the res_pjsip_endpoint_identifier_ip module.
This ensures that it is not mistakenly matched using the username of
the From header. To ensure behavior has not changed the default has
been changed to "username,ip" for the identify_by option.

ASTERISK-27206

Change-Id: I2170b86a7f7e221b4f00bf14aa1ef1ac5b050bbd
2017-10-25 18:13:26 +00:00
Joshua Colp
28368b3553 Merge "http.c: Fix http header send content." into 13 2017-10-25 12:42:09 -05:00
George Joseph
3f7ad66245 ast_coredumper: Add gzipping of binaries and display of signal info
The --tarball-coredump option now creates a gzipped tarball of
coredumps processed, their results txt files and copies of
/etc/os-release, /usr/sbin/asterisk, /usr/lib(64)/libasterisk* and
/usr/lib(64)/asterisk as those files are needed to properly examine
the coredump.  The file will be named
/tmp/asterisk.<timestamp>.coredumps.tar.gz or
/tmp/asterisk-<uniqueid>.coredumps.tar.gz if --tarball-uniqueid was
specified.

Added dumps of *_siginfo to the top of the txt files so you can
tell what signal was invoked.

Change-Id: Ib9ee6d83592d4b1bc90cb3419a05376a88d1ded9
2017-10-25 11:26:06 -06:00
Corey Farrell
4772849016 Build System: Fix --disable-xmldoc option.
The configure option to disable XML documentation does not currently
work.  This patch makes it effective, but also causes an ABI change by
removing the ast_xmldoc_* symbols.  Disabling xmldoc also prevents docs
from being automatically generated, but they can still be manually
generated with 'make doc/core-en_US.xml'.

ASTERISK-26639

Change-Id: Ifac562340c09f80c83e0203de098fcac93bf8c44
2017-10-25 10:26:16 -05:00
Ben Ford
dfe00b80e7 http.c: Fix http header send content.
Currently ast_http_send barricades a portion of the content that
needs to be sent in order to establish a connection for things
like the ARI client. The conditional and contents have been changed
to ensure that everything that needs to be sent, will be sent.

ASTERISK-27372

Change-Id: I8816d2d8f80f4fefc6dcae4b5fdfc97f1e46496d
2017-10-25 10:18:33 -05:00
Joshua Colp
cf63db7217 Merge "chan_sip: Fix SUBSCRIBE with missing "Expires" header." into 13 2017-10-25 07:44:17 -05:00