]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
cdrel_custom: fix SQLite compatibility for versions < 3.20.0
authorphoneben <3232963@gmail.com>
Tue, 21 Apr 2026 20:13:54 +0000 (23:13 +0300)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Wed, 22 Apr 2026 19:03:29 +0000 (19:03 +0000)
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

res/cdrel_custom/config.c

index 1017e1de5ebcafd997665290f43fd8d183872cb3..25fa02d9056513f2c74acb1761da1fd9cbd8dbb9 100644 (file)
@@ -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),