Commit Graph

31041 Commits

Author SHA1 Message Date
George Joseph
c6558e09af CI: Escape backslashes in printenv/sort/tr
Change-Id: I52be64c8f6af2bbe15148a856d1f10cb113e1e94
2019-08-08 11:10:11 -06:00
George Joseph
17908cb76e CI: Add "throttle" label and "skip_gate" capability
To make throttling by label fully active, the "throttle" option
has to be specified with a specific label.

You can now specify "skip_gate" in the Gerrit comments when you
do a +2 code review to tell Jenkins not to actually run the
gate.  You'd do this if you plan to manually merge the change.

Also updated the "printenv" debug output to better sort multi-line
comments.

Change-Id: I4c0b1085acec4805f2ca207eebac50aad81f27e2
2019-08-08 08:47:34 -06:00
Friendly Automation
6d174e4ef2 Merge "CI: Make node labels job-specific" into 13 2019-08-07 11:19:22 -05:00
George Joseph
a57b59c959 Merge "various modules: json integer overflow" into 13 2019-08-06 11:07:07 -05:00
George Joseph
018c278c72 Merge "res_musiconhold: Use a vector instead of custom array allocation" into 13 2019-08-06 11:05:19 -05:00
George Joseph
1a051fcf5a CI: Make node labels job-specific
Originally, the eligible nodes for a job were labelled only by
"swdev-docker".  So basically any node could run any job.  We had
found that allowing a node to run more than 1 gate at a time was
problematic so we limited the nodes to processing 1 job at a time.
With the creation of the Asterisk 17 branches however, we now have
so many active branches that getting checks and gates through in
a timely manner is problematic when a node can run only 1 job
at a time.

Now the nodes are also labelled by the job type they can run.
For instance: "asterisk-check", "asterisk-gate", etc.  With the
"Throttle Concurrent Builds" plugin, we can now allow a node to
run more than 1 job BUT throttle by job type.  For instance:
  Allow 2 jobs but only 1 asterisk-gate at a time.
Now a node can run 2 checks or 1 check and 1 gate or 1 gate but
not 2 gates at a time.

Change-Id: I2032bf6afbcec5c341d9b852214c0c812d3d6db5
2019-08-06 09:40:54 -06:00
Torrey Searle
6f77e12f21 main/udptl.c: correctly handle udptl sequence wrap around
incorrect handling of UDPTL squence number wrap arounds causes
loss of packets every time the wrap around occurs

ASTERISK-28483 #close

Change-Id: I33caeb2bf13c574a1ebb81714b58907091d64234
2019-08-06 08:54:36 -05:00
Kevin Harwell
f145b58542 various modules: json integer overflow
There were still a few places in the code that could overflow when "packing"
a json object with a value outside the base type integer's range. For instance:

unsigned int value = INT_MAX + 1
ast_json_pack("{s: i}", value);

would result in a negative number being "packed". In those situations this patch
alters those values to a ast_json_int_t, which widens the value up to a long or
long long.

ASTERISK-28480

Change-Id: Ied530780d83e6f1772adba0e28d8938ef30c49a1
2019-08-01 16:22:01 -05:00
Sean Bright
bb74c691ce res_musiconhold: Use a vector instead of custom array allocation
Change-Id: Ic476a56608b1820ca93dcf68d10cd76fc0b94141
2019-08-01 15:31:12 -04:00
Joshua Colp
c6a34ddbf4 res_pjsip: Fix multiple of the same contact in "pjsip show contacts".
The code for gathering contacts could result in the same contact
being retrieved and added to the list multiple times. The container
which stores the contacts to display will now only allow a contact
to be added to it once instead of multiple times.

ASTERISK-28228

Change-Id: I805185cfcec03340f57d2b9e6cc43c49401812df
2019-08-01 04:11:40 -06:00
George Joseph
46beb0fa1a Merge "manager: Send fewer packets" into 13 2019-07-31 08:55:26 -05:00
Sean Bright
5096a5ddf7 manager: Send fewer packets
The functions that build manager message headers do so in a way that
results in a single messages being split across multiple packets. While
this doesn't matter to the remote end, it makes network captures noisier
and harder to follow, and also means additional system calls.

With this patch, we build up more of the message content into the TLS
buffer before flushing to the network. This change is completely
internal to the manager code and does not affect any of the existing
API's consumers.

Change-Id: I50128b0769060ca5272dbbb5e60242d131eaddf9
2019-07-30 07:15:00 -06:00
Sean Bright
2982138d2b res_musiconhold: Use ast_pipe_nonblock() wrapper
Change-Id: Ib0a4b41e5ececbe633079e2d8c2b66c031d2d1f2
2019-07-29 11:04:00 -04:00
George Joseph
5f020b1825 Merge "CI: Don't enable non-core modules in Certified branches" into 13 2019-07-26 09:47:32 -05:00
George Joseph
16fe80d8da Merge "res_config_sqlite3: Only join threads that we started" into 13 2019-07-25 06:59:24 -05:00
George Joseph
e51e2cae58 CI: Don't enable non-core modules in Certified branches
We don't support non-core modules for Certified releases but we
were enabling them for CI builds which was causing lots of test
failures.  Now we don't.

Change-Id: I0b3254c08a2479f3d39151690350cce5ce5ad766
2019-07-24 14:22:18 -06:00
Leonid Fainshtein
8e09fbb4e9 openr2(6/6): Set hangup cause
Change-Id: I94dc38920e6e77cc73062648f62fdd613d0d1452
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-23 14:27:43 -05:00
Tzafrir Cohen
fdaefbb20a openr2(5/6): added cli command -- mfcr2 destroy link <index>
Change-Id: I452d6a853bcd8c6e194455b19e5e017713e9c0fe
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-23 14:27:27 -05:00
Tzafrir Cohen
effca9917d openr2(4/6): added new cli command -- mfcr2 show links
* This command show the MFC/R2 links

Change-Id: I213822e1b7ef9c05bd89a2ba62df8e0856ce9f84
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-23 14:27:12 -05:00
Tzafrir Cohen
b3de2c0e1e openr2(3/6): Convert r2links to standard Asterisk AST_LIST*
Change-Id: Ibcb2401515a58782a1488c0b9efbed201c3f3a17
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-23 14:26:41 -05:00
Tzafrir Cohen
4b779a59e4 openr2(2/6): Stop polling channels when DAHDI returns -ENODEV (e.g: plug-out)
Otherwise, OpenR2 threads go crazy and consume almost all CPU resources

Change-Id: I10a41f617613fe7399c5bdced5c64a2751173f28
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-23 14:24:42 -05:00
Sean Bright
202fdc88dd res_config_sqlite3: Only join threads that we started
ASTERISK-28477 #close
Reported by: Dennis

ASTERISK-28478 #close
Reported by: Dennis

Change-Id: I77347ad46a86dc5b35ed68270cee56acefb4f475
2019-07-23 14:09:36 -04:00
George Joseph
0cded803ec Merge "openr2(1/6): bugfix in configuration saving" into 13 2019-07-23 13:02:13 -05:00
George Joseph
b63425f469 CI: Add cleanWs to cleanup steps in jenkinsfiles
We're at the point where there are enough Jenkins jobs for
Asterisk branches than even cleaned checkouts of Asterisk
will add up to more disk space than is available on the
in-memory workspace mount.  Since we archive all relevent
artifacts anyway, there's no need to keep the workspace
around after the job finishes, whether it succeeds or fails.

Change-Id: I1cd3b73ebb045a987df0f62526d152a510210c39
2019-07-19 10:24:23 -06:00
George Joseph
51b1111eaf Merge "CI: Add install-headers to the install make targets" into 13 2019-07-19 11:04:59 -05:00
Friendly Automation
7b33cef82a Merge "README.md: Update year" into 13 2019-07-19 09:27:24 -05:00
George Joseph
8d1acc27d5 Merge "sched: Don't allow ast_sched_del to deadlock ast_sched_runq from same thread" into 13 2019-07-19 08:46:29 -05:00
Rodrigo Ramírez Norambuena
5c87fa6a0e README.md: Update year
Change-Id: I746fb94d112c7d797e206bca0fd1e13fcd26bae3
2019-07-19 07:45:17 -06:00
George Joseph
51504432a7 CI: Add install-headers to the install make targets
The testsuite actually needs the headers installed to run
it's self_test.

Change-Id: Ice41d331131b876ad4a9c056085fe6aac34b32b2
2019-07-19 07:41:05 -06:00
George Joseph
284b657539 Merge "Build: Add separate header install/uninstall targets" into 13 2019-07-19 07:34:39 -05:00
Friendly Automation
976f884a24 Merge "manager: Log AMI actions" into 13 2019-07-19 07:25:10 -05:00
Asterisk Development Team
b3d0754f82 Update CHANGES and UPGRADE.txt for 13.28.0 2019-07-18 06:05:29 -05:00
Walter Doekes
3449240130 sched: Don't allow ast_sched_del to deadlock ast_sched_runq from same thread
When fixing ASTERISK~24212, a change was done so a scheduled callback could not
be removed while it was running. The caller of ast_sched_del would have to wait.

However, when the caller of ast_sched_del is the callback itself (however wrong
this might be), this new check would cause a deadlock: it would wait forever
for itself.

This changeset introduces an additional check: if ast_sched_del is called
by the callback itself, it is immediately rejected (along with an ERROR log and
a backtrace). Additionally, the AST_SCHED_DEL_UNREF macro is adjusted so the
after-ast_sched_del-refcall function is only run if ast_sched_del returned
success.

This should fix the following spurious race condition found in chan_sip:
- thread 1: schedule sip_poke_peer_now (using AST_SCHED_REPLACE)
- thread 2: run sip_poke_peer_now
- thread 2: blank out sched-ID (too soon!)
- thread 1: set sched-ID (too late!)
- thread 2: try to delete the currently running sched-ID

After this fix, an ERROR would be logged, but no deadlocks (in do_monitor) nor
excess calls to sip_unref_peer(peer) (causing double frees of rtp_instances and
other madness) should occur.

(Thanks Richard Mudgett for reviewing/improving this "scary" change.)

Note that this change does not fix the observed race condition: unlocked
access to peer->pokeexpire (and potentially other scheduled items in chan_sip),
causing AST_SCHED_DEL_UNREF to look at a changing id. But it will make the
deadlock go away. And in the observed case, it will not have adverse affects
(like memory leaks) because the scheduled item is removed through a different
path.

ASTERISK-28282

Change-Id: Ic26777fa0732725e6ca7010df17af77a012aa856
2019-07-18 09:20:35 +02:00
George Joseph
aaafe8a108 Build: Add separate header install/uninstall targets
Two new Makefile targets have been added... "install-headers" and
"uninstall-headers" to separately control header installation.
The existing behavior has not changed so "make install" and
"make uninstall" will continue to also install/uninstall the headers.
The new targets were added for forward compatibility with Asterisk 17
in which the headers are no longer installed/uninstalled with the
"install" and "uninstall" targets.

Also corrects an issue where /usr/include/asterisk.h was never
being removed at all.

Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643
2019-07-16 08:16:38 -06:00
Kevin Harwell
d2eaba4853 manager: Log AMI actions
When manager debugging is turned on, this patch makes it so incoming AMI actions
are now also logged.

Change-Id: I8047524510e7ac97d99482b2448f8e368f29cd47
2019-07-15 10:10:46 -06:00
Joshua Colp
3cb839d111 res_rtp_asterisk: Move where DTLS MTU variable is defined.
The DTLS MTU variable is not dependent on pjproject and should
not exist in its block.

Change-Id: I7e97d64dc192f2ac81bfe2b72b8229d321c7d026
2019-07-14 15:26:41 -03:00
Friendly Automation
a7bb02ae34 Merge "res_pjsip_messaging: Check for body in in-dialog message" into 13 2019-07-11 15:10:42 -05:00
George Joseph
41d6492de0 res_pjsip_messaging: Check for body in in-dialog message
We now check that a body exists and it has a length > 0 before
attempting to process it.

ASTERISK-28447
Reported-by: Gil Richard

Change-Id: Ic469544b22ab848734636588d4c93426cc6f4b1f
2019-07-11 11:31:08 -05:00
Francesco Castellano
1318a3a2b7 chan_sip: Handle invalid SDP answer to T.38 re-invite
The chan_sip module performs a T.38 re-invite using a single media
stream of udptl, and expects the SDP answer to be the same.

If an SDP answer is received instead that contains an additional
media stream with no joint codec a crash will occur as the code
assumes that at least one joint codec will exist in this
scenario.

This change removes this assumption.

ASTERISK-28465

Change-Id: I8b02845b53344c6babe867a3f0a5231045c7ac87
2019-07-11 11:28:03 -05:00
Tzafrir Cohen
d8bf4b1608 openr2(1/6): bugfix in configuration saving
Details:
  - The memcpy() call copied part of "dahdi_conf" and not "dahdi_conf.mfcr2"
  - As a result, the memcmp() in dahdi_r2_get_link() always fails
  - This cause dahdi_r2_get_link() to create new link for every channel
    (instead of a new link for every ~30 channels)
  - With the fix, far less links are generated -- so we use far less threads

Change-Id: I7259dd6272f5e46e8a6c7f5bf3e8c2ec01b8c132
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-09 02:40:14 +03:00
Chris-Savinovich
e206a54d59 chan_dahdi.c: crash in chan_dahdi
Fixes a crash in chan_dahdi occurring on 32-bit systems. A previous
patch introduced a variable of type unassigned long long which is 64-bits.
Casting it as 'ast_json_int_t' along with JSON type 'I' makes it work
with 32-bit systems.

ASTERISK-28457

Change-Id: I9cef6b5f2d826fc5c93f2f6a1c997c4e3e6c93fe
2019-07-01 17:04:47 -05:00
George Joseph
72f001d558 Merge "pjproject_bundled: Add peer information to most SSL/TLS errors" into 13 2019-07-01 10:19:17 -05:00
Friendly Automation
6ac6218f73 Merge "tcptls.c: Add peer hostname and port to some error messages" into 13 2019-07-01 10:04:30 -05:00
Kevin Harwell
8ef52e8a19 Merge "pjproject: Update to 2.9 release" into 13 2019-06-27 16:52:35 -05:00
George Joseph
be54e94773 tcptls.c: Add peer hostname and port to some error messages
Where possble, hostname and port has been added to error
messages, mostly on the server side.

ASTERISK-26006
Reported by: Oleksandr Natalenko

Change-Id: Iff4f897277bc36ce8c5b493b71d0a4a7b74e62f0
2019-06-27 14:04:27 -06:00
George Joseph
493268a938 pjproject_bundled: Add peer information to most SSL/TLS errors
Most SSL/TLS error messages coming from pjproject now have either
the peer address:port or peer hostname, depending on what was
available at the time and code location where the error was
generated.

ASTERISK-28444
Reported by: Bernhard Schmidt

Change-Id: I41770e8a1ea5e96f6e16b236692c4269ce1ba91e
2019-06-27 11:46:44 -06:00
Kevin Harwell
a302d46dd8 Merge "app_amd: issue with silence suppression fixed" into 13 2019-06-27 11:33:37 -05:00
Sean Bright
ba57b004c4 pjproject: Update to 2.9 release
Relies on https://github.com/asterisk/third-party/pull/4

Change-Id: Iec9cad42cb4ae109a86a3d4dae61e8bce4424ce3
2019-06-27 10:10:24 -06:00
George Joseph
94e0e26c2a Merge "CI: New way to determnine libdir" into 13 2019-06-25 09:07:49 -05:00
George Joseph
44e65b92c1 Merge "sig_pri: Address gcc9 issues" into 13 2019-06-25 09:06:18 -05:00