Commit Graph

31985 Commits

Author SHA1 Message Date
Joshua Colp
b880b50922 Merge "pbx_dundi.c: Misc memory management fixes when destroying peers" into 16 2018-08-21 06:55:25 -05:00
Richard Mudgett
fb2f242c49 AMI: Remove docs for nonexistent AMI ContactStatus event headers
Change-Id: I5736965c64c44338f7330e85a24bb46818607f19
2018-08-20 12:32:46 -05:00
George Joseph
5645dc6894 Merge "pbx_dundi: Update sample config documentation." into 16 2018-08-20 11:30:40 -05:00
George Joseph
b523aaf699 Merge "res_sorcery_realtime.c: Fix unqualified fetch warning." into 16 2018-08-20 10:57:24 -05:00
George Joseph
0fe2eadbc3 Merge "res_pjsip_t38.c: Fix crash if already saw a final T.38 reINVITE response." into 16 2018-08-20 10:55:22 -05:00
Joshua Colp
b9cd4c6d92 res_pjsip: Reduce processing when a Contact is updated.
When a Contact is updated the only material change that qualify
support cares about is the underlying configuration for the AOR.
In this case we will update things with the new AOR information but
otherwise the callback to indicate the Contact has changed can be
ignored.

This is because it is only when a Contact is added or deleted that
material changes occur within the qualify support. An update can't
change the URI since it would result in a new Contact so it can be
ignored.

Change-Id: I2f97ebfa79969a36a97bb7b9afd5b6268cf1a07d
2018-08-18 18:08:22 -03:00
Richard Mudgett
236826a111 res_pjsip_t38.c: Fix crash if already saw a final T.38 reINVITE response.
We were still getting crashes after the first fix.  Somehow we receive a
non-2xx final response before we get a 200 final response.  With the
failure response we had already cleaned up and destroyed some data
structures.  When the unexpected 200 response comes in we crash.

* Add protection code to prevent processing another final T.38 reINVITE
response.

ASTERISK-27944

Change-Id: I8b5baba8d07fe4d63f0d7d05d3eb9a3d27d40a74
2018-08-17 18:56:12 -05:00
Richard Mudgett
19298141cf res_sorcery_realtime.c: Fix unqualified fetch warning.
The allow_unqualified_fetch option for the sorcery realtime backend
blocked actually fetching all rows when the option is set to warn.

* Made issue a warning and actually do the request when
allow_unqualified_fetch=warn is set.

Change-Id: I74456c80a03a62dce66fc3dc3cb0cf2351ac4312
2018-08-17 16:33:13 -05:00
Kirsty Tyerman
f6c1d94d91 pbx_dundi: Added IPv6 support for dundi
Change includes move to netsock2 library.

ASTERISK-27164
Reported-by: Adam Secombe

Change-Id: Ia9e8dc3d153de7a291dbda4bd87fc827dd2bb846
2018-08-17 16:03:12 -05:00
Richard Mudgett
4e43823d19 pbx_dundi.c: Misc memory management fixes when destroying peers
* In destroy_peer(), fixed memory leaks of lookup history strings and
qualify transactions when destroying peers.

* In destroy_peer(), fixed leaving the registerexpire scheduled callback
active when a peer is destroyed on a reload.  The reload marks and sweeps
peers so any peers not explicitly configured get destroyed.  Peers created
dynamically from the '*' peer will not exist until they re-register after
the reload.  These destroyed peers caused memory corruption when the
registerexpire timer expired.

* Made build_peer() not schedule any callbacks on the '*' peer
(empty_eid).  It is a special peer that is cloned to dynamically created
peers so it doesn't actually get involved in any message transactions.

* Made do_register_expire() remove the dundi/dpeers AstDB entry when a
peer registration expires.

* Fix deep_copy_peer() to not copy some things that cannot be copied to
the cloned peer structure.  Timers, message transactions, and lookup
history are specific to a peer instance.

* Made set_config() lock around processing the mappings configuration.

* Reordered unload_module() to handle load_module() declining the load due
to error.

Change-Id: Ib846b2b60d027f3a2c2b3b563d9a83a357dce1d6
2018-08-17 14:44:13 -05:00
Richard Mudgett
857926d197 pbx_dundi.c: Handle thread shutdown better.
Change-Id: Id52f99bd6a948fe6dd82acc0a28b2447a224fe87
2018-08-17 14:42:29 -05:00
Richard Mudgett
111e73678e pbx_dundi: Fix debug frame decode string.
* Fixed a typo in the name of the REGREQ frame decode string array.
* Fixed off by one range check indexing into the frame decode string
array.
* Removed some unneeded casts associated with the decode string array.

Change-Id: I77435e81cd284bab6209d545919bf236ad7933c2
2018-08-17 14:40:45 -05:00
Richard Mudgett
a7ace944ae pbx_dundi: Update sample config documentation.
Change-Id: I33d0ad0611c2124ca3440f0f811fa0f45e4e2849
2018-08-17 14:39:19 -05:00
Richard Mudgett
0874d5b316 res_rtp_asterisk.c: Fix unused variable warnings
Compiling without SRTP support installed resulted in some unused variable
warnings.  These warnings also showed that the srtp variable was obtained
and passed around some functions but not really used even when a system
has SRTP installed.

Change-Id: I6daad34be3e89b19adef6e2fbe738018975155fc
2018-08-17 14:36:04 -05:00
Joshua Colp
7d8e2389d6 Merge "res_resolver_unbound: Fix leak of config nameserver strings." into 16 2018-08-17 05:39:53 -05:00
Joshua Colp
14da6be84d Merge "res_pjsip: Resolve transport management leak at shutdown." into 16 2018-08-17 05:38:30 -05:00
Kevin Harwell
80a331d96b Merge "res_odbc: Allow unload at shutdown." into 16 2018-08-16 17:47:40 -05:00
George Joseph
df78227e4a CI: Fixup for non-13 branches
Change-Id: I5e1d4a09e58b92b541bc8ed6f9e10e54c4e5101f
2018-08-16 12:51:51 -06:00
George Joseph
4ca959c72c CI: Final version of setting correct gerrit creds
Change-Id: I7729ecceedceb12f52bf18dae259846aa1d993b3
2018-08-16 12:33:37 -06:00
George Joseph
33a5b8ccaf CI: Add https credentials to gerrit checkouts
If the review to be tested is in a project with restricted access,
we need to use the jenkins user's gerrit https credentials when we
do the checkout or the checkout will fail.

Change-Id: I9dc9994763c5ebfeb9f1cff60fb53f6902b7fd5f
2018-08-16 12:33:37 -06:00
George Joseph
4f95992d36 Merge "res/res_pjsip_sdp_rtp: put rtcp-mux in answer only if offered" into 16 2018-08-16 09:46:09 -05:00
Torrey Searle
0d4bde84d1 res/res_pjsip_sdp_rtp: put rtcp-mux in answer only if offered
If in the initial sdp the caller doesn't include the line
a=rtcp-mux

Then asterisk shoud not include rtcp-mux in the response regardless
of rtcp-mux being enabled on the endpoint

ASTERISK-28007 #close

Change-Id: I58e9b9f40a139afc0da5de41906cc608fb62adc7
2018-08-16 02:06:24 -05:00
Corey Farrell
167efe3a47 res_resolver_unbound: Fix leak of config nameserver strings.
Change-Id: I3f396316bb40d1ae6e91f5f688042420f1a540ed
2018-08-15 16:32:48 -04:00
Corey Farrell
72dbc9fb70 res_pjsip: Resolve transport management leak at shutdown.
Cleanup idle check scheduled events at shutdown.

Change-Id: I61bfbb56bac69fe840c3242927d31ff3593be461
2018-08-15 14:55:48 -04:00
Corey Farrell
6e0f4a2127 res_pjsip: Fix leak in pjsip_options.
sip_options_get_endpoint_state_compositor_state leaked a reference to
the first available endpoint state compositor that was found.

Change-Id: Idb6be19f7219b6eed1dfb19c1e740dd40cb3fdc7
2018-08-15 11:33:17 -05:00
Corey Farrell
b370482786 res_odbc: Allow unload at shutdown.
This makes it possible for REF_DEBUG to report no leaks when loading
res_odbc.

Change-Id: I1a3dea786bd6e7f4820a6dd5cbaa197fa783ce93
2018-08-15 12:31:00 -04:00
George Joseph
100ffc6866 Merge "res_pjsip/rtp: No joint capabilities between streams." into 16 2018-08-15 09:44:57 -05:00
Jenkins2
c03ab4c4b1 Merge "res_pjsip_caller_id: Add "party" parameter to RPID header." into 16 2018-08-15 08:57:07 -05:00
George Joseph
aee6d12f15 Merge "contrib/scripts: Make astgenkey executable" into 16 2018-08-15 07:50:56 -05:00
Corey Farrell
d61a8791b5 Build System: Improve ccache matching for different menuselect options.
Changing any Menuselect option in the `Compiler Flags` section causes a
full rebuild of the Asterisk source tree.  Every enabled option causes
a #define to be added to buildopts.h, thus breaking ccache caching for
every source file that includes "asterisk.h".  In most cases each option
only applies to one or two files.  Now we only define those options for
the specific sources which use them, this causes much better cache
matching when working with multiple builds.  For example testing code
with an without MALLOC_DEBUG will now use just over half the ccache
size, only main/astmm.o will have two builds cached instead of every
file.

Reorder main/Makefile so _ASTCFLAGS set on specific object files are all
together, sorted by filename.  Stop adding -DMALLOC_DEBUG to CFLAGS of
bundled pjproject, this define is no longer used by any header so only
serves to break cache.

The only code change is a slight adjustment to how main/astmm.c is
initialized.  Initialization functions always exist so main/asterisk.c
can call them unconditionally.  Additionally rename the astmm
initialization functions so they are not exported.

Change-Id: Ie2085237a964f6e1e6fff55ed046e2afff83c027
2018-08-14 12:45:10 -05:00
Richard Mudgett
0e4f5f5189 contrib/scripts: Make astgenkey executable
Change-Id: I11641d65592536dea9cbca5aa94a24c25d24dd5f
2018-08-14 12:09:56 -05:00
Joshua Colp
56c1285b8a res_pjsip_caller_id: Add "party" parameter to RPID header.
This change adds the "party" parameter to the Remote-Party-ID header
which indicates which party the header information is applicable
to. In Asterisk this is determined on whether we are the calling
or called party. This is added to improve interoperability with some
implementations.

ASTERISK-28006

Change-Id: I1eec3e377ffff8633b5c1dd59a05e9533122cfca
2018-08-14 08:55:30 -05:00
Corey Farrell
3bf968470b CI: Add support for coverage processing.
Enable coverage with `./tests/CI/buildAsterisk.sh --coverage`.  This
will cause Asterisk to be compiled with coverage support.  It also
initializes 'before' coverage data for all sources.  Accept
--tested-only to disable modules which are not run by any test.
Enabling coverage also sets tested-only true by default.  To build
everything with coverage enabled use `--coverage --tested-only=0`.

./tests/CI/processCoverage.sh is used to process the coverage and
generate HTML reports.

Fix utils/check_expr2 which failed to compiled with coverage enabled.

Add status output 5 times per stage of astobj2_test_perf to ensure
remote CLI does not timeout when compiled with coverage.  Remote CLI
disconnects if no output is received for 60 seconds.  When coverage is
enabled it takes about 70 seconds for my laptop to run the stages of
this test, so with the change a message is printed every 14 seconds.

Change-Id: I890f7d5665087426ad7d3e363187691b9afc2222
2018-08-14 07:06:46 -05:00
Ben Ford
a46fcaca7b res_pjsip/rtp: No joint capabilities between streams.
When a conference contained a mixture of audio/video and audio-only
users, a NOTICE message would pop up stating there are no joint
capabilities between streams. This happens because streams can never be
removed, but they can be in a REMOVED state. If we have the scenario
where user A joins with audio/video, user B joins with audio-only, and
user C joins with audio/video, then user A leaves, the message would
be triggered. That removed stream is still in the SDP, but Asterisk
would pass it through, causing it to be seen as a ulaw stream. A check
has been added for removed streams, setting their status to REMOVED when
handling negotiated SDPs.

Also addressed an issue where user A joins, then user B joins but does
not receive video until much later. Full frames were not being sent,
causing some PLI from the browser. Because the video was flowing in one
direction, the browser sets the SSRC to 1, but Asterisk was dropping the
PLI because of that. Added a check to see if the SSRC is 1 or not, which
sends full frames and allows video to flow between user A and user B.
This should only happen when dealing with PSFB or FUR, and in the case
of PSFB, only for PLI.

ASTERISK-27398

Change-Id: I26e7c6f101bc119549eeca406b5bcd25ad8ebc5e
2018-08-13 14:01:53 -05:00
Ivan Poddubny
fce68efbbe app_queue: set QUEUESTATUS to LEAVEEMPTY instead of CONTINUE
When a call leaves a queue on leaveempty condition, QUEUESTATUS
must be set to LEAVEEMPTY, no matter whether Queue was executed with or
without the "c" (continue) option.

The regression was introduced in the fix for ASTERISK_25665.
The following fix (ASTERISK_27065) was incomplete, as QUEUESTATUS was
overwritten in case when "c" is set, regardless of what was the cause
for leaving the queue.

ASTERISK-27973 #close
Reported-by: Valentin Safonov

Change-Id: Iec013fe6a26a4e825ca572a1dda4f3cee5f6f80c
2018-08-13 12:45:09 -05:00
Corey Farrell
661273a078 Sample configs: Fix pjsip.conf syntax error.
It is valid for a config file to be empty or contain only comments, but
not valid for a config value to be set when no uncommented context
exists.  This caused an error to be loged numerous times during start
when loading the default pjsip.conf.

Change-Id: Icf3b0d69b4ecb6e935eecd43c99ed8b32a5a1cf6
2018-08-09 16:42:24 -05:00
Kevin Harwell
1d1473d408 Merge "res_pjsip_registrar: Improve performance on inbound handling." into 16 2018-08-08 12:22:33 -05:00
Joshua Colp
4202fbdc51 Merge "stasis: Reduce calculation of stasis message type hash." into 16 2018-08-08 05:52:47 -05:00
Joshua Colp
0df8ab0adc Merge "res_pjsip: Make pjlib.h consistently included." into 16 2018-08-08 05:46:56 -05:00
Joshua Colp
f568428111 Merge "res_pjsip.h: Fix doxygen comments." into 16 2018-08-08 05:11:27 -05:00
Joshua Colp
ef029a3224 Merge "pjproject_bundled: Fix for Solaris builds. Do not undef s_addr." into 16 2018-08-08 05:10:54 -05:00
Richard Mudgett
eb87a98a1a res_pjsip.h: Fix doxygen comments.
Change-Id: I9cf97bdc756012d1f552ab007f4aa85e0ddb4e62
2018-08-07 10:29:29 -05:00
Joshua Colp
5030756bfa stasis: Reduce calculation of stasis message type hash.
When the stasis cache is used a hash is calculated for
retrieving or inserting messages. This change calculates
a hash when the message type is initialized that is then
used each time needed. This ensures that the hash is
calculated only once for the message type.

Change-Id: I4fe6bfdafb55bf5c322dd313fbd8c32cce73ef37
2018-08-06 11:17:54 -05:00
Joshua Colp
fcece326ed Merge "dialplan_functions: wrong srtp use status report of a dialplan function" into 16 2018-08-06 08:34:25 -05:00
Joshua Colp
baae4a5e48 Merge "pjproject_bundled: Find shared libraries in root --with-ssl=PATH." into 16 2018-08-06 05:29:08 -05:00
Alexander Traud
04974a0ca2 pjproject_bundled: Fix for Solaris builds. Do not undef s_addr.
The authors of PJProject undef s_addr because of some issue in Microsoft
Windows. However in Oracle Solaris, s_addr is not a structure member, but
defined to map to the real structure member.

Updates the patch from ASTERISK_20366

ASTERISK-27997

Change-Id: I8223026d4d54e2a46521085fcc94bfa6ebe35b11
2018-08-03 16:58:27 -05:00
Richard Mudgett
99a0586ec1 res_pjsip: Make pjlib.h consistently included.
* Don't include pjlib.h twice in res_pjsip.h
* Consistently use #include <> form for pjproject includes.
(pjsip.h and pjlib.h)

Change-Id: I3f7b42044840de64edf7e9d7695cb60c45990dc7
2018-08-03 16:07:13 -05:00
Salah Ahmed
523b7b2ffc dialplan_functions: wrong srtp use status report of a dialplan function
If asterisk offer an endpoint with SRTP and that endpoint respond
with non srtp, in that case channel(rtp,secure,audio) reply wrong
status.

Why delete flag AST_SRTP_CRYPTO_OFFER_OK while check identical remote_key:
Currently this flag has being set redundantly. In either case identical
or different remote_key this flag has being set. So if we
don't set it while we receive identical remote_key or non SRTP SDP
response then we can take decision of srtp use by using that flag.

ASTERISK-27999

Change-Id: I29dc2843cf4e5ae2604301cb4ff258f1822dc2d7
2018-08-03 13:49:52 -05:00
Kevin Harwell
ec813a3fdb Merge "BuildSystem: Enable ncurses for menuselect in Solaris 11." into 16 2018-08-03 13:29:01 -05:00
Kevin Harwell
fb862c4066 Merge "pjsip_wizard.conf.sample: Update remote_hosts description." into 16 2018-08-03 13:28:00 -05:00