Commit Graph

30156 Commits

Author SHA1 Message Date
Corey Farrell
9da69ac6c1 iostream: Fix ast_iostream_printf declaration.
This adds the printf attribute and changes 'fmt' from 'const void *' to
'const char *'.  This resolves a warning from some compiler for
vsnprintf needing a literal string for format.

Change-Id: I71c33a8262590042ee451e1146760c10bb22fb78
2017-11-18 19:55:20 -06:00
Jenkins2
8fdc7fd1d3 Merge "Build: Make function constructor/destructor attributes mandatory." into 15 2017-11-17 09:45:12 -06:00
Jenkins2
536e4a31b7 Merge "aoc: Fix memory management issues." into 15 2017-11-17 07:18:57 -06:00
Corey Farrell
60d3dbdf84 aoc: Fix memory management issues.
aoc_publish_blob failed to check for msg allocation error and never
released msg.

Change-Id: Ib31a9ffb81056a0d496a49d7eec795005a44bcd5
2017-11-16 21:34:29 -05:00
Sean Bright
b447c65050 res_pjsip_transport_websocket: Give transport a meaningful description
We were not \0 terminating this string, so any attempt to print it would
in the best case show an empty string and in the worst case potentially
crash.

Change-Id: I63d96ef8f7516ac02a0f91e22dfa8acdc615042c
2017-11-16 17:29:05 -05:00
Joshua Colp
4fb6b012c9 Merge "ast_coredumper: Add ability to use directory other than /tmp" into 15 2017-11-16 15:44:32 -06:00
Jenkins2
f0aa460712 Merge "pjsip / hep: Provide correct local address for Websockets." into 15 2017-11-16 11:21:55 -06:00
Jenkins2
595735200c Merge "sorcery: Add ast_sorcery_retrieve_by_prefix()" into 15 2017-11-16 10:50:17 -06:00
Jenkins2
4960fc1e69 Merge "chan_pjsip.c: Improve answer failure log messages." into 15 2017-11-16 09:50:51 -06:00
Joshua Colp
3aa630724c Merge "audiohook.c: Fix freeing a frame and still using it." into 15 2017-11-16 08:16:22 -06:00
Richard Mudgett
22197e1161 chan_pjsip.c: Improve answer failure log messages.
* Balanced the session->inv_session refs on answer failure.

Change-Id: I33542d639d37e692cb46550b972a5fcfc3b804b8
2017-11-15 17:53:29 -05:00
Richard Mudgett
fcec0fc644 audiohook.c: Fix freeing a frame and still using it.
Memory corruption happened to the media frame caches when an audio hook
freed a frame when it shouldn't.  I think the freed frame was because a
jitter buffer interpolated a missing frame and the audio hook
unconditionally freed it.

* Made audiohook.c:audio_audiohook_write_list() not free an interpolated
frame if it is the same frame as what was passed into the routine.

* Made plc.c:normalise_history() use memmove() instead of memcpy() on a
memory block that could overlap.  Found by valgrind investigating this
issue.

ASTERISK-27238
ASTERISK-27412

Change-Id: I548d86894281fc4529aefeb9f161f2131ecc6fde
2017-11-15 17:06:53 -05:00
George Joseph
89997cc003 app_record: Don't set RECORD_STATUS chan var until file is closed
We've been calling pbx_builtin_setvar_helper to set the
RECORD_STATUS variable before actually closing the recorded file.
If a client is watching VarSet events and tries to do something with
the file when a RECORD_STATUS event is seen, they might attempt to
do so while the file it's still open.

We now delay calling pbx_builtin_setvar_helper until after we close
the file.

ASTERISK-27423

Change-Id: I7fe9de99953e46b4bafa2b38cf151fe8f6488254
2017-11-15 15:03:14 -05:00
George Joseph
c1a82bcb8c ast_coredumper: Add ability to use directory other than /tmp
The OUTPUTDIR environment variable can now be set either in the
environment itself or in ast_debug_tools.conf.  If set, it's used
for all work products instead of /tmp.

Also added the --tarball-config option that includes the contents
of /etc/asterisk when either --tarball-coredumps or --tarball-results
are used.

Change-Id: I66b2553319df61caea5b313d084f51978f730b4c
2017-11-15 10:43:37 -05:00
Joshua Colp
b8fafd6806 Merge "bundled_pjproject: Update to 2.7.1" into 15 2017-11-14 16:11:53 -06:00
Joshua Colp
3299afaa34 Merge "bundled_pjproject: sip_parser: Fix return code in pjsip_find_msg" into 15 2017-11-14 14:49:29 -06:00
Joshua Colp
b4ef463685 pjsip / hep: Provide correct local address for Websockets.
Previously for PJSIP the local address of WebSocket connections
was set to the remote address. For logging purposes this is
not particularly useful.

The WebSocket API has been extended to allow the local
address to be queried and this is used in PJSIP to set the
local address to the correct value.

The PJSIP HEP support has also been tweaked so that reliable
transports always use the local address on the transport
and do not try to (wrongly) guess. As they are connection
based it is impossible for the source to be anything else.

ASTERISK-26758
ASTERISK-27363

Change-Id: Icd305fd038ad755e2682ab2786e381f6bf29e8ca
2017-11-14 16:50:31 +00:00
Jenkins2
3920741891 Merge "core: Fix configuration of remote console socket path." into 15 2017-11-14 10:46:05 -06:00
Joshua Colp
8c01f7d32c Merge "pjsip: Add patch to allow all transports to be destroyed." into 15 2017-11-14 09:11:29 -06:00
Jenkins2
2c9c99b427 Merge "core: Add cache_media_frames debugging option." into 15 2017-11-14 07:13:54 -06:00
Corey Farrell
bb0d22edaa alertpipe: Correct documented return of ast_alertpipe_write.
Change-Id: I4ea49c441890a81384144479dc93ab5a3989486d
2017-11-13 18:48:05 -05:00
Jenkins2
25f7eda3f1 Merge "vectors: Add new macro and a string vector definition." into 15 2017-11-13 17:24:59 -06:00
Corey Farrell
45b8f444ab core: Fix configuration of remote console socket path.
The remote console socket path is the combination of asterisk.conf
settings astrundir from [directories] and astctl from [files].
Unconditionally combine the two strings after processing all values
to ensure we end up with the correct socket path.

ASTERISK-27415

Change-Id: Ib1e2805d55d6b0955c6430a1a2a93acbf9b091e8
2017-11-13 17:28:02 -05:00
Jenkins2
51597fe1df Merge "menuselect: Delete and ignore aclocal.m4." into 15 2017-11-13 16:14:51 -06:00
Sean Bright
2e01b779cc sorcery: Add ast_sorcery_retrieve_by_prefix()
Some consumers of the sorcery API use ast_sorcery_retrieve_by_regex
only so that they can anchor the potential match as a prefix and not
because they truly need regular expressions.

Rather than using regular expressions for simple prefix lookups, add
a new operation - ast_sorcery_retrieve_by_prefix - that does them.

Patches against 13 and 15 have a compatibility layer needed to
maintain ABI that is not needed in master.

Change-Id: I56f4e20ba1154bd52281f995c27a429a854f6a79
2017-11-13 16:52:22 -05:00
George Joseph
24e7f61d14 bundled_pjproject: sip_parser: Fix return code in pjsip_find_msg
The default return code for pjsip_find_msg was PJ_SUCCESS so if
a Content-Length header wasn't found at all, pjsip_find_msg was
returning PJ_SUCCESS instead of PJSIP_EMISSINGHDR.

Also added the volatile keyword to a few variables that are used
both inside and outside the PJ_TRY/PJ_CATCH block.

Partial fix for ASTERISK_27408

Change-Id: If82ba9de921e3d57df9c68cf96ee45ccc1491f7a
2017-11-13 16:50:00 -05:00
Ben Ford
c6be57b545 bundled_pjproject: Update to 2.7.1
Update from 2.7 to 2.7.1 for bundled pjproject. Changed version
and removed patch files included in the update.

Change-Id: I55cea8e734b318c2df9daf86aa0802c559ec8357
2017-11-13 16:43:28 -05:00
Corey Farrell
f84b2cc417 vectors: Add new macro and a string vector definition.
* AST_VECTOR_STEAL_ELEMENTS - steal the array of elements for use
  with non-vector code.
* struct ast_vector_string - a vector of 'char *'.

Change-Id: I104d1b204be03fccf67e02a195596adcb5ab1e42
2017-11-13 13:38:21 -05:00
Corey Farrell
a3a20e9528 Build: Make function constructor/destructor attributes mandatory.
This change causes the configure script to fail if the C compiler does
not support both function attributes constructor and destructor.  These
were already required as modules cannot function without these attributes
and Asterisk requires modules.

This also has AST_GCC_ATTRIBUTE set a variable
ax_cv_have_func_attribute_$1.  This is the same variable name used by
autoconf-archive's AX_GCC_FUNC_ATTRIBUTE, used for the same purpose.

Change-Id: Id68e8a1447f2a6d707c54b56350e7bfdb33fb663
2017-11-13 08:57:21 -05:00
Joshua Colp
bcd3782051 Merge "Build System: Disable parallel make in the root Makefile." into 15 2017-11-13 07:46:41 -06:00
Jenkins2
3ee826607d Merge "res_pjsip_pubsub: Ensure remote URI contains URI only." into 15 2017-11-13 06:43:04 -06:00
Corey Farrell
f053360998 menuselect: Delete and ignore aclocal.m4.
This file is temporary output from the bootstrap.sh command, it does not
need to be committed.

Change-Id: Ie0fd113aff6eac44924c0bd0c900833c6c86a6d9
2017-11-11 17:34:38 -05:00
Richard Mudgett
cb63ade611 core: Add cache_media_frames debugging option.
The media frame cache gets in the way of finding use after free errors of
media frames.  Tools like valgrind and MALLOC_DEBUG don't know when a
frame is released because it gets put into the cache instead of being
freed.

* Added the "cache_media_frames" option to asterisk.conf.  Disabling the
option helps track down media frame mismanagement when using valgrind or
MALLOC_DEBUG.  The cache gets in the way of determining if the frame is
used after free and who freed it.  NOTE: This option has no effect when
Asterisk is compiled with the LOW_MEMORY compile time option enabled
because the cache code does not exist.

To disable the media frame cache simply disable the cache_media_frames
option in asterisk.conf and restart Asterisk.

Sample asterisk.conf setting:
[options]
cache_media_frames=no

ASTERISK-27413

Change-Id: I0ab2ce0f4547cccf2eb214901835c2d951b78c00
2017-11-11 13:45:02 -06:00
Richard Mudgett
f66a8d6b97 frame.c: Make ast_frame_free()/ast_frfree() NULL tolerant
Change-Id: Ic49d821ef88ada38a31bdd835b9531443c55d793
2017-11-11 14:04:40 -05:00
Jenkins2
6c84a1edd9 Merge "chan_pjsip.c: Fix uninitialized cause value on failure." into 15 2017-11-10 08:03:36 -06:00
Joshua Colp
56c11b0e79 pjsip: Add patch to allow all transports to be destroyed.
If a transport is created with the same transport type, source
IP address, and source port as one that already exists the old
transport is moved into a linked list called "tp_list".

If this old transport is later shutdown it will not be destroyed
as the process checks whether the transport is valid or not. This
check does not look at the "tp_list" when making the determination
causing the transport to not be destroyed.

This change updates the logic to query not just the main storage
method for transports but also the "tp_list".

Upstream issue https://trac.pjsip.org/repos/ticket/2061

ASTERISK-27411

Change-Id: Ic5c2bb60226df0ef1c8851359ed8d4cd64469429
2017-11-10 08:14:44 -05:00
Corey Farrell
09afc76a8a core: Remove disabled code.
handle_quit has been disabled since 2003, remove it.

Change-Id: Idc3aaa6c81676160547078f9b71e8aa43de2db18
2017-11-09 21:37:59 -05:00
Jenkins2
11802de2cc Merge "stasis_bridges.c: Fix off-nominal json memory leaks." into 15 2017-11-09 17:44:33 -06:00
Corey Farrell
066d1ab82e Build System: Disable parallel make in the root Makefile.
This ensures that the root Makefile runs only a single target at a time.
SUBMAKE will still honor requested parallelism, so 'make -j8' will build
one directory at a time but allow 8 jobs at once when building a sub
directory.

This will fix some display glitches related to rebuild of XML
documentation.  It will also prevent some edge case errors where
bundled pjproject needs to be rebuild before other parts of Asterisk.

Change-Id: I4f2ec6fbbec1ada0ccb1109a28ea303524239b1e
2017-11-09 14:30:05 -05:00
Kevin Harwell
93b0163f77 Merge "res_pjsip_registrar.c: Fix AOR and pjproject group deadlock." into 15 2017-11-09 11:49:13 -06:00
Richard Mudgett
80c88d9b30 chan_pjsip.c: Fix uninitialized cause value on failure.
Change-Id: I3f9dd3c31bd582e54a30381500077de2319d8cc3
2017-11-09 08:42:22 -05:00
Joshua Colp
7b6f68fe2d Merge "res_pjsip_pubsub: Fix multiple leaks on failure to append vectors." into 15 2017-11-09 03:44:50 -06:00
Joshua Colp
1d25b0ae4a Merge "res_pjsip_history: Fix multiple leaks on vector append failure." into 15 2017-11-09 03:44:30 -06:00
Joshua Colp
f3c383ac5b Merge "res_pjsip_session: Fix multiple leaks." into 15 2017-11-09 03:43:50 -06:00
Joshua Colp
f668cac333 Merge "bridge_softmix: Note why ast_stream_topology_set_stream cannot fail." into 15 2017-11-09 03:42:59 -06:00
Joshua Colp
ed3971d7d8 Merge "res_pjsip_session: Check for errors from ast_stream_topology_set_stream." into 15 2017-11-09 03:42:42 -06:00
Joshua Colp
a2f08746b1 Merge "res_pjsip_t38: Better error checking for t38_create_media_state." into 15 2017-11-08 13:11:34 -06:00
Corey Farrell
28e50b77a8 bridge_softmix: Note why ast_stream_topology_set_stream cannot fail.
This appeared in my audit of ast_stream_topology_set_stream callers
not checking for errors but in this situation the call cannot fail.
Add comment so this can be ignored in the future.

Change-Id: I91d25704859efbe50b8b82cfe1cd3c40ba177c9f
2017-11-08 11:14:06 -05:00
George Joseph
e83995dddf Merge "AST-2017-009: pjproject: Add validation of numeric header values" into 15 2017-11-08 09:52:38 -06:00
George Joseph
72ca462758 Merge "AST-2017-011 - res_pjsip_session: session leak when a call is rejected" into 15 2017-11-08 09:45:01 -06:00