Changeset 9088

Show
Ignore:
Timestamp:
03/06/10 23:04:02 (2 years ago)
Author:
p_lindheimer
Message:

additional work towards new outbound route schema re #4110 still not and minimal tested

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/upgrades/2.8.0alpha1/tables.php

    r9082 r9088  
    3232  `match_pattern_prefix` VARCHAR( 60 ), 
    3333  `match_pattern_pass` VARCHAR( 60 ), 
     34  `match_cid` VARCHAR( 60 ), 
    3435  `prepend_digits` VARCHAR( 100 ), 
    35   PRIMARY KEY (`route_id`, `match_pattern_prefix`, `match_pattern_pass`
     36  PRIMARY KEY (`route_id`, `match_pattern_prefix`, `match_pattern_pass`,`match_cid`,`prepend_digits`
    3637) 
    3738"; 
     
    135136            $parts = explode('|',$pattern,2); 
    136137            if (count($parts) == 1) { 
    137               $insert_patterns[] = array($route_id, '', $pattern); 
     138              $prepend = ''; 
     139              $exten = $pattern; 
    138140            } else { 
    139               $insert_patterns[] = array($route_id, $parts[0], $parts[1]); 
     141              $prepend = $parts[0]; 
     142              $exten = $parts[1]; 
     143            } 
     144            $parts = explode('/',$exten,2); 
     145            if (count($parts) == 1) { 
     146              $insert_patterns[] = array($route_id, $prepend, $exten, ''); 
     147            } else { 
     148              if ($parts[1][0] == "_") { 
     149                $parts[1] = substr($parts[1],1); 
     150              } 
     151              $insert_patterns[] = array($route_id, $prepend, $parts[0], $parts[1]); 
    140152            } 
    141153          } 
    142           $compiled = $db->prepare('INSERT INTO `outbound_route_patterns` (`route_id`, `match_pattern_prefix`, `match_pattern_pass`) values (?,?,?)'); 
     154          $compiled = $db->prepare('INSERT INTO `outbound_route_patterns` (`route_id`, `match_pattern_prefix`, `match_pattern_pass`, `match_cid`) values (?,?,?,?)'); 
    143155          $result = $db->executeMultiple($compiled,$insert_patterns); 
    144156          if(DB::IsError($result)) {