Changeset 5563

Show
Ignore:
Timestamp:
01/06/08 12:39:48 (4 years ago)
Author:
p_lindheimer
Message:

#2560 - convert iax notransfer to transfer in 1.4+; ad blindxfer, atxfer and automon to featurecode admin panel

Files:

Legend:

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

    r5562 r5563  
    219219    $output = ""; 
    220220 
     221    $ver12 = version_compare($ast_version, '1.4', 'lt'); 
     222 
    221223    $sql = "SELECT keyword,data from $table_name where id=-1 and keyword <> 'account' and flags <> 1"; 
    222224    $results = $db->getAll($sql, DB_FETCHMODE_ASSOC); 
     
    225227    } 
    226228    foreach ($results as $result) { 
    227       $additional .= $result['keyword']."=".$result['data']."\n"; 
     229      if ($ver12) { 
     230        $additional .= $result['keyword']."=".$result['data']."\n"; 
     231      } else { 
     232        $option = $result['data']; 
     233        switch ($result['keyword']) { 
     234          case 'notransfer': 
     235            if (strtolower($option) == 'yes') { 
     236              $additional .= "transfer=no\n"; 
     237            } else if (strtolower($option) == 'no') { 
     238              $additional .= "transfer=yes\n"; 
     239            } else if (strtolower($option) == 'mediaonly') { 
     240              $additional .= "transfer=mediaonly\n"; 
     241            } else { 
     242              $additional .= $result['keyword']."=$option\n"; 
     243            } 
     244            break; 
     245          default: 
     246            $additional .= $result['keyword']."=$option\n"; 
     247        } 
     248      } 
    228249    } 
    229250 
     
    246267      foreach ($results2 as $result2) { 
    247268        $options = explode("&", $result2['data']); 
    248         foreach ($options as $option) { 
    249           $output .= $result2['keyword']."=$option\n"; 
     269        if ($ver12) { 
     270          foreach ($options as $option) { 
     271            $output .= $result2['keyword']."=$option\n"; 
     272          } 
     273        } else { 
     274          foreach ($options as $option) { 
     275            switch ($result2['keyword']) { 
     276              case 'notransfer': 
     277                if (strtolower($option) == 'yes') { 
     278                  $output .= "transfer=no\n"; 
     279                } else if (strtolower($option) == 'no') { 
     280                  $output .= "transfer=yes\n"; 
     281                } else if (strtolower($option) == 'mediaonly') { 
     282                  $output .= "transfer=mediaonly\n"; 
     283                } else { 
     284                  $output .= $result2['keyword']."=$option\n"; 
     285                } 
     286                break; 
     287              default: 
     288                $output .= $result2['keyword']."=$option\n"; 
     289            } 
     290          } 
    250291        } 
    251292      } 
     
    519560        } 
    520561 
    521         $core_conf->addFeatureMap('blindxfer','##'); 
     562        $fcc = new featurecode($modulename, 'blindxfer'); 
     563        $code = $fcc->getCodeActive(); 
     564        unset($fcc); 
     565        if ($code != '') { 
     566          $core_conf->addFeatureMap('blindxfer',$code); 
     567        } 
     568 
     569        $fcc = new featurecode($modulename, 'atxfer'); 
     570        $code = $fcc->getCodeActive(); 
     571        unset($fcc); 
     572        if ($code != '') { 
     573          $core_conf->addFeatureMap('atxfer',$code); 
     574        } 
     575 
     576        $fcc = new featurecode($modulename, 'automon'); 
     577        $code = $fcc->getCodeActive(); 
     578        unset($fcc); 
     579        if ($code != '') { 
     580          $core_conf->addFeatureMap('automon',$code); 
     581        } 
     582 
    522583        $core_conf->addFeatureMap('disconnect','**'); 
    523         $core_conf->addFeatureMap('automon','*1'); 
    524584      } 
    525585 
  • modules/branches/2.4/core/install.php

    r4878 r5563  
    4343unset($fcc); 
    4444 
     45$fcc = new featurecode('core', 'blindxfer'); 
     46$fcc->setDescription('In-Call Asterisk Blind Transfer'); 
     47$fcc->setDefault('##'); 
     48$fcc->update(); 
     49unset($fcc); 
     50 
     51$fcc = new featurecode('core', 'atxfer'); 
     52$fcc->setDescription('In-Call Asterisk Attended Transfer'); 
     53$fcc->setDefault('*2'); 
     54$fcc->update(); 
     55unset($fcc); 
     56 
     57$fcc = new featurecode('core', 'automon'); 
     58$fcc->setDescription('In-Call Asterisk Toggle Call Recording'); 
     59$fcc->setDefault('*1'); 
     60$fcc->update(); 
     61unset($fcc); 
     62 
    4563?>