Commit Graph

31018 Commits

Author SHA1 Message Date
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
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
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
George Joseph
dd20beedb9 Merge "res_pjsip_sdp_rtp: Fix ICE candidates leak." into 13 2019-06-25 09:05:38 -05:00
George Joseph
e39dbc4909 Merge "res_fax: gateway sends T.38 request to both endpoints if V.21 detected" into 13 2019-06-24 15:16:43 -05:00
George Joseph
79087b6aeb sig_pri: Address gcc9 issues
A few more format truncation issues addressed.

Change-Id: I047f373169caaca0eec4889d3c0e5e10f130017a
2019-06-24 07:30:19 -06:00
Joshua Colp
9721f3908d res_pjsip_sdp_rtp: Fix ICE candidates leak.
Given the non-default configuration of enabling ICE support on an
endpoint that does not result in an ICE negotiation occurring the
ICE candidates would be leaked.

This change makes it so that the ICE candidates are only retrieved
if ICE negotiation is occurring.

ASTERISK-28460

Change-Id: I7b3f76f031c41fb8a3dc3ef1a84b77e2a8cb969f
2019-06-24 10:08:06 +00:00
George Joseph
f22dedc597 Merge "app_confbridge: Attended transfer event fixup" into 13 2019-06-21 13:41:40 -05:00
George Joseph
5d45686c28 Merge "translate.c do not log WARNING on empty audio frame" into 13 2019-06-21 10:52:13 -05:00
Alexei Gradinari
d5db7473e7 res_fax: gateway sends T.38 request to both endpoints if V.21 detected
According T.38 Gateway 'Use case 3'
https://wiki.asterisk.org/wiki/display/AST/T.38+Gateway
T.38 Gateway should send T.38 negotiation request to called endpoint
if FAX preamble (using V.21 detector) generated by called endpoint.
But it does not, because fax_gateway_detect_v21 constructs T.38
negotiation request, but forwards it only to other channel,
not to the channel on which FAX preamble is detected.

Some SIP endpoints could be improperly configured to rely on the other side
to initiate T.38 re-INVITEs.

With this patch the T.38 Gateway tries to negotiate with both sides
by sending T.38 negotiation request to both endpoints supported T.38.

Change-Id: I73bb24799bfe1a48adae9c034a2edbae54cc2a39
2019-06-20 16:57:33 -06:00
George Joseph
e4ee209bfe CI: New way to determnine libdir
We were using the presence of /usr/lib64 to determine where
shared libraries should be installed.  This only existed on
Redhat based systems and was safe.  If it existed, use it,
otherwise use /usr/lib.

Unfortunately, Ubuntu 19 decided to create a /usr/lib64 BUT
NOT INCLUDE IT IN THE DEFAULT ld.so.conf.  So if anything is
installed there, it won't work.

The new method, just looks for $ID in /etc/os-release and if it's
centos or fedora, uses /usr/lib64 and if ubuntu, uses /usr/lib.

NOTE:  This applies only to the CI scripts.  Normal asterisk
build and install is not affected.

Change-Id: Iad66374b550fd89349bedbbf2b93f8edd195a7c3
2019-06-19 10:58:39 -06:00
Alexei Gradinari
3bfe1f3a1b translate.c do not log WARNING on empty audio frame
There is WARNING "no samples for ..." on each Playtones.
The function ast_playtones_start calls ast_activate_generator,
which calls ast_prod.
The function ast_prod calls ast_write with empty audio frame.
In this case it's spam log.

Change-Id: Id4ac309489d9ff281bad02abdef341cecdede660
2019-06-18 10:40:57 -06:00
George Joseph
d0f01af913 chan_dahdi: Address gcc9 issues
Fixed format-truncation issues in chan_dahdi.c and
sig_analog.c.  Since they're related to fields provided
by dahdi-tools we can't change the buffer sizes so we're just
checking the return from snprintf and printing an errior if we
overflow.

Change-Id: Idc1f3c1565b88a7d145332a0196074b5832864e5
2019-06-17 12:51:55 -06:00
Joshua Colp
d5fed38ab5 Merge "res_rtp_asterisk: Add support for DTLS packet fragmentation." into 13 2019-06-17 08:39:11 -05:00
George Joseph
41f5d15763 app_confbridge: Attended transfer event fixup
When a channel already in a conference bridge is attended transfered
to another extension, or when an existing call is attended
transferred into a conference bridge, we now generate ConfbridgeJoin
and ConfbridgeLeave events for the entering and departing channels.

Change-Id: Id7709cfbceb26fbcb828b2d0d2a6b2fbeaf028e1
2019-06-13 14:05:12 -06:00
Joshua Colp
1ea9bad34d res_rtp_asterisk: Add support for DTLS packet fragmentation.
This change adds support for larger TLS certificates by allowing
OpenSSL to fragment the DTLS packets according to the configured
MTU. By default this is set to 1200.

This is accomplished by implementing our own BIO method that
supports MTU querying. The configured MTU is returned to OpenSSL
which fragments the packet accordingly. When a packet is to be
sent it is done directly out the RTP instance.

ASTERISK-28018

Change-Id: If2d5032019a28ffd48f43e9e93ed71dbdbf39c06
2019-06-13 13:49:07 +00:00
George Joseph
83c353c650 Merge "app_attended_transfer: new application AttendedTransfer" into 13 2019-06-12 10:44:36 -05:00
George Joseph
dd4f0c94e8 Merge "app_blind_transfer: new application BlindTransfer" into 13 2019-06-12 10:42:57 -05:00
George Joseph
0e30d17293 Merge "chan_pjsip.c: Check for channel and session to not be NULL in hangup" into 13 2019-06-12 08:49:51 -05:00
Alexei Gradinari
45a9ee4c53 app_attended_transfer: new application AttendedTransfer
AttendedTransfer queues up attended transfer to the given extension.

This application can be useful with Custom Dynamic Features.
For example to make attended transfer to a predefined number.

features.conf
;;;
[applicationmap]
my_atxfer => *7,self,GoSub,"my_atxfer,s,1",default
;;;

extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=my_atxfer
TRANSFER_CONTEXT=my_transfer

[my_atxfer]
exten => s,1,AttendedTransfer(1234567890)
   same => n,Return()

[my_transfer]
include => default
;;;

This application also can be used to completly redefine Attended transfer
feature using dialplan. For example:

features.conf
;;;
[featuremap]
atxfer => *7

[applicationmap]
custom_atxfer => *2,self,GoSub,"custom_atxfer,s,1",default
;;;

extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=custom_atxfer
TRANSFER_CONTEXT=my_transfer

[custom_atxfer]
exten => s,1,
   same => n,Playback(pbx-transfer)
   same => n,Read(dest,dial,10,i,3,3)
   same => n,AttendedTransfer(${dest})
   same => n,Return()

[my_transfer]
include => default
;;;

Change-Id: Ie5cfa455d0813cffd5c85a6fb117f07d8f0b903b
2019-06-11 08:16:52 -06:00
agupta
67841b8f55 chan_pjsip.c: Check for channel and session to not be NULL in hangup
We have seen some rare case of segmentation fault in hangup function
and we could notice that channel pointer was NULL.  Debug log shows
that there is a 200 OK answer and SIP timeout at the same time.  It
looks that while the SIP session was being destroyed due to timeout
call hangup due to answer event lead to race condition and channel
is being destroyed from two different places.  The check ensures we
check it not to be NULL before freeing it.

ASTERISK-25371

Change-Id: I19f6566830640625e08f7b87bfe15758ad33a778
2019-06-10 06:47:24 -06:00
Alexei Gradinari
dd12e1cbd3 app_blind_transfer: new application BlindTransfer
BlindTransfer redirects all channels currently bridged to the
caller channel to the specified destination.

This application can be useful with Custom Dynamic Features.
For example to make blind transfer to a predefined number.

features.conf
;;;
[applicationmap]
my_blindxfer => *6,self,GoSub,"my_blindxfer,s,1",default
;;;

extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=my_blindxfer

[my_blindxfer]
exten => s,1,BlindTransfer(1234567890,default)
   same => n,Return()
;;;

This application also can be used to completly redefine Blind transfer
feature using dialplan. For example:

features.conf
;;;
[featuremap]
blindxfer =>

[applicationmap]
custom_blindxfer => ##,self,GoSub,"custom_blindxfer,s,1",default
;;;

extensions.conf
;;;
[globals]
DYNAMIC_FEATURES=custom_blindxfer

[custom_blindxfer]
exten => s,1,
   same => n,Playback(pbx-transfer)
   same => n,Read(dest,dial,10,i,3,3)
   same => n,BlindTransfer(${dest},default)
   same => n,Return()
;;;

Change-Id: I9d55e7f69ccfd4472dec00d62771d6de8803215a
2019-06-07 08:26:21 -06:00
Chris-Savinovich
45c1159c62 cdr_pgsql: fix error in connection string
Fixes an error occurring in function pgsql_reconnect() caused when value of
hostname is blank. Which in turn will cause the connection string to look
like this: "host= port=xx", which creates a sintax error. This fix now checks
if the corresponding values for host, port, dbname, and user are blank. Note
that since this is a reconnect function the database library will replace any
missing value pairs with default ones.

ASTERISK-28435

Change-Id: I0a921f99bbd265768be08cd492f04b30855b8423
2019-06-04 12:38:19 -06:00
Joshua Colp
1c665ae39b Merge "res_fax: fix segfault on inactive "reserved" fax session" into 13 2019-06-04 05:29:07 -05:00
Friendly Automation
6df25921ca Merge "app_readexten: new option 'p' to stop reading on '#' key" into 13 2019-06-03 09:54:45 -05:00
Friendly Automation
066ff4d3a8 Merge "res_fax: add channel name to CLI 'fax show session'" into 13 2019-06-03 09:34:59 -05:00