CREATE TABLE SimpleDialer
(
    id BIGINT UNSIGNED DEFAULT NULL,
    E164 VARCHAR(100) NOT NULL,
    Channel VARCHAR(200) DEFAULT NULL,
    IP VARCHAR(15) DEFAULT NULL,
    Person BIGINT UNSIGNED DEFAULT NULL,
    Zone BIGINT UNSIGNED DEFAULT NULL,

    /* Object that will handle the call, static or not */

   Node BIGINT UNSIGNED DEFAULT NULL,
    Class VARCHAR(70) DEFAULT NULL,
    CallerName VARCHAR(15) DEFAULT NULL,
    CallerNumber VARCHAR(11) DEFAULT NULL,
    Calls TINYINT UNSIGNED DEFAULT 0,
    Retries TINYINT UNSIGNED DEFAULT 3,
    Status ENUM("QUEUE", "REQUEUE", "ANSWER", "COMPLETE", "FAIL", "GIVEUP") DEFAULT "QUEUE",
    NextTime BIGINT UNSIGNED DEFAULT 0,
    LockId CHAR(32) DEFAULT NULL,
    Priority TINYINT UNSIGNED DEFAULT 100,
    Expires BIGINT UNSIGNED NOT NULL,
    Parameters TEXT DEFAULT NULL,
    IsT38 TINYINT DEFAULT 0,
    ts BIGINT UNSIGNED DEFAULT 0,
    PRIMARY KEY ( id ) AUTO_INCREMENT,
    KEY ( LockId ),
    KEY ( Status,LockId )

) ENGINE=INNODB CHARSET=UTF8;
