Changeset 6533

Show
Ignore:
Timestamp:
09/01/08 15:38:42 (3 months ago)
Author:
p_lindheimer
Message:

remove some old code that should no longer be in wrt to trunks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.5/core/functions.inc.php

    r6531 r6533  
    30213021 
    30223022        //delete from globals table 
    3023         sql("DELETE FROM globals WHERE variable LIKE '%OUT_$trunknum' OR variable IN ('OUTCID_$trunknum','OUTMAXCHANS_$trunknum','OUTPREFIX_$trunknum','OUTKEEPCID_$trunknum','OUTFAIL_$trunknum','OUTDISABLE_$trunknum')"); 
    3024          
    3025         //write outids 
    3026         core_trunks_writeoutids(); 
    3027  
     3023        sql("DELETE FROM globals WHERE variable IN ('OUT_$trunknum','OUTCID_$trunknum','OUTMAXCHANS_$trunknum','OUTPREFIX_$trunknum','OUTKEEPCID_$trunknum','OUTFAIL_$trunknum','OUTDISABLE_$trunknum')"); 
     3024         
    30283025        // conditionally, delete from iax or sip 
    30293026        switch (strtolower($tech)) { 
     
    30763073        } 
    30773074         
    3078         core_trunks_writeoutids(); 
    3079  
    30803075        $disable_flag = ($disabletrunk == "on")?1:0; 
    30813076         
     
    32113206 
    32123207        //if no trunks have ever been defined, then create the proper variables with the default zap trunk 
     3208        // TODO: this looks dumb, updated to remove deprecated values but why can't there be no trunks? 
     3209        // 
    32133210        if (count($unique_trunks) == 0)  
    32143211        { 
    3215                 //If all trunks have been deleted from admin, dialoutids might still exist 
    3216                 sql("DELETE FROM globals WHERE variable = 'DIALOUTIDS'"); 
    3217          
    3218                 $glofields = array(array('OUT_1','ZAP/g0'), 
    3219                                                         array('DIAL_OUT_1','9'), 
    3220                                                         array('DIALOUTIDS','1')); 
    3221                 $compiled = $db->prepare('INSERT INTO globals (variable, value) values (?,?)'); 
    3222                 $result = $db->executeMultiple($compiled,$glofields); 
    3223                 if(DB::IsError($result)) 
    3224                 { 
    3225                         die_freepbx($result->getMessage()."<br><br>".$sql);      
    3226                 } 
     3212                sql("INSERT INTO globals (variable, value) values ('OUT_1','ZAP/g0')"); 
    32273213                $unique_trunks[] = array('OUT_1','ZAP/g0'); 
    32283214        } 
     
    32453231                return $unique_trunks; 
    32463232        } 
    3247 } 
    3248  
    3249 //write the OUTIDS global variable (used in dialparties.agi) 
    3250 function core_trunks_writeoutids() { 
    3251         // we have to escape _ for mysql: normally a wildcard (but not for sqlite3, it breaks!) 
    3252         if ($amp_conf["AMPDBENGINE"] == "sqlite3")  { 
    3253                 $sql = "SELECT variable FROM globals WHERE variable LIKE 'OUT_%'"; 
    3254         } 
    3255         else  { 
    3256                 $sql = "SELECT variable FROM globals WHERE variable LIKE 'OUT\\\_%'"; 
    3257         } 
    3258         $unique_trunks = sql($sql,"getAll");  
    3259  
    3260         $outids = null; // Start off with nothing 
    3261         foreach ($unique_trunks as $unique_trunk) { 
    3262                 $outid = strtok($unique_trunk[0],"_"); 
    3263                 $outid = strtok("_"); 
    3264                 $outids .= $outid ."/"; 
    3265         } 
    3266          
    3267         sql("UPDATE globals SET value = '$outids' WHERE variable = 'DIALOUTIDS'"); 
    32683233} 
    32693234 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads