This is a squashed commit of the following:
01. revert of f42ce26555 to be able to
cleanly cherry-pick from master
02. cherry pick from commit 9ea4a8b49b
03. cherry pick from commit 5cc8a67196
04. cherry pick from commit 93e08d1ad9
05. cherry pick from commit 80d0fbd405
06. cherry pick from commit a71a6666d2
07. cherry pick from commit f7fe759fe2
08. cherry pick from commit 6d6dd129aa
09. cherry pick from commit 5a916dc351
10. cherry pick from commit 95611304d9
11. cherry pick from commit 376473b38c
12. sync patches with asterisk 16.22.0
Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>