CREATE TABLE FaxChecker_Log
(
    id BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
    Fax BIGINT UNSIGNED NOT NULL,
    Provider BIGINT UNSIGNED DEFAULT NULL,
    Destination VARCHAR(15) DEFAULT NULL,
    OK TINYINT DEFAULT NULL,
    CallId VARCHAR(255) NOT NULL,
    ts BIGINT UNSIGNED NOT NULL,
    Exch VARCHAR(10) DEFAULT NULL,
    Duration INT UNSIGNED DEFAULT NULL,
    Error VARCHAR(255) DEFAULT NULL,
    Status ENUM("SENT", "FAIL", "VOICE", "NO_T38", "T38_REFUSED", "UNPARSEABLE", "BORDERCASE", "NODATA", "PACKETLOSS", "UNREASSEMBLED") DEFAULT NULL,
    UNIQUE KEY ( CallId ),
    KEY ( Provider,Destination ),
    KEY ( ts,Fax ),
    KEY Fax_2 ( Fax,ts ),
    KEY Destination ( Destination,OK )

) ENGINE=INNODB CHARSET=UTF8;
