From: phoneben <3232963@gmail.com> Date: Tue, 21 Apr 2026 20:13:54 +0000 (+0300) Subject: cdrel_custom: fix SQLite compatibility for versions < 3.20.0 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48e82dec45d900b12a22e7a66bc06bd9a99c82cd;p=thirdparty%2Fasterisk.git cdrel_custom: fix SQLite compatibility for versions < 3.20.0 cdrel_custom: fix SQLite compatibility for versions < 3.20.0 Replace sqlite3_prepare_v3 + SQLITE_PREPARE_PERSISTENT with a version-guarded fallback to sqlite3_prepare_v2 for older SQLite builds. Resolves: #1885 --- diff --git a/res/cdrel_custom/config.c b/res/cdrel_custom/config.c index 1017e1de5e..25fa02d905 100644 --- a/res/cdrel_custom/config.c +++ b/res/cdrel_custom/config.c @@ -873,7 +873,11 @@ static int open_database(struct cdrel_config *config) return -1; } +#if SQLITE_VERSION_NUMBER >= 3020000 res = sqlite3_prepare_v3(config->db, sql, -1, SQLITE_PREPARE_PERSISTENT, &config->insert, NULL); +#else + res = sqlite3_prepare_v2(config->db, sql, -1, &config->insert, NULL); +#endif if (res != SQLITE_OK) { ast_log(LOG_ERROR, "%s->%s: Unable to prepare INSERT statement '%s': %s\n", cdrel_basename(config->config_filename), cdrel_basename(config->output_filename),