The misc-destinations module is not working when the DB engine is sqlite3 (and 2). The reason, is that install.sql is not suited for those sql engines.
As I learned from ticket:1768, the best way is to remove the install.sql into install.php and detect the sql engine. The solution, shuold be clearing the install.sql file (see ticket:1772), and install.php should contain this code:
$autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT";
$sql = "CREATE TABLE IF NOT EXISTS miscdests (
id INTEGER NOT NULL PRIMARY KEY $autoincrement,
description VARCHAR( 100 ) NOT NULL ,
destdial VARCHAR( 100 ) NOT NULL
$check = $db->query($sql);
die("Can not create miscdests table\n");
While we are reviewing this module... the unsintall code is just wrong. We need to test if the table is installed, and not if is not installed.
This is the correct code for the uninstall.sql:
DROP TABLE IF EXISTS miscdests;
Remember sqlite2 does not like backticks, sqlite3 does like them, but on the branch we need to support sqlite2 as well. On the trunk (freePBX 2.3), sqlite2 is deprecated. See ticket:1727.