Commit Graph

29574 Commits

Author SHA1 Message Date
Joshua Colp
40f906add4 Merge "res_pjsip: Avoid crash when contact uri is empty string" into 13 2017-11-07 12:04:41 -06:00
Richard Mudgett
7ad4c19b20 res_pjsip_registrar.c: Fix named AOR and pjproject group deadlock.
One of the patches for ASTERISK_27147 introduced a deadlock regression.
When the connection oriented transport shut down, the code attempted to
remove the associated contact.  However, that same transport had just
requested a registration that we hadn't responded to yet.  Depending
upon timing we could deadlock.

* Made send the REGISTER response after we completed processing the
request contacts and released the named AOR lock to avoid the deadlock.

ASTERISK-27391

Change-Id: I89a90f87cb7a02facbafb44c75d8845f93417364
2017-11-07 12:00:24 -06:00
Jenkins2
8824ed44dc Merge "res_pjsip: Ignore empty TLS configuration" into 13 2017-11-07 10:29:42 -06:00
Corey Farrell
c1a608f862 res_stasis: Fix multiple leaks.
* res/stasis/app.c JSON passed to app_send needs to be released.
* res/stasis_message.c: objects leak if vector append fails.

Change-Id: I8dd5385b9f50a5cadf2b1d16efecffd6ddb4db4a
2017-11-07 11:24:51 -05:00
Joshua Colp
5d19dc2cb1 Merge "tcptls: Print notice when TLS is enabled but not configured." into 13 2017-11-07 09:42:34 -06:00
Aaron An
d95bfcd013 res_pjsip: Avoid crash when contact uri is empty string
Asterisk will crash if contact uri is invalid, so contact_apply_handler
should check if the uri is NULL or empty.

ASTERISK-27393 #close
Reported-by: Aaron An
Tested-by: AaronAn

Change-Id: Ia0309bdc6b697c73c9c736e1caec910b77ca69f5
2017-11-07 10:33:06 -05:00
Joshua Colp
315ccf40f4 Merge "stasis: Remove silly use of RAII_VAR in stasis_forward_all." into 13 2017-11-07 08:52:39 -06:00
Jenkins2
ec40b74e51 Merge "stasis_channels.c: Remove a very silly RAII_VAR()." into 13 2017-11-07 08:09:07 -06:00
Jenkins2
01064bd6bc Merge "stasis/app.c: Optimize stasis_app_get_debug_by_name()" into 13 2017-11-07 07:32:58 -06:00
Richard Mudgett
ec58521a48 res_pjproject.c: Fix ast_strdup() alloc failure.
Change-Id: I74688038e7afe3a279359cce53aadb28ade51ead
2017-11-07 07:10:27 -06:00
Jenkins2
37863c163c Merge "Fix ast_(v)asprintf() malloc failure usage conditions." into 13 2017-11-07 06:41:50 -06:00
Jenkins2
36b5a66c27 Merge "RTP Engine: Deal with errors returned from AST_VECTOR_REPLACE." into 13 2017-11-07 06:06:01 -06:00
Corey Farrell
69af7eb663 res_pjsip_outbound_registration: Fix leak on vector add failure.
Change-Id: I774b88b3c9da41edd4dc8d78f095481f52f2bd46
2017-11-06 18:56:33 -05:00
Corey Farrell
4f75655cb6 res_pjsip_config_wizard: Fix leaks and add check for malloc failure.
wizard_apply_handler():
- Free host if we fail to add it to the vector.

wizard_mapped_observer():
- Check for otw allocation failure.
- Free otw if we fail to add it to the vector.

Change-Id: Ib5d3bcabbd9c24dd8a3c9cc692a794a5f60243ad
2017-11-06 18:46:54 -05:00
Corey Farrell
8cdc0ef385 test_sorcery_memory_cache_thrash: Handle error from vector append.
Cleanup resources when we fail to append the vector and report test
failure.

Change-Id: I6eb41586fd11dee8c0dfe35e91cb465a4cab7298
2017-11-06 18:35:27 -05:00
Corey Farrell
e4fba95022 res_pjsip: Fix leak on error in ast_sip_auth_vector_init.
Change-Id: Ib0fc7a18f3135ca8990c3984c9e15f6d26e556e8
2017-11-06 18:31:51 -05:00
Corey Farrell
b96dd55add res_pjproject: Handle error from adding to the buildopts vector.
Change-Id: I076c7bd207c7989a23005395ce1735392657be65
2017-11-06 18:20:25 -05:00
Corey Farrell
3dc600ef84 stasis: Release object if vector append fails.
Change-Id: I3e5cc669169aab6175ddfaf7486edeaeb4fdcfb1
2017-11-06 16:36:55 -05:00
Corey Farrell
fc041554c3 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:30:10 -05:00
Corey Farrell
75539dbf2c 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:13:58 -05:00
Corey Farrell
b4240bea6c 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:12:12 -05:00
Corey Farrell
803dc3dee5 stasis: Remove silly use of RAII_VAR in stasis_forward_all.
Change-Id: I46de4c968d40144d5b049966304ff66c1469fb65
2017-11-06 15:24:57 -05:00
Corey Farrell
0a0e2c4253 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:50 -05:00
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