diff --git a/CHANGES b/CHANGES
index f79cd846956d2c86bc9a3210a8b2dc4dfc42b118..cb3dd7a4b3a662c923b1121f1d4d40a44c232b8f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -37,6 +37,11 @@ app_macro
    built.  Users should migrate to app_stack (Gosub).  A warning is logged
    the first time any Macro is used.
 
+app_setcallerid
+------------------
+ * The app_setcallerid module has been removed. The CALLERID dialplan function
+   should be used instead.
+
 chan_sip
 ------------------
  * New function SIP_HEADERS() enumerates all headers in the incoming INVITE.
@@ -108,10 +113,21 @@ cdr_syslog
  * The cdr_syslog module is now deprecated and by default it is no longer
    built.
 
+cdr_sqlite
+------------------
+ * The cdr_sqlite module has been removed. Users should move to using the
+   cdr_sqlite3_custom module instead.
+
+format_jpeg
+------------------
+ * The format_jpeg module has been removed.
+
 Core:
 ------------------
  * libedit is no longer available as an embedded library and must be provided
    by the system.
+ * The STATIC_BUILD functionality has been removed as it has not been maintained
+   and has not worked in quite some time.
 
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 15.5.0 to Asterisk 15.6.0 ------------
diff --git a/Makefile b/Makefile
index 1cd96650f7f02ff2708ff5014c47c825b2b17152..bd0a9e8677fabd62872898a06dd5fda65ac4eb58 100644
--- a/Makefile
+++ b/Makefile
@@ -76,9 +76,6 @@ export AST_DEVMODE_STRICT # Enables shadow warnings (-Wshadow)
 export _SOLINK            # linker flags for all shared objects
 export SOLINK             # linker flags for loadable modules
 export DYLINK             # linker flags for shared libraries
-export STATIC_BUILD       # Additional cflags, set to -static
-                          # for static builds. Probably
-                          # should go directly to ASTLDFLAGS
 
 #--- paths to various commands
 # The makeopts include below tries to set these if they're found during
diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules
index 5d82088a95a6ac4c3f59a3801ed1697223612282..c9f94f979f76e087fcf2661dbfaf7a68da0d543e 100644
--- a/Makefile.moddir_rules
+++ b/Makefile.moddir_rules
@@ -18,10 +18,6 @@
 # Also note that we can only set one variable per rule, so we have to
 # repeat the left hand side to set multiple variables.
 
-ifneq ($(findstring STATIC_BUILD,$(MENUSELECT_CFLAGS)),)
-  STATIC_BUILD=-static
-endif
-
 include $(ASTTOPDIR)/Makefile.rules
 
 # If MODULE_PREFIX is defined, use it to run the standard functions to set
diff --git a/Makefile.rules b/Makefile.rules
index 2273644100ed0d590dc4402b1207a88fc9c33188..7f917b479f076f5b41322b0cfcc7b16c2e95b3b1 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -176,17 +176,17 @@ ifeq ($(GNU_LD),1)
 	$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* "$(LINKER_SYMBOL_PREFIX)" "$(ASTTOPDIR)"
 endif
 	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
-	$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
+	$(CMD_PREFIX) $(CC) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
 
 %.so: %.oo
 ifeq ($(GNU_LD),1)
 	$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script $* "$(LINKER_SYMBOL_PREFIX)" "$(ASTTOPDIR)"
 endif
 	$(ECHO_PREFIX) echo "   [LDXX] $^ -> $@"
-	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(CXX_LDFLAGS_SO) $^ $(CXX_LIBS)
+	$(CMD_PREFIX) $(CXX) -o $@ $(CXX_LDFLAGS_SO) $^ $(CXX_LIBS)
 
 %: %.o
 	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
-	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(PTHREAD_CFLAGS) $(_ASTLDFLAGS) $^ $(CXX_LIBS) $(ASTLDFLAGS)
+	$(CMD_PREFIX) $(CXX) -o $@ $(PTHREAD_CFLAGS) $(_ASTLDFLAGS) $^ $(CXX_LIBS) $(ASTLDFLAGS)
 
 dist-clean:: clean
diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c
index 688168e522885181b241fa48cc74c0959595a006..cdc57aaba6e669dd91ee24e1fbaae29d6c231eb6 100644
--- a/apps/app_adsiprog.c
+++ b/apps/app_adsiprog.c
@@ -36,7 +36,7 @@
 
 /*** MODULEINFO
 	<depend>res_adsi</depend>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk.h"
@@ -1610,7 +1610,7 @@ static int load_module(void)
 }
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Asterisk ADSI Programming Application",
-	.support_level = AST_MODULE_SUPPORT_EXTENDED,
+	.support_level = AST_MODULE_SUPPORT_DEPRECATED,
 	.load = load_module,
 	.unload = unload_module,
 	.requires = "res_adsi",
diff --git a/apps/app_dahdiras.c b/apps/app_dahdiras.c
index 03b34a22fd53d8138edf416a2b8faf47bacb5887..dffa2a4ee1edca194e76e2bfdeb8be6c5e4140eb 100644
--- a/apps/app_dahdiras.c
+++ b/apps/app_dahdiras.c
@@ -27,7 +27,7 @@
 
 /*** MODULEINFO
 	<depend>dahdi</depend>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk.h"
@@ -226,4 +226,4 @@ static int load_module(void)
 	return ((ast_register_application_xml(app, dahdiras_exec)) ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS);
 }
 
-AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "DAHDI ISDN Remote Access Server");
+AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "DAHDI ISDN Remote Access Server");
diff --git a/apps/app_db.c b/apps/app_db.c
index e3d55054874331e680c361f14616180bf5389287..7be8338eba8753d9cd1e7e13000758342eece72e 100644
--- a/apps/app_db.c
+++ b/apps/app_db.c
@@ -42,25 +42,6 @@
 #include "asterisk/lock.h"
 
 /*** DOCUMENTATION
-	<application name="DBdel" language="en_US">
-		<synopsis>
-			Delete a key from the asterisk database.
-		</synopsis>
-		<syntax argsep="/">
-			<parameter name="family" required="true" />
-			<parameter name="key" required="true" />
-		</syntax>
-		<description>
-			<para>This application will delete a <replaceable>key</replaceable> from the Asterisk
-			database.</para>
-			<note><para>This application has been DEPRECATED in favor of the DB_DELETE function.</para></note>
-		</description>
-		<see-also>
-			<ref type="function">DB_DELETE</ref>
-			<ref type="application">DBdeltree</ref>
-			<ref type="function">DB</ref>
-		</see-also>
-	</application>
 	<application name="DBdeltree" language="en_US">
 		<synopsis>
 			Delete a family or keytree from the asterisk database.
@@ -75,13 +56,11 @@
 		</description>
 		<see-also>
 			<ref type="function">DB_DELETE</ref>
-			<ref type="application">DBdel</ref>
 			<ref type="function">DB</ref>
 		</see-also>
 	</application>
  ***/
 
-static const char d_app[] = "DBdel";
 static const char dt_app[] = "DBdeltree";
 
 static int deltree_exec(struct ast_channel *chan, const char *data)
@@ -117,53 +96,14 @@ static int deltree_exec(struct ast_channel *chan, const char *data)
 	return 0;
 }
 
-static int del_exec(struct ast_channel *chan, const char *data)
-{
-	char *argv, *family, *key;
-	static int deprecation_warning = 0;
-
-	if (!deprecation_warning) {
-		deprecation_warning = 1;
-		ast_log(LOG_WARNING, "The DBdel application has been deprecated in favor of the DB_DELETE dialplan function!\n");
-	}
-
-	argv = ast_strdupa(data);
-
-	if (strchr(argv, '/')) {
-		family = strsep(&argv, "/");
-		key = strsep(&argv, "\0");
-		if (!family || !key) {
-			ast_debug(1, "Ignoring; Syntax error in argument\n");
-			return 0;
-		}
-		ast_verb(3, "DBdel: family=%s, key=%s\n", family, key);
-		if (ast_db_del(family, key))
-			ast_verb(3, "DBdel: Error deleting key from database.\n");
-	} else {
-		ast_debug(1, "Ignoring, no parameters\n");
-	}
-
-	return 0;
-}
-
 static int unload_module(void)
 {
-	int retval;
-
-	retval = ast_unregister_application(dt_app);
-	retval |= ast_unregister_application(d_app);
-
-	return retval;
+	return ast_unregister_application(dt_app);
 }
 
 static int load_module(void)
 {
-	int retval;
-
-	retval = ast_register_application_xml(d_app, del_exec);
-	retval |= ast_register_application_xml(dt_app, deltree_exec);
-
-	return retval;
+	return ast_register_application_xml(dt_app, deltree_exec);
 }
 
 AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Database Access Functions");
diff --git a/apps/app_getcpeid.c b/apps/app_getcpeid.c
index 868dc97c3bb8c9be4951ef557efafcc1968f96a3..3a12a1c1747d32ee513a039191eb7e89a853ff2a 100644
--- a/apps/app_getcpeid.c
+++ b/apps/app_getcpeid.c
@@ -26,7 +26,7 @@
  */
 
 /*** MODULEINFO
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk.h"
@@ -137,7 +137,7 @@ static int load_module(void)
 }
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Get ADSI CPE ID",
-	.support_level = AST_MODULE_SUPPORT_EXTENDED,
+	.support_level = AST_MODULE_SUPPORT_DEPRECATED,
 	.load = load_module,
 	.unload = unload_module,
 	.requires = "res_adsi",
diff --git a/apps/app_ices.c b/apps/app_ices.c
index 3be90c29b9e3044659c92764798f1bcb2af594e4..29127fc303fc9ae681ce01eea45afed1936f59ee 100644
--- a/apps/app_ices.c
+++ b/apps/app_ices.c
@@ -28,7 +28,7 @@
  */
 
 /*** MODULEINFO
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk.h"
@@ -211,4 +211,4 @@ static int load_module(void)
 	return ast_register_application_xml(app, ices_exec);
 }
 
-AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Encode and Stream via icecast and ices");
+AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Encode and Stream via icecast and ices");
diff --git a/apps/app_image.c b/apps/app_image.c
index b9087b766d2d795683a728cc1a42b4c5a96f6a98..5d70c8cd308a75b2568a84ab3be200f6d57a4b53 100644
--- a/apps/app_image.c
+++ b/apps/app_image.c
@@ -26,7 +26,7 @@
  */
 
 /*** MODULEINFO
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk.h"
@@ -104,4 +104,4 @@ static int load_module(void)
 	return ast_register_application_xml(app, sendimage_exec);
 }
 
-AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Image Transmission Application");
+AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Image Transmission Application");
diff --git a/apps/app_nbscat.c b/apps/app_nbscat.c
index 692093f0ffa73fcbf7a2875af7a44f256c4d27e5..a7fccaf0d9b42b83b8b7e76f2bd491adccb51f6e 100644
--- a/apps/app_nbscat.c
+++ b/apps/app_nbscat.c
@@ -26,7 +26,7 @@
  */
 
 /*** MODULEINFO
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk.h"
@@ -220,4 +220,4 @@ static int load_module(void)
 	return ast_register_application_xml(app, NBScat_exec);
 }
 
-AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Silly NBS Stream Application");
+AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Silly NBS Stream Application");
diff --git a/apps/app_setcallerid.c b/apps/app_setcallerid.c
deleted file mode 100644
index faa221808d8e1905faf1df8c52de02cdc73dcbd7..0000000000000000000000000000000000000000
--- a/apps/app_setcallerid.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2005, Digium, Inc.
- *
- * Mark Spencer <markster@digium.com>
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE file
- * at the top of the source tree.
- */
-
-/*! \file
- *
- * \brief App to set callerid presentation
- *
- * \author Mark Spencer <markster@digium.com>
- *
- * \ingroup applications
- */
-
-/*** MODULEINFO
-	<defaultenabled>no</defaultenabled>
-	<support_level>deprecated</support_level>
-	<replacement>func_callerid</replacement>
- ***/
-
-#include "asterisk.h"
-
-#include "asterisk/lock.h"
-#include "asterisk/file.h"
-#include "asterisk/channel.h"
-#include "asterisk/pbx.h"
-#include "asterisk/module.h"
-#include "asterisk/translate.h"
-#include "asterisk/image.h"
-#include "asterisk/callerid.h"
-
-/*** DOCUMENTATION
-	<application name="SetCallerPres" language="en_US">
-		<synopsis>
-			Set CallerID Presentation.
-		</synopsis>
-		<syntax>
-			<parameter name="presentation" required="true">
-				<enumlist>
-					<enum name="allowed_not_screened">
-						<para>Presentation Allowed, Not Screened.</para>
-					</enum>
-					<enum name="allowed_passed_screen">
-						<para>Presentation Allowed, Passed Screen.</para>
-					</enum>
-					<enum name="allowed_failed_screen">
-						<para>Presentation Allowed, Failed Screen.</para>
-					</enum>
-					<enum name="allowed">
-						<para>Presentation Allowed, Network Number.</para>
-					</enum>
-					<enum name="prohib_not_screened">
-						<para>Presentation Prohibited, Not Screened.</para>
-					</enum>
-					<enum name="prohib_passed_screen">
-						<para>Presentation Prohibited, Passed Screen.</para>
-					</enum>
-					<enum name="prohib_failed_screen">
-						<para>Presentation Prohibited, Failed Screen.</para>
-					</enum>
-					<enum name="prohib">
-						<para>Presentation Prohibited, Network Number.</para>
-					</enum>
-					<enum name="unavailable">
-						<para>Number Unavailable.</para>
-					</enum>
-				</enumlist>
-			</parameter>
-		</syntax>
-		<description>
-			<para>Set Caller*ID presentation on a call.</para>
-		</description>
-	</application>
- ***/
-
-static char *app2 = "SetCallerPres";
-
-static int setcallerid_pres_exec(struct ast_channel *chan, const char *data)
-{
-	int pres = -1;
-	static int deprecated = 0;
-
-	if (!deprecated) {
-		deprecated = 1;
-		ast_log(LOG_WARNING, "SetCallerPres is deprecated.  Please use Set(CALLERPRES()=%s) instead.\n", (char *)data);
-	}
-
-	/* For interface consistency, permit the argument to be specified as a number */
-	if (sscanf(data, "%30d", &pres) != 1 || pres < 0 || pres > 255 || (pres & 0x9c)) {
-		pres = ast_parse_caller_presentation(data);
-	}
-
-	if (pres < 0) {
-		ast_log(LOG_WARNING, "'%s' is not a valid presentation (see 'show application SetCallerPres')\n",
-			(char *) data);
-		return 0;
-	}
-
-	/* Set the combined caller id presentation. */
-	ast_channel_caller(chan)->id.name.presentation = pres;
-	ast_channel_caller(chan)->id.number.presentation = pres;
-	return 0;
-}
-
-static int unload_module(void)
-{
-	return ast_unregister_application(app2);
-}
-
-static int load_module(void)
-{
-	return ast_register_application_xml(app2, setcallerid_pres_exec);
-}
-
-AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Set CallerID Presentation Application");
diff --git a/apps/app_url.c b/apps/app_url.c
index e143cab19aec7778e28b3098258f4fea3dbde7fe..aced49e839c65ca866614b585b1fa371b928e527 100644
--- a/apps/app_url.c
+++ b/apps/app_url.c
@@ -26,7 +26,7 @@
  */
 
 /*** MODULEINFO
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk.h"
@@ -177,4 +177,4 @@ static int load_module(void)
 	return ast_register_application_xml(app, sendurl_exec);
 }
 
-AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Send URL Applications");
+AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Send URL Applications");
diff --git a/build_tools/cflags.xml b/build_tools/cflags.xml
index c4f9458ec6bd1253f5ac1e73167293fc5cac5cc7..6a956726c6c90bbc08414c32ae148a15ce5d1e74 100644
--- a/build_tools/cflags.xml
+++ b/build_tools/cflags.xml
@@ -16,9 +16,6 @@
 		<member name="AO2_DEBUG" displayname="Enable internal Astobj2 debugging">
 			<support_level>extended</support_level>
 		</member>
-		<member name="STATIC_BUILD" displayname="Build static binaries">
-			<support_level>extended</support_level>
-		</member>
 		<member name="DEBUG_FD_LEAKS" displayname="Enable File Descriptor Leak Detection">
 			<support_level>core</support_level>
 		</member>
diff --git a/cdr/cdr_sqlite.c b/cdr/cdr_sqlite.c
deleted file mode 100644
index aceff0f57a928e5aa9be10e7b02174da93911bb4..0000000000000000000000000000000000000000
--- a/cdr/cdr_sqlite.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 2004 - 2005, Holger Schurig
- *
- *
- * Ideas taken from other cdr_*.c files
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE file
- * at the top of the source tree.
- */
-
-/*!
- * \file
- * \brief Store CDR records in a SQLite database.
- *
- * \author Holger Schurig <hs4233@mail.mn-solutions.de>
- * SQLite http://www.sqlite.org/
- *
- * See also
- * \arg \ref Config_cdr
- * \arg http://www.sqlite.org/
- *
- * Creates the database and table on-the-fly
- * \ingroup cdr_drivers
- *
- * \note This module has been marked deprecated in favor for cdr_sqlite3_custom
- */
-
-/*** MODULEINFO
-	<depend>sqlite</depend>
-	<defaultenabled>no</defaultenabled>
-	<support_level>deprecated</support_level>
-	<replacement>sqlite3_custom</replacement>
- ***/
-
-#include "asterisk.h"
-
-#include <sqlite.h>
-
-#include "asterisk/channel.h"
-#include "asterisk/module.h"
-#include "asterisk/utils.h"
-#include "asterisk/paths.h"
-
-#define LOG_UNIQUEID    0
-#define LOG_USERFIELD   0
-#define LOG_HRTIME      0
-
-/* When you change the DATE_FORMAT, be sure to change the CHAR(19) below to something else */
-#define DATE_FORMAT "%Y-%m-%d %T"
-
-static const char name[] = "sqlite";
-static sqlite* db = NULL;
-
-AST_MUTEX_DEFINE_STATIC(sqlite_lock);
-
-/*! \brief SQL table format */
-static const char sql_create_table[] = "CREATE TABLE cdr ("
-"	AcctId		INTEGER PRIMARY KEY,"
-"	clid		VARCHAR(80),"
-"	src		VARCHAR(80),"
-"	dst		VARCHAR(80),"
-"	dcontext	VARCHAR(80),"
-"	channel		VARCHAR(80),"
-"	dstchannel	VARCHAR(80),"
-"	lastapp		VARCHAR(80),"
-"	lastdata	VARCHAR(80),"
-"	start		CHAR(19),"
-"	answer		CHAR(19),"
-"	end		CHAR(19),"
-#if LOG_HRTIME
-"	duration	FLOAT,"
-"	billsec		FLOAT,"
-#else
-"	duration	INTEGER,"
-"	billsec		INTEGER,"
-#endif
-"	disposition	INTEGER,"
-"	amaflags	INTEGER,"
-"	accountcode	VARCHAR(20)"
-#if LOG_UNIQUEID
-"	,uniqueid	VARCHAR(32)"
-#endif
-#if LOG_USERFIELD
-"	,userfield	VARCHAR(255)"
-#endif
-");";
-
-static void format_date(char *buffer, size_t length, struct timeval *when)
-{
-	struct ast_tm tm;
-
-	ast_localtime(when, &tm, NULL);
-	ast_strftime(buffer, length, DATE_FORMAT, &tm);
-}
-
-static int sqlite_log(struct ast_cdr *cdr)
-{
-	int res = 0;
-	char *zErr = 0;
-	char startstr[80], answerstr[80], endstr[80];
-	int count;
-#if LOG_HRTIME
-	double hrbillsec = 0.0;
-	double hrduration;
-#endif
-
-	ast_mutex_lock(&sqlite_lock);
-
-	format_date(startstr, sizeof(startstr), &cdr->start);
-	format_date(answerstr, sizeof(answerstr), &cdr->answer);
-	format_date(endstr, sizeof(endstr), &cdr->end);
-
-#if LOG_HRTIME
-	if (!ast_tvzero(cdr->answer)) {
-		hrbillsec = (double) ast_tvdiff_us(cdr->end, cdr->answer) / 1000000.0;
-	}
-	hrduration = (double) ast_tvdiff_us(cdr->end, cdr->start) / 1000000.0;
-#endif
-
-	for(count=0; count<5; count++) {
-		res = sqlite_exec_printf(db,
-			"INSERT INTO cdr ("
-				"clid,src,dst,dcontext,"
-				"channel,dstchannel,lastapp,lastdata, "
-				"start,answer,end,"
-				"duration,billsec,disposition,amaflags, "
-				"accountcode"
-#				if LOG_UNIQUEID
-				",uniqueid"
-#				endif
-#				if LOG_USERFIELD
-				",userfield"
-#				endif
-			") VALUES ("
-				"'%q', '%q', '%q', '%q', "
-				"'%q', '%q', '%q', '%q', "
-				"'%q', '%q', '%q', "
-#if LOG_HRTIME
-				"%f, %f, %d, %d, "
-#else
-				"%d, %d, %d, %d, "
-#endif
-				"'%q'"
-#				if LOG_UNIQUEID
-				",'%q'"
-#				endif
-#				if LOG_USERFIELD
-				",'%q'"
-#				endif
-			")", NULL, NULL, &zErr,
-				cdr->clid, cdr->src, cdr->dst, cdr->dcontext,
-				cdr->channel, cdr->dstchannel, cdr->lastapp, cdr->lastdata,
-				startstr, answerstr, endstr,
-#if LOG_HRTIME
-				hrduration, hrbillsec, cdr->disposition, cdr->amaflags,
-#else
-				cdr->duration, cdr->billsec, cdr->disposition, cdr->amaflags,
-#endif
-				cdr->accountcode
-#				if LOG_UNIQUEID
-				,cdr->uniqueid
-#				endif
-#				if LOG_USERFIELD
-				,cdr->userfield
-#				endif
-			);
-		if (res != SQLITE_BUSY && res != SQLITE_LOCKED)
-			break;
-		usleep(200);
-	}
-
-	if (zErr) {
-		ast_log(LOG_ERROR, "cdr_sqlite: %s\n", zErr);
-		ast_free(zErr);
-	}
-
-	ast_mutex_unlock(&sqlite_lock);
-	return res;
-}
-
-static int unload_module(void)
-{
-	if (ast_cdr_unregister(name)) {
-		return -1;
-	}
-
-	if (db) {
-		sqlite_close(db);
-	}
-	return 0;
-}
-
-static int load_module(void)
-{
-	char *zErr;
-	char fn[PATH_MAX];
-	int res;
-
-	ast_log(LOG_NOTICE, "This module has been marked deprecated in favor of "
-		"using cdr_sqlite3_custom.\n");
-
-	/* is the database there? */
-	snprintf(fn, sizeof(fn), "%s/cdr.db", ast_config_AST_LOG_DIR);
-	db = sqlite_open(fn, AST_FILE_MODE, &zErr);
-	if (!db) {
-		ast_log(LOG_ERROR, "cdr_sqlite: %s\n", zErr);
-		ast_free(zErr);
-		return AST_MODULE_LOAD_DECLINE;
-	}
-
-	/* is the table there? */
-	res = sqlite_exec(db, "SELECT COUNT(AcctId) FROM cdr;", NULL, NULL, NULL);
-	if (res) {
-		res = sqlite_exec(db, sql_create_table, NULL, NULL, &zErr);
-		if (res) {
-			ast_log(LOG_ERROR, "cdr_sqlite: Unable to create table 'cdr': %s\n", zErr);
-			ast_free(zErr);
-			goto err;
-		}
-
-		/* TODO: here we should probably create an index */
-	}
-
-	res = ast_cdr_register(name, ast_module_info->description, sqlite_log);
-	if (res) {
-		ast_log(LOG_ERROR, "Unable to register SQLite CDR handling\n");
-		return AST_MODULE_LOAD_DECLINE;
-	}
-	return AST_MODULE_LOAD_SUCCESS;
-
-err:
-	if (db)
-		sqlite_close(db);
-	return AST_MODULE_LOAD_DECLINE;
-}
-
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SQLite CDR Backend",
-	.support_level = AST_MODULE_SUPPORT_DEPRECATED,
-	.load = load_module,
-	.unload = unload_module,
-	.load_pri = AST_MODPRI_CDR_DRIVER,
-	.requires = "cdr",
-);
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index dc18d719697993e8a83b0b2c55e27a9984af6345..d17c4ad32ee4f90351ce99dccfb7d0008603a772 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -76,7 +76,8 @@
 	<depend>isdnnet</depend>
 	<depend>misdn</depend>
 	<depend>suppserv</depend>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
+	<replacement>chan_dahdi</replacement>
  ***/
 
 #include "asterisk.h"
@@ -12829,7 +12830,7 @@ static void chan_misdn_log(int level, int port, char *tmpl, ...)
 }
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Channel driver for mISDN Support (BRI/PRI)",
-	.support_level = AST_MODULE_SUPPORT_EXTENDED,
+	.support_level = AST_MODULE_SUPPORT_DEPRECATED,
 	.load = load_module,
 	.unload = unload_module,
 	.reload = reload,
diff --git a/channels/chan_nbs.c b/channels/chan_nbs.c
index 4a080a75b1bc54b25367a4b7b77b4b42678020f5..9a9e2669f88f89f9d6f62c9bc7b9fa8ed033b5c1 100644
--- a/channels/chan_nbs.c
+++ b/channels/chan_nbs.c
@@ -27,7 +27,7 @@
 
 /*** MODULEINFO
 	<depend>nbs</depend>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk.h"
@@ -270,4 +270,4 @@ static int load_module(void)
 	return AST_MODULE_LOAD_SUCCESS;
 }
 
-AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Network Broadcast Sound Support");
+AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Network Broadcast Sound Support");
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index ed4391b2882ea7659733b17a6c19a0043fe22052..7dde84fe660b3f0e56f81b7c7a6c110285a9968b 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -40,7 +40,7 @@
 
 /*** MODULEINFO
 	<depend>oss</depend>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk.h"
@@ -1524,4 +1524,4 @@ static int load_module(void)
 	return AST_MODULE_LOAD_SUCCESS;
 }
 
-AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "OSS Console Channel Driver");
+AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "OSS Console Channel Driver");
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index c33f27a876ba659f0c96f9b78eb5a96592df46c4..9c7703751a426974ebfce7d9bc41a11a164bd935 100644
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -35,7 +35,7 @@
 
 /*** MODULEINFO
 	<depend>ixjuser</depend>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk.h"
@@ -1514,4 +1514,4 @@ static int load_module(void)
 	return AST_MODULE_LOAD_SUCCESS;
 }
 
-AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Linux Telephony API Support");
+AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Linux Telephony API Support");
diff --git a/channels/chan_vpb.cc b/channels/chan_vpb.cc
index 7fdb9edb7bd4d6607bf52ca088e12df8bd47e4d4..e8cd961013b58825fb8ada796ab4548dd92e496d 100644
--- a/channels/chan_vpb.cc
+++ b/channels/chan_vpb.cc
@@ -50,7 +50,7 @@
 /*** MODULEINFO
 	<depend>vpb</depend>
 	<defaultenabled>no</defaultenabled>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include <vpbapi.h>
@@ -2875,4 +2875,4 @@ static enum ast_module_load_result load_module()
 #endif
 /**/
 
-AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Voicetronix API driver");
+AST_MODULE_INFO_STANDARD_DEPRECATED(ASTERISK_GPL_KEY, "Voicetronix API driver");
diff --git a/formats/format_jpeg.c b/formats/format_jpeg.c
deleted file mode 100644
index 250939c222275e5c0a52fe3bd45555a0dc2c8401..0000000000000000000000000000000000000000
--- a/formats/format_jpeg.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2005, Digium, Inc.
- *
- * Mark Spencer <markster@digium.com>
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE file
- * at the top of the source tree.
- */
-
-/*! \file
- *
- * \brief JPEG File format support.
- *
- * \arg File name extension: jpeg, jpg
- * \ingroup formats
- */
-
-/*** MODULEINFO
-	<support_level>extended</support_level>
- ***/
-
-#include "asterisk.h"
-
-#include "asterisk/mod_format.h"
-#include "asterisk/module.h"
-#include "asterisk/image.h"
-#include "asterisk/endian.h"
-#include "asterisk/format_cache.h"
-
-static struct ast_frame *jpeg_read_image(int fd, int len)
-{
-	struct ast_frame fr;
-	int res;
-	char buf[65536];
-	if (len > sizeof(buf) || len < 0) {
-		ast_log(LOG_WARNING, "JPEG image too large to read\n");
-		return NULL;
-	}
-	res = read(fd, buf, len);
-	if (res < len) {
-		ast_log(LOG_WARNING, "Only read %d of %d bytes: %s\n", res, len, strerror(errno));
-	}
-	memset(&fr, 0, sizeof(fr));
-	fr.frametype = AST_FRAME_IMAGE;
-	fr.subclass.format = ast_format_jpeg;
-	fr.data.ptr = buf;
-	fr.src = "JPEG Read";
-	fr.datalen = len;
-	return ast_frisolate(&fr);
-}
-
-static int jpeg_identify(int fd)
-{
-	char buf[10];
-	int res;
-	res = read(fd, buf, sizeof(buf));
-	if (res < sizeof(buf))
-		return 0;
-	if (memcmp(buf + 6, "JFIF", 4))
-		return 0;
-	return 1;
-}
-
-static int jpeg_write_image(int fd, struct ast_frame *fr)
-{
-	int res=0;
-	if (fr->datalen) {
-		res = write(fd, fr->data.ptr, fr->datalen);
-		if (res != fr->datalen) {
-			ast_log(LOG_WARNING, "Only wrote %d of %d bytes: %s\n", res, fr->datalen, strerror(errno));
-			return -1;
-		}
-	}
-	return res;
-}
-
-static struct ast_imager jpeg_format = {
-	.name = "jpg",
-	.desc = "JPEG (Joint Picture Experts Group)",
-	.exts = "jpg|jpeg",
-	.read_image = jpeg_read_image,
-	.identify = jpeg_identify,
-	.write_image = jpeg_write_image,
-};
-
-static int load_module(void)
-{
-	jpeg_format.format = ast_format_jpeg;
-	if (ast_image_register(&jpeg_format))
-		return AST_MODULE_LOAD_DECLINE;
-	return AST_MODULE_LOAD_SUCCESS;
-}
-
-static int unload_module(void)
-{
-	ast_image_unregister(&jpeg_format);
-
-	return 0;
-}
-
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "jpeg (joint picture experts group) image format",
-	.support_level = AST_MODULE_SUPPORT_EXTENDED,
-	.load = load_module,
-	.unload = unload_module,
-	.load_pri = AST_MODPRI_APP_DEPEND
-);
diff --git a/main/Makefile b/main/Makefile
index 5f02937773452e4bd4ca88969369c2e344e031e5..0e29c843f060f85ace9dd8f68088396ae5e06cee 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -205,7 +205,7 @@ ifeq ($(GNU_LD),1)
 	$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/make_linker_version_script libasteriskssl "$(LINKER_SYMBOL_PREFIX)" "$(ASTTOPDIR)"
 endif
 	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
-	$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
+	$(CMD_PREFIX) $(CC) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
 
 $(ASTSSL_LIB): $(ASTSSL_LIB).$(ASTSSL_SO_VERSION)
 	$(ECHO_PREFIX) echo "   [LN] $< -> $@"
@@ -224,7 +224,7 @@ $(ASTSSL_LIB): SOLINK=$(DYLINK)
 # Special rules for building a shared library (not a dynamically loadable module)
 $(ASTSSL_LIB): libasteriskssl.o
 	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
-	$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
+	$(CMD_PREFIX) $(CC) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
 endif
 
 endif
@@ -282,7 +282,7 @@ $(ASTPJ_LIB).$(ASTPJ_SO_VERSION): SOLINK=$(DYLINK)
 # type that are built by the standard rules)
 $(ASTPJ_LIB).$(ASTPJ_SO_VERSION): libasteriskpj.o libasteriskpj.exports
 	$(ECHO_PREFIX) echo "   [LD] $< -> $@"
-	$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $< $(CC_LIBS)
+	$(CMD_PREFIX) $(CC) -o $@ $(CC_LDFLAGS_SO) $< $(CC_LIBS)
 
 $(ASTPJ_LIB): $(ASTPJ_LIB).$(ASTPJ_SO_VERSION)
 	$(ECHO_PREFIX) echo "   [LN] $< -> $@"
@@ -301,7 +301,7 @@ $(ASTPJ_LIB): SOLINK=$(DYLINK)
 # Special rules for building a shared library (not a dynamically loadable module)
 $(ASTPJ_LIB): libasteriskpj.o
 	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
-	$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
+	$(CMD_PREFIX) $(CC) -o $@ $(CC_LDFLAGS_SO) $^ $(CC_LIBS)
 endif
 
 endif
@@ -312,7 +312,7 @@ tcptls.o: _ASTCFLAGS+=$(OPENSSL_INCLUDE) -Wno-deprecated-declarations
 $(MAIN_TGT): $(OBJS) $(MOD_OBJS) $(ASTSSL_LIB) $(ASTPJ_LIB)
 	@$(CC) -c -o buildinfo.o $(_ASTCFLAGS) buildinfo.c $(ASTCFLAGS)
 	$(ECHO_PREFIX) echo "   [LD] $(OBJS) $(MOD_OBJS) -> $@"
-	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(OBJS) $(MOD_OBJS) $(ASTSSL_LDLIBS) $(ASTPJ_LDLIBS) buildinfo.o $(AST_LIBS) $(GMIMELDFLAGS) $(LIBEDIT_LIB)
+	$(CMD_PREFIX) $(CXX) -o $@ $(ASTLINK) $(_ASTLDFLAGS) $(ASTLDFLAGS) $(OBJS) $(MOD_OBJS) $(ASTSSL_LDLIBS) $(ASTPJ_LDLIBS) buildinfo.o $(AST_LIBS) $(GMIMELDFLAGS) $(LIBEDIT_LIB)
 
 ifeq ($(GNU_LD),1)
 $(MAIN_TGT): asterisk.exports
diff --git a/menuselect/test/menuselect-tree b/menuselect/test/menuselect-tree
index 0fa5152dc0a7cbe34873326ac5266a66f0142532..40c08b69f163576fd44e583e64bf4cc3ae4f3373 100644
--- a/menuselect/test/menuselect-tree
+++ b/menuselect/test/menuselect-tree
@@ -535,8 +535,6 @@
 		</member>
 		<member name="DEBUG_THREADS" displayname="Enable Thread Debugging">
 		</member>
-		<member name="STATIC_BUILD" displayname="Build static binaries">
-		</member>
 		<member name="LOADABLE_MODULES" displayname="Runtime module loading">
 			<defaultenabled>yes</defaultenabled>
 		</member>
diff --git a/res/res_adsi.c b/res/res_adsi.c
index 698f935fbb0cd183b9175c6adbf284d5d35d5eaf..f8a2f5696c2e05a6250951e1b00bc54b653131fd 100644
--- a/res/res_adsi.c
+++ b/res/res_adsi.c
@@ -31,7 +31,7 @@
  */
 
 /*** MODULEINFO
-	<support_level>core</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk.h"
@@ -1208,7 +1208,7 @@ static int unload_module(void)
 }
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "ADSI Resource",
-	.support_level = AST_MODULE_SUPPORT_CORE,
+	.support_level = AST_MODULE_SUPPORT_DEPRECATED,
 	.load = load_module,
 	.unload = unload_module,
 	.reload = reload,
diff --git a/utils/conf2ael.c b/utils/conf2ael.c
index e3a905690910b2a8bc4046e203cdbed3b8b0db11..14b2aa904982bb1e97ca6f7a1b9d26f97472abc4 100644
--- a/utils/conf2ael.c
+++ b/utils/conf2ael.c
@@ -24,7 +24,7 @@
 
 /*** MODULEINFO
 	<depend>res_ael_share</depend>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #define ASTMM_LIBC ASTMM_IGNORE
diff --git a/utils/muted.c b/utils/muted.c
index 2cdd7e2291790e52eb20f4fee3d5e6eeb8b011a4..6a86a6753f8a0e31ae521c75d619f192672c84f8 100644
--- a/utils/muted.c
+++ b/utils/muted.c
@@ -45,7 +45,7 @@
  */
 
 /*** MODULEINFO
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
  ***/
 
 #include "asterisk/autoconfig.h"
diff --git a/utils/utils.xml b/utils/utils.xml
index 5b3a27ae3b8f250044096f4bc8641bd0d74eedab..777789a42f3fcd73172966132534fc6369ee4c0a 100644
--- a/utils/utils.xml
+++ b/utils/utils.xml
@@ -1,7 +1,7 @@
 <category name="MENUSELECT_UTILS" displayname="Utilities" positive_output="yes">
   <member name="aelparse">
 	<defaultenabled>no</defaultenabled>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
   </member>
   <member name="astcanary">
 	<defaultenabled>yes</defaultenabled>
@@ -18,7 +18,7 @@
   <member name="astman">
 	<defaultenabled>no</defaultenabled>
 	<depend>newt</depend>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
   </member>
   <member name="check_expr">
 	<defaultenabled>no</defaultenabled>
@@ -30,11 +30,11 @@
   </member>
   <member name="conf2ael">
 	<defaultenabled>no</defaultenabled>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
   </member>
   <member name="muted">
 	<defaultenabled>no</defaultenabled>
-	<support_level>extended</support_level>
+	<support_level>deprecated</support_level>
   </member>
   <member name="smsq">
 	<defaultenabled>no</defaultenabled>