Ticket #1784: sqlite3-new.patch

File sqlite3-new.patch, 3.1 kB (added by diego_iastrubni, 1 year ago)

new patch for sqlite3 support - problems...?

  • install.sql

    old new  
  • module.xml

    old new  
    11<module> 
    22        <rawname>disa</rawname> 
    33        <name>DISA</name> 
    4         <version>2.2</version> 
     4        <version>2.3</version> 
    55        <type>setup</type> 
    66        <category>Remote Access</category> 
    77        <menuitems> 
    88                <disa>DISA</disa> 
    99        </menuitems> 
    1010        <description>DISA Allows you 'Direct Inward System Access'. This gives you the ability to have an option on an IVR that gives you a dial tone, and you're able to dial out from the freePBX machine as if you were connected to a standard extension. It appears as a Destination.</description> 
    11         <changelog>*2.2* First release for FreePBX 2.2 - Fixed compatibility issue with new UI</changelog> 
     11        <changelog> 
     12                *2.3* Add SQLite3 support, fixes http://freepbx.org/trac/ticket/1784 
     13                *2.2* First release for FreePBX 2.2 - Fixed compatibility issue with new UI 
     14        </changelog> 
    1215        <location>release/2.2/disa-2.2.tgz</location> 
    1316        <info>http://aussievoip.com.au/wiki/freePBX-DISA</info> 
    1417        <md5sum>252f44814486f33bb06b71485678c79f</md5sum> 
  • uninstall.sql

    old new  
  • install.php

    old new  
    11<?php 
    22 
    33global $db; 
     4global $amp_conf; 
    45 
     6$autoincrement = (($amp_conf["AMPDBENGINE"] == "sqlite") || ($amp_conf["AMPDBENGINE"] == "sqlite3")) ? "AUTOINCREMENT":"AUTO_INCREMENT"; 
     7 
     8$sql = "CREATE TABLE IF NOT EXISTS manager ( 
     9        `manager_id` INTEGER NOT NULL  PRIMARY KEY $autoincrement, 
     10        `name` VARCHAR( 15 ) NOT NULL , 
     11        `secret` VARCHAR( 50 ) , 
     12        `deny` VARCHAR( 255 ) , 
     13        `permit` VARCHAR( 255 ) , 
     14        `read` VARCHAR( 50 ) , 
     15        `write` VARCHAR( 50 ) 
     16)"; 
     17 
     18$sql = "CREATE TABLE IF NOT EXISTS disa (  
     19        disa_id INTEGER NOT NULL PRIMARY KEY $autoincrement, 
     20        displayname VARCHAR( 50 ),  
     21        pin VARCHAR ( 50 ),  
     22        cid VARCHAR ( 50 ),  
     23        context VARCHAR ( 50 ),  
     24        digittimeout INTEGER,  
     25        resptimeout INTEGER,  
     26        needconf VARCHAR( 10 )  
     27);"; 
     28 
     29$check = $db->query($sql); 
     30if (DB::IsError($check)) { 
     31        die( "Can not create `disa` table: " . $check->getMessage() .  "\n"); 
     32} 
     33 
    534// Manage upgrade from DISA 1.0 
    635// r2.0 Add Timeouts and add wait for confirmation 
    736$sql = "SELECT digittimeout FROM disa"; 
    837$check = $db->getRow($sql, DB_FETCHMODE_ASSOC); 
    9 if(DB::IsError($check)) { 
     38if (DB::IsError($check)) { 
    1039        // add new fields - Digit Timeout 
    1140        $sql = 'ALTER TABLE disa ADD COLUMN digittimeout INT DEFAULT "5"'; 
    1241        $result = $db->query($sql); 
     
    2655        } 
    2756} 
    2857 
    29  
    3058?> 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads