Commit Graph

30654 Commits

Author SHA1 Message Date
Joshua Colp
0bc1366e15 Merge "app_queue: Silence GCC 8 compiler warning" into 13 2018-08-22 11:17:20 -05:00
Sean Bright
b9d9c0a8b9 app_queue: Silence GCC 8 compiler warning
I'm only seeing an error in 14+, so I assume it is due to different
compiler options:

app_queue.c: In function ‘handle_queue_add_member’:
app_queue.c:10234:19: error: ‘%d’ directive writing between 1 and 11
    bytes into a region of size 3 [-Werror=format-overflow=]
     sprintf(num, "%d", state);
                   ^~
app_queue.c:10234:18: note: directive argument in the range
    [-2147483648, 99]
     sprintf(num, "%d", state);
                  ^~~~

Compiler: gcc version 8.0.1 20180414 (experimental)
    [trunk revision 259383] (Ubuntu 8-20180414-1ubuntu2) 

Change-Id: I18577590da46829c1ea7d8b82e41d69f105baa10
2018-08-22 08:52:46 -05:00
Joshua Colp
1cb87da69c Merge "pbx_dundi.c: Handle thread shutdown better." into 13 2018-08-21 18:53:06 -05:00
alecdavis
6964bc37e0 chan_sip: remove unnecessary ast_channel_unlock(peer) as RAII looks after it
Otherwise console output

        (get_refer_info): mutex 'peer' freed more times than we've locked!
        (get_refer_info): Error releasing mutex: Operation not permitted

    or
        (get_refer_info): attempted unlock mutex 'peer' without owning it!
        (__ast_read): 'peer' was locked here.
        ...dump_backtrace

        (get_refer_info): Error releasing mutex: Operation not permitted
        (__ast_read): mutex 'chan' freed more times than we've locked!

ASTERISK-28011 #close

Change-Id: I6e45f2764ba4f3273a943300f91ac9b461ac2893
2018-08-22 11:46:32 +12:00
neutrino88
49d388bfa8 res/res_rtp_asterisk: remove debug traces generated by an empty frame
The realtime text timer pops regularly and sends text frames even if
the buffer is empty. This causes a lot of unecessary debug logging.

* Made red_write() test if we need to send a frame before calling
ast_rtp_write()

ASTERISK-28002
Reported by: Emmanuel BUU
Tested by: Emmanuel BUU

Change-Id: Icf81310c3b8080b615a42060afc02ab41f9523dd
2018-08-21 18:24:48 -05:00
Joshua Colp
ef061d1854 Merge "AMI: Remove docs for nonexistent AMI ContactStatus event headers" into 13 2018-08-21 08:07:28 -05:00
Joshua Colp
a339cc1240 Merge "pbx_dundi.c: Misc memory management fixes when destroying peers" into 13 2018-08-21 06:27:34 -05:00
Joshua Colp
d195767b07 Merge "pbx_dundi: Fix debug frame decode string." into 13 2018-08-21 05:52:26 -05:00
Richard Mudgett
9b9dee2d2c AMI: Remove docs for nonexistent AMI ContactStatus event headers
Change-Id: I5736965c64c44338f7330e85a24bb46818607f19
2018-08-20 12:31:58 -05:00
George Joseph
3146666b71 Merge "res_sorcery_realtime.c: Fix unqualified fetch warning." into 13 2018-08-20 10:56:48 -05:00
Richard Mudgett
a66fa4db24 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:00 -05:00
Richard Mudgett
f3924b576a 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:35 -05:00
Richard Mudgett
fbc53412f6 pbx_dundi.c: Handle thread shutdown better.
Change-Id: Id52f99bd6a948fe6dd82acc0a28b2447a224fe87
2018-08-17 14:42:48 -05:00
Richard Mudgett
ad2dfb07b0 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:41:04 -05:00
Richard Mudgett
0a7dab8904 pbx_dundi: Update sample config documentation.
Change-Id: I33d0ad0611c2124ca3440f0f811fa0f45e4e2849
2018-08-17 14:39:39 -05:00
Joshua Colp
9ce4708da9 Merge "CI: Disable res_odbc if REF_DEBUG is requested." into 13 2018-08-17 06:16:14 -05:00
Joshua Colp
40d2d317ae Merge "res_pjsip: Resolve transport management leak at shutdown." into 13 2018-08-17 05:38:47 -05:00
George Joseph
33a1593fba CI: Final version of setting correct gerrit creds
Change-Id: I7729ecceedceb12f52bf18dae259846aa1d993b3
2018-08-16 12:28:03 -06:00
George Joseph
ab095ca4c6 CI: Yet Another stab at creds
Change-Id: I768850780d39151c5dd8e2bb1a4b24776727958e
2018-08-16 12:23:05 -06:00
George Joseph
b1e294c670 CI: Another stab at creds
Change-Id: I5b1dc3b354789e676c27a4e1fc42f5c3343cc994
2018-08-16 12:11:11 -06:00
George Joseph
45d096fe8d 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 11:08:21 -06:00
George Joseph
0c4d49c5a9 Merge "res/res_pjsip_sdp_rtp: put rtcp-mux in answer only if offered" into 13 2018-08-16 09:46:00 -05:00
Corey Farrell
db367ddbbf res_pjsip: Resolve transport management leak at shutdown.
Cleanup idle check scheduled events at shutdown.

Change-Id: I61bfbb56bac69fe840c3242927d31ff3593be461
2018-08-15 13:55:55 -05:00
Corey Farrell
7f4420a222 CI: Disable res_odbc if REF_DEBUG is requested.
This is for 13/15 only, res_odbc never unloads so it is impossible to do
REF_DEBUG testing with that module.

Change-Id: I2c1e32b80564e8fb08b6b5900ede6b5d304ebd10
2018-08-15 11:46:46 -05:00
Corey Farrell
7df97d0a00 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:32:48 -05:00
George Joseph
735b70cd38 Merge "res_pjsip_caller_id: Add "party" parameter to RPID header." into 13 2018-08-15 08:29:04 -05:00
Richard Mudgett
e8ac75eed0 contrib/scripts: Make astgenkey executable
Change-Id: I11641d65592536dea9cbca5aa94a24c25d24dd5f
2018-08-14 12:10:02 -05:00
Joshua Colp
555516233d 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 10:55:37 -03:00
George Joseph
e89f3317ba Merge "CI: Add support for coverage processing." into 13 2018-08-14 07:35:55 -05:00
Ivan Poddubny
f48761907a 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:44:42 -05:00
Corey Farrell
dc786aa576 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:45:53 -05:00
Torrey Searle
a1b0db826a 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-09 09:34:17 +02:00
Joshua Colp
673d509911 Merge "res_pjsip_registrar: Improve performance on inbound handling." into 13 2018-08-08 12:10:56 -05:00
Corey Farrell
f3a8bfff36 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-08 11:06:54 -05:00
Joshua Colp
c22efd9990 Merge "stasis: Reduce calculation of stasis message type hash." into 13 2018-08-08 06:04:14 -05:00
Joshua Colp
c17a20e543 Merge "res_pjsip: Make pjlib.h consistently included." into 13 2018-08-08 05:56:48 -05:00
Joshua Colp
18760a7c98 Merge "res_pjsip.h: Fix doxygen comments." into 13 2018-08-08 05:37:20 -05:00
Joshua Colp
4fa27efc03 Merge "pjproject_bundled: Fix for Solaris builds. Do not undef s_addr." into 13 2018-08-08 05:02:10 -05:00
Richard Mudgett
b7f195b6fd res_pjsip.h: Fix doxygen comments.
Change-Id: I9cf97bdc756012d1f552ab007f4aa85e0ddb4e62
2018-08-07 10:25:30 -05:00
Joshua Colp
856b6d1954 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 13:05:56 -03:00
Joshua Colp
e3e45a86f6 Merge "dialplan_functions: wrong srtp use status report of a dialplan function" into 13 2018-08-06 08:34:12 -05:00
Joshua Colp
80567a67d9 Merge "pjproject_bundled: Find shared libraries in root --with-ssl=PATH." into 13 2018-08-06 05:28:59 -05:00
Alexander Traud
819842f7fb 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:52:48 -05:00
Richard Mudgett
1f97ea7e2c 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:00:47 -05:00
Kevin Harwell
d3358a8c84 Merge "BuildSystem: Enable ncurses for menuselect in Solaris 11." into 13 2018-08-03 13:28:34 -05:00
Kevin Harwell
d71cf6dc35 Merge "pjsip_wizard.conf.sample: Update remote_hosts description." into 13 2018-08-03 13:27:36 -05:00
Kevin Harwell
4dee592608 Merge "res_pjsip_endpoint_identifier_ip.c: Added regex support to match_header" into 13 2018-08-03 13:26:00 -05:00
Alexander Traud
0d880fac93 pjproject_bundled: Find shared libraries in root --with-ssl=PATH.
The script configure from Teluu expects shared libraries (.so) in a subfolder
called 'lib', when --with-xyz=PATH is specified. However for OpenSSL, the
default location is the root of the source folder = PATH. Furthermore, Asterisk
supports both, 'lib' and root. For consistency and because Asterisk is using
(only) OpenSSL in PJProject, it is enhanced to support both locations, just
like Asterisk.

ASTERISK-27995

Change-Id: I8eb916a88b6b8c22e29bb40bee8faaca6c73406f
2018-08-03 09:19:47 -05:00
Joshua Colp
a5ce9b6c4b res_pjsip_registrar: Improve performance on inbound handling.
This change removes a sorcery lookup for retrieving all
contacts at the end of the registration process by keeping
track of the contacts that are added/updated/deleted.

This ensures at the end of the process the container of
contacts we have is the current state.

Pool usage has also been reduced by allocating one for
usage throughout the handling of a REGISTER and resetting
it to a clean state. This ensures that in most cases
we allocate once and just reuse it.

ASTERISK-28001

Change-Id: I1a78b2d46f9a2045dbbff1a3fd6dba84b612b3cb
2018-08-03 06:09:33 -03:00
Salah Ahmed
4aa91c6f11 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-02 16:58:47 -05:00