Commit Graph

32152 Commits

Author SHA1 Message Date
Sean Bright
0ebfc4a19d 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-29 14:09:50 -04:00
Sean Bright
d6af1acb8c res_musiconhold: Use ast_pipe_nonblock() wrapper
Change-Id: Ib0a4b41e5ececbe633079e2d8c2b66c031d2d1f2
2019-07-29 09:04:30 -06:00
George Joseph
05cf9c9912 loader.c: Fix possible SEGV when a module fails to register
When a module fails to register itself (usually a coding error
in the module), dlerror() can return NULL.  We weren't checking
for that in load_dlopen() before trying to strdup the error message
so a SEGV was thrown.  dlerror() is now surrounded with an S_OR
so we don't SEGV.

Change-Id: Ie0fb9316f08a321434f3f85aecf3c7d2ede8b956
2019-07-29 07:38:36 -06:00
George Joseph
50453846b6 Merge "CI: Don't enable non-core modules in Certified branches" into 16 2019-07-26 09:47:47 -05:00
George Joseph
06780d2bc4 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:23:54 -06:00
Sean Bright
28654308ef 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-24 04:51:20 -06:00
George Joseph
85dcc699fa Merge "openr2(6/6): Set hangup cause" into 16 2019-07-23 19:41:56 -05:00
George Joseph
d2a2131447 Merge "openr2(5/6): added cli command -- mfcr2 destroy link <index>" into 16 2019-07-23 18:43:13 -05:00
Friendly Automation
f7c30bc93d Merge "openr2(4/6): added new cli command -- mfcr2 show links" into 16 2019-07-23 16:45:10 -05:00
Friendly Automation
24219c8d1d Merge "openr2(3/6): Convert r2links to standard Asterisk AST_LIST*" into 16 2019-07-23 15:34:43 -05:00
George Joseph
2b407cb531 Merge "openr2(2/6): Stop polling channels when DAHDI returns -ENODEV (e.g: plug-out)" into 16 2019-07-23 14:25:50 -05:00
Friendly Automation
6e33772432 Merge "openr2(1/6): bugfix in configuration saving" into 16 2019-07-23 12:00:19 -05:00
George Joseph
fcd0c9c325 Merge "chan_pjsip: Transmit REFER waits for the REFER result setting TRANSFERSTATUS" into 16 2019-07-23 09:18:30 -05:00
Leonid Fainshtein
3814faf848 openr2(6/6): Set hangup cause
Change-Id: I94dc38920e6e77cc73062648f62fdd613d0d1452
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-22 20:45:03 +03:00
Tzafrir Cohen
06515707df openr2(5/6): added cli command -- mfcr2 destroy link <index>
Change-Id: I452d6a853bcd8c6e194455b19e5e017713e9c0fe
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-22 20:44:54 +03:00
Tzafrir Cohen
93a093f6c4 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-22 20:44:44 +03:00
Tzafrir Cohen
a45cfefb77 openr2(3/6): Convert r2links to standard Asterisk AST_LIST*
Change-Id: Ibcb2401515a58782a1488c0b9efbed201c3f3a17
Signed-off-by: Oron Peled <oron.peled@xorcom.com>
2019-07-22 20:44:34 +03:00
Tzafrir Cohen
ec6e88592a 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-22 20:43:17 +03:00
Tzafrir Cohen
7b6df814a6 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-22 20:42:25 +03:00
George Joseph
356f4256cc 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:20:38 -06:00
George Joseph
979e4119d6 Merge "CI: Add install-headers to the install make targets" into 16 2019-07-19 11:05:08 -05:00
Dan Cropp
f4896703b9 chan_pjsip: Transmit REFER waits for the REFER result setting TRANSFERSTATUS
Previously, when a Transfer (REFER) was performed, chan_pjsip would set
the TRANSFERSTATUS to SUCCESS when the REFER was queued up.  This did not
reflect a successful/unsuccessful transfer the way chan_sip did.
Added a callback module to process the refer subscription information.

Now depends on res_pjsip_pubsub so call transfer progress can be monitored
and reported

ASTERISK-26968 #close
Reported-by: Dan Cropp

Change-Id: If6c27c757c66f71e8b75e3fe49da53ebe62395dc
2019-07-19 09:05:32 -05:00
Rodrigo Ramírez Norambuena
9d69469203 README.md: Update year
Change-Id: I746fb94d112c7d797e206bca0fd1e13fcd26bae3
2019-07-19 07:43:25 -06:00
Friendly Automation
f73fb5fdb1 Merge "sched: Don't allow ast_sched_del to deadlock ast_sched_runq from same thread" into 16 2019-07-19 08:41:32 -05:00
George Joseph
c86c0973ff 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:40:57 -06:00
Joshua Colp
eed3336f89 Merge "Build: Add separate header install/uninstall targets" into 16 2019-07-19 07:42:39 -05:00
Friendly Automation
fcd598c310 Merge "manager: Log AMI actions" into 16 2019-07-19 07:30:11 -05:00
Asterisk Development Team
cb831a18d1 Update CHANGES and UPGRADE.txt for 16.5.0 2019-07-18 06:07:20 -05:00
Walter Doekes
64d25d36fb 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 01:22:30 -06:00
George Joseph
f62d9013c1 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:31 -06:00
Kevin Harwell
88ea395c33 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:39 -06:00
Joshua Colp
1756029237 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 12:27:00 -06:00
Friendly Automation
0e3a3a5cb7 Merge "chan_sip: Handle invalid SDP answer to T.38 re-invite" into 16 2019-07-11 15:15:49 -05:00
George Joseph
2126dc3021 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:36:47 -05:00
Francesco Castellano
6c59df17a5 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:22:07 -05:00
Joshua Colp
1b832c3b60 Merge "chan_dahdi.c: crash in chan_dahdi" into 16 2019-07-02 08:26:40 -05:00
Chris-Savinovich
da1db4f842 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 16:06:18 -06:00
Kevin Harwell
83aba363fe res_pjsip_sdp_rtp: Remove unused variable
The variable 'endpoint_caps' in function 'set_caps' is not used, so remove.

ASTERISK-28458

Change-Id: Ia8766d05a0738aecb29dd018302c2dafca5cab34
2019-07-01 10:49:56 -05:00
George Joseph
31ef22ead1 Merge "tcptls.c: Add peer hostname and port to some error messages" into 16 2019-07-01 10:19:50 -05:00
George Joseph
205a255b27 Merge "pjproject_bundled: Add peer information to most SSL/TLS errors" into 16 2019-07-01 10:18:52 -05:00
Kevin Harwell
323b1e5fe5 Merge "pjproject: Update to 2.9 release" into 16 2019-06-27 16:52:50 -05:00
George Joseph
0dc61e41fa 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 15:04:20 -06:00
George Joseph
2db5173b88 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 12:52:48 -05:00
Kevin Harwell
d2a696cc04 Merge "app_amd: issue with silence suppression fixed" into 16 2019-06-27 11:33:51 -05:00
George Joseph
7d48e086ca Merge "sig_pri: Address gcc9 issues" into 16 2019-06-25 09:08:09 -05:00
George Joseph
33b3f8b09f Merge "CI: New way to determnine libdir" into 16 2019-06-25 09:06:45 -05:00
Friendly Automation
635affeac5 Merge "res_fax: gateway sends T.38 request to both endpoints if V.21 detected" into 16 2019-06-24 14:11:14 -05:00
George Joseph
31d755e805 sig_pri: Address gcc9 issues
A few more format truncation issues addressed.

Change-Id: I047f373169caaca0eec4889d3c0e5e10f130017a
2019-06-24 07:31:01 -06:00
Friendly Automation
a464847a1b Merge "app_confbridge: Attended transfer event fixup" into 16 2019-06-21 11:24:11 -05:00
Friendly Automation
25c6890864 Merge "translate.c do not log WARNING on empty audio frame" into 16 2019-06-21 10:37:49 -05:00