Commit Graph

31206 Commits

Author SHA1 Message Date
George Joseph d87631d21f Merge changes from topic 'ASTERISK-27625'
* changes:
  channel.c: Make CHECK_BLOCKING() save thread LWP id for messages.
  channel.c: Fix usage of CHECK_BLOCKING()
  autoservice: Don't start channel autoservice if the thread is a user interface.
2018-06-21 10:26:31 -05:00
George Joseph 98bd5908a2 Merge "ARI POST DTMF: Make not compete with channel's media thread." 2018-06-21 10:26:23 -05:00
George Joseph 46c1f81fad Merge "AMI PlayDTMF Action: Make not compete with channel's media thread." 2018-06-21 10:25:32 -05:00
Joshua Colp 2a8318554b Merge "menuselect/menuselect_curses: Resolves sprintf usage error" 2018-06-21 04:24:35 -05:00
Jenkins2 5065cb2c24 Merge "Fix some doxygen and curly placement." 2018-06-20 17:01:10 -05:00
Jenkins2 8892a9b8d9 Merge "Dialplan functions: Fix some channel autoservice misuse." 2018-06-20 16:46:00 -05:00
Jenkins2 6015507496 Merge "tcptls.h: Remove redundant SSL_CTX typedef." 2018-06-20 06:04:26 -05:00
Richard Mudgett eb8bbe660e channel.c: Make CHECK_BLOCKING() save thread LWP id for messages.
* Removed an unnecessary call to ast_channel_blocker_set() in
__ast_read().

ASTERISK-27625

Change-Id: I342168b999984666fb869cd519fe779583a73834
2018-06-19 15:02:52 -05:00
Richard Mudgett da54605b8a ARI POST DTMF: Make not compete with channel's media thread.
There can be one and only one thread handling a channel's media at a time.
Otherwise, we don't know which thread is going to handle the media frames.

ASTERISK-27625

Change-Id: I4d6a2fe7386ea447ee199003bf8ad681cb30454e
2018-06-19 15:02:52 -05:00
Richard Mudgett 7d874c1af7 AMI PlayDTMF Action: Make not compete with channel's media thread.
There can be one and only one thread handling a channel's media at a time.
Otherwise, we don't know which thread is going to handle the media frames.

ASTERISK-27625

Change-Id: Ia341f1a6f4d54f2022261abec9021fe5b2eb4905
2018-06-19 15:02:52 -05:00
Richard Mudgett 080508d2eb channel.c: Fix usage of CHECK_BLOCKING()
The CHECK_BLOCKING() macro is used to indicate if a channel's handling
thread is about to do a blocking operation (poll, read, or write) of
media.  A few operations such as ast_queue_frame(), soft hangup, and
masquerades use the indication to wake up the blocked thread to reevaluate
what is going on.

ASTERISK-27625

Change-Id: I4dfc33e01e60627d962efa29d0a4244cf151a84d
2018-06-19 15:02:52 -05:00
Richard Mudgett 0989b63047 autoservice: Don't start channel autoservice if the thread is a user interface.
Executing dialplan functions from either AMI or ARI by getting a variable
could place the channel into autoservice.  However, these user interface
threads do not handle the channel's media so we wind up with two threads
attempting to handle the media.

There can be one and only one thread handling a channel's media at a time.
Otherwise, we don't know which thread is going to handle the media frames.

ASTERISK-27625

Change-Id: If2dc94ce15ddabf923ed1e2a65ea0ef56e013e49
2018-06-19 15:02:52 -05:00
Richard Mudgett 91c3ac19cb Dialplan functions: Fix some channel autoservice misuse.
* Fix off nominal paths leaving the channel in autoservice.
* Remove unnecessary start/stop channel autoservice.
* Fix channel locking around a channel datastore search.

Change-Id: I7ff2e42388064fe3149034ecae57604040b8b540
2018-06-19 10:56:33 -06:00
Richard Mudgett 720c2d1da2 Fix some doxygen and curly placement.
Change-Id: I9a784a7c804120a8fa826c2a4cb9957e4b0b2fc8
2018-06-19 10:46:46 -06:00
Richard Mudgett c1686b8b3e tcptls.h: Remove redundant SSL_CTX typedef.
It is invalid to typedef something more than once.  Though not all gcc
compilers on different OS's complain about it.

Change-Id: I5a7d4565990c985822d61ce75bde0b45f9870540
2018-06-18 12:35:43 -06:00
Richard Mudgett a470bb9e27 channel: Fix some more unprotected channel flag setting.
Change-Id: I34c3b1201b1de539945bcfdcb264fff30332d48c
2018-06-18 09:55:59 -06:00
Jenkins2 986cffa18e Merge "app_confbridge: Enable sending events to participants" 2018-06-18 09:24:45 -05:00
Jenkins2 c59142e273 Merge "app_mp3: remove 10 seconds of silence after mp3 playback" 2018-06-18 07:43:09 -05:00
Matthew Fredrickson 8732d62334 menuselect/menuselect_curses: Resolves sprintf usage error
Acccording to the man page for sprintf, using the same buffer for
output as one used as an input yields undefined behavior.
This patch should work around this problem.

ASTERISK-27903
Reported-by: Alexander Traud

Change-Id: I2213dcb454aff26457e2e4cc9c6821276463ae3a
2018-06-15 18:51:58 -05:00
Sam Wierema 4c7ab73468 app_mp3: remove 10 seconds of silence after mp3 playback
This patch changes the way asterisk polls output from mpg123, instead
of waiting for 10 seconds(when playing an http url) it now uses a
timeout of one second and iterates 10 times using this same timeout.

The main difference is that for every timeout asterisk receives it now
checks if mpg123 is still running before poll again.

ASTERISK-27752

Change-Id: Ib7df8462e3e380cb328011890ad9270d9e9b4620
2018-06-15 06:24:37 -06:00
Jenkins2 c857c71342 Merge "tests/test_utils: Repair ./configure --with-ssl=PATH." 2018-06-14 11:32:45 -05:00
Joshua Colp f851baed76 Merge "res_rtp_asterisk: Instead of ./configure use OPENSSL_NO_SRTP." 2018-06-14 11:27:23 -05:00
Alexander Traud 9d7958672b tests/test_utils: Repair ./configure --with-ssl=PATH.
ASTERISK-27914

Change-Id: Ibcab8f556ee77776f203cff8b06d776a673b7bc4
2018-06-14 00:37:59 -06:00
ktyerman e1908ea484 chan_iax2: better handling for timeout and EINTR
The iax2 module is not handling timeout and EINTR case properly. Mainly when
there is an interupt to the kernel thread. In case of ast_io_wait recieves a
signal, or timeout it can be an error or return 0 which eventually escapes the
thread loop, so that it cant recieve any data. This then causes the modules
receive queue to build up on the kernel and stop any communications via iax in
asterisk.

The proposed patch is for the iax module, so that timeout and EINTR does not
exit the thread.

ASTERISK-27705
Reported-by: Kirsty Tyerman

Change-Id: Ib4c32562f69335869adc1783608e940c3535fbfb
2018-06-13 16:47:02 -06:00
George Joseph e7a7506f9c app_confbridge: Enable sending events to participants
ConfBridge can now send events to participants via in-dialog MESSAGEs.
All current Confbridge events are supported, such as ConfbridgeJoin,
ConfbridgeLeave, etc.  In addition to those events, a new event
ConfbridgeWelcome has been added that will send a list of all
current participants to a new participant.

For all but the ConfbridgeWelcome event, the JSON message contains
information about the bridge, such as its id and name, and information
about the channel that triggered the event such as channel name,
callerid info, mute status, and the MSID labels for their audio and
video tracks. You can use the labels to correlate callerid and mute
status to specific video elements in a webrtc client.

To control this behavior, the following options have been added to
confbridge.conf:

bridge_profile/enable_events:  This must be enabled on any bridge where
events are desired.

user_profile/send_events:  This must be set for a user profile to send
events.  Different user profiles connected to the same bridge can have
different settings.  This allows admins to get events but not normal
users for instance.

user_profile/echo_events:  In some cases, you might not want the user
triggering the event to get the event sent back to them.  To prevent it,
set this to false.

A change was also made to res_pjsip_sdp_rtp to save the generated msid
to the stream so it can be re-used.  This allows participant A's video
stream to appear as the same label to all other participants.

Change-Id: I26420aa9f101f0b2387dc9e2fd10733197f1318e
2018-06-13 09:12:18 -06:00
Alexander Traud b01fc2ef3d res_rtp_asterisk: Instead of ./configure use OPENSSL_NO_SRTP.
Previously, Asterisk used its script ./configure, to test whether OpenSSL was
built with no-srtp (or was simply too old). However, the header file
<openssl/opensslconf.h> is the preferred way to detect the local configuration
of OpenSSL.

As a positive side-effect the script ./configure does not interleave the
detection of the Open Settlement Protocol Toolkit (OSPTK) with the detection of
individual features of OpenSSL anymore.

Change-Id: I3c77c7b00b2ffa2e935632097fa057b9fdf480c0
2018-06-13 08:00:58 -06:00
Jenkins2 a6a22debf1 Merge "rtp: Don't negotiate dynamic codecs using payload." 2018-06-12 10:41:46 -05:00
Jenkins2 8b4c72caea Merge "res_rtp_asterisk: Allow OpenSSL configured with no-deprecated." 2018-06-12 10:04:47 -05:00
Jenkins2 076ff479ac Merge "crypto.h: Repair ./configure --with-ssl=PATH." 2018-06-12 09:53:15 -05:00
Joshua Colp 782064852a Merge "res_crypto: Allow OpenSSL configured with no-deprecated." 2018-06-12 08:41:30 -05:00
Jenkins2 a46e658bc0 Merge "res_srtp: Repair ./configure --with-ssl=PATH." 2018-06-12 08:03:06 -05:00
Jenkins2 56ddc0bd80 Merge "func_odbc: NODATA if SQLNumResultCols returned 0 columns on readsql" 2018-06-12 07:51:26 -05:00
Joshua Colp 41175caee0 rtp: Don't negotiate dynamic codecs using payload.
In Asterisk there are some dynamic codecs that have
a fixed payload number. This number was being improperly
used to negotiate the codec, instead of using the name
and sample rate. This could result in the wrong payload
number being negotiated for a codec.

This change makes it so that only static payloads
will be negotiated using their payload number.

ASTERISK-27848

Change-Id: Ia865830170fd3f808cdb33104f3d4c4ffdc77570
2018-06-12 03:51:47 -06:00
Jenkins2 200956dcc7 Merge "chan_pjsip: Register for "BEFORE_MEDIA" responses" 2018-06-11 18:14:14 -05:00
Kevin Harwell 7d01ac13a1 Merge "AST-2018-008: Fix enumeration of endpoints from ACL rejected addresses." 2018-06-11 14:34:36 -05:00
Sean Bright b649682caa AST-2018-007: iostreams potential DoS when client connection closed prematurely
Before Asterisk sends an HTTP response (at least in the case of errors),
it attempts to read & discard the content of the request. If the client
lies about the Content-Length, or the connection is closed from the
client side before "Content-Length" bytes are sent, the request handling
thread will busy loop.

ASTERISK-27807

Change-Id: I945c5fc888ed92be625b8c35039fc6d2aa89c762
2018-06-11 09:28:43 -06:00
Richard Mudgett 81ac32a85f AST-2018-008: Fix enumeration of endpoints from ACL rejected addresses.
When endpoint specific ACL rules block a SIP request they respond with a
403 forbidden.  However, if an endpoint is not identified then a 401
unauthorized response is sent.  This vulnerability just discloses which
requests hit a defined endpoint.  The ACL rules cannot be bypassed to gain
access to the disclosed endpoints.

* Made endpoint specific ACL rules now respond with a 401 unauthorized
which is the same as if an endpoint were not identified.  The fix is
accomplished by replacing the found endpoint with the artificial endpoint
which always fails authentication.

ASTERISK-27818

Change-Id: Icb275a54ff8e2df6c671a6d9bda37b5d732b3b32
2018-06-11 09:28:43 -06:00
Alexander Traud 0743ad6422 res_rtp_asterisk: Allow OpenSSL configured with no-deprecated.
Furthermore, allow OpenSSL configured with no-dh. Additionally, this change
allows auto-negotiation of the elliptic curve/group for servers, not only with
OpenSSL 1.0.2 but also with OpenSSL 1.1.0 and newer. This enables X25519
(since OpenSSL 1.1.0) and X448 (since OpenSSL 1.1.1) as a side-effect.

ASTERISK-27910

Change-Id: I5b0dd47c5194ee17f830f869d629d7ef212cf537
2018-06-08 22:02:38 +02:00
Alexander Traud 99aed78078 crypto.h: Repair ./configure --with-ssl=PATH.
ASTERISK-27908

Change-Id: Iac49d9f82faeb8a4611c6805906bd6d650b1b1d8
2018-06-08 13:01:53 +02:00
Alexander Traud ca682f0030 res_crypto: Allow OpenSSL configured with no-deprecated.
The header <openssl/rsa.h> had to be included explicitly.

ASTERISK-27906

Change-Id: I41743801eed998c039d73db7a0762d104a4f75b2
2018-06-08 11:03:35 +02:00
Alexander Traud 234bf4b7ff res_srtp: Repair ./configure --with-ssl=PATH.
ASTERISK-27905

Change-Id: Ibb7dc148a0048f4f9c3b12937ba4240dff0d15e2
2018-06-08 09:41:01 +02:00
Alexei Gradinari 65ff2f057a func_odbc: NODATA if SQLNumResultCols returned 0 columns on readsql
The functions acf_odbc_read/cli_odbc_read ignore a number of columns
returned by the SQLNumResultCols.
If the number of columns is zero it means no data.
In this case, a SQLFetch function has to be not called,
because it will cause an error.

ASTERISK-27888 #close

Change-Id: Ie0f7bdac6c405aa5bbd38932c7b831f90729ee19
2018-06-07 08:39:39 -06:00
George Joseph 1725eaf8fb chan_pjsip: Register for "BEFORE_MEDIA" responses
chan_pjsip wasn't registering for "BEFORE_MEDIA" responses which meant
it was not updating HANGUPCAUSE for 4XX responses.  If the remote end
sent a "180 Ringing", then a "486 Busy", the hangup cause was left at
"180 Normal Clearing".

* Removed chan_pjsip_incoming_response from the original session
  supplement (which was handling only "AFTER MEDIA") and added it to a
  new session supplement which accepts both "BEFORE_MEDIA" and
  "AFTER_MEDIA".

* Also cleaned up some cleanup code in load module.

ASTERISK-27902

Change-Id: If9b860541887aca8ac2c9f2ed51ceb0550fb007a
2018-06-07 08:31:45 -06:00
Alexander Traud 9f2eb17005 ooh323c: GCC 8.1 warned about output truncated before terminating nul.
ASTERISK-27901

Change-Id: I5a8e894f4924ef52e3094f6870656a559d67f3d7
2018-06-07 14:19:39 +02:00
George Joseph 7b5fc5d20f Merge "pjsip_options: handle modification of qualify options in realtime" 2018-06-06 10:12:58 -05:00
George Joseph fdc931ffc6 Merge "pjsip_options: show/reload AOR qualify options using CLI" 2018-06-06 10:11:06 -05:00
George Joseph 49196c3a7b Merge "app_confbridge: Add talking indicator for ConfBridgeList AMI response" 2018-06-06 09:47:19 -05:00
George Joseph 13ac76a230 Merge "cdr_mysql: my_connect_db(): reduce indentation" 2018-06-06 08:12:48 -05:00
George Joseph 5978883d13 Merge "cdr_mysql: split mysql init out of my_load_module" 2018-06-06 08:12:38 -05:00
Joshua Colp c98c1b3f74 Merge "bridge_channel.c: Fix Deadlock when using Local channels and fax gateway" 2018-06-06 05:46:47 -05:00