Changeset 2651

Show
Ignore:
Timestamp:
10/05/06 02:28:41 (7 years ago)
Author:
gregmac
Message:

Backported some additions to extensions from 2.2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.1/amp_conf/htdocs/admin/extensions.class.php

    r2282 r2651  
    3636    if ($basetag || $addpriority) { 
    3737      if (!is_int($addpriority) || ($addpriority < 1)) { 
    38         trigger_error(E_ERROR, "\$addpriority must be >= 1 in extensions::add()"); 
     38        trigger_error("\$addpriority must be an integer >= 1 in extensions::add()"); 
    3939        return false; 
    4040      } 
    4141      if (empty($basetag)) { 
    42         trigger_error(E_ERROR, "\$basetag is required with \$addpriority in extensions::add()"); 
     42        trigger_error("\$basetag is required with \$addpriority in extensions::add()"); 
    4343        return false; 
    4444      } 
     
    282282  var $data; 
    283283   
    284   function extension($data) { 
     284  function extension($data = '') { 
    285285    $this->data = $data; 
    286286  } 
     
    302302  function ext_goto($pri, $ext = false, $context = false) { 
    303303    if ($context !== false && $ext === false) { 
    304       trigger_error(E_ERROR, "\$ext is required when passing \$context in ext_goto::ext_goto()"); 
     304      trigger_error("\$ext is required when passing \$context in ext_goto::ext_goto()"); 
    305305    } 
    306306     
     
    385385  } 
    386386} 
     387class ext_set extends ext_setvar {} // alias, SetVar was renamed to Set in ast 1.2 
    387388 
    388389class ext_wait extends extension { 
     
    487488  var $maxdigits; 
    488489  var $option; 
    489    
    490   function ext_read($astvar, $filename='', $maxdigits='', $option='') { 
     490  var $attempts; // added in ast 1.2 
     491  var $timeout;  // added in ast 1.2 
     492   
     493  function ext_read($astvar, $filename='', $maxdigits='', $option='', $attempts ='', $timeout ='') { 
    491494    $this->astvar = $astvar; 
    492495    $this->filename = $filename; 
    493496    $this->maxdigits = $maxdigits; 
    494497    $this->option = $option; 
    495   } 
    496    
    497   function output() { 
    498     return "Read(".$this->astvar.",".$this->filename.",".$this->maxdigits.",".$this->option.")"; 
     498    $this->attempts = $attempts; 
     499    $this->timeout = $timeout; 
     500  } 
     501   
     502  function output() { 
     503    return "Read(".$this->astvar.",".$this->filename.",".$this->maxdigits.",".$this->option.",".$this->attempts.",".$this->timeout.")"; 
    499504  } 
    500505} 
     
    551556  } 
    552557} 
     558class ext_dbdeltree extends extension { 
     559  function output() { 
     560    return "dbDeltree(".$this->data.")"; 
     561  } 
     562} 
     563class ext_dbget extends extension { 
     564  var $varname; 
     565  var $key; 
     566  function ext_dbget($varname, $key) { 
     567    $this->varname = $varname; 
     568    $this->key = $key; 
     569  } 
     570  function output() { 
     571    return "dbGet(".$this->varname."=".$this->key.")"; 
     572  } 
     573} 
     574class ext_dbput extends extension { 
     575  var $key; 
     576  function ext_dbput($key, $data) { 
     577    $this->key = $key; 
     578    $this->data = $data; 
     579  } 
     580  function output() { 
     581    return "dbPut(".$this->key."=".$this->data.")"; 
     582  } 
     583} 
    553584class ext_vmmain extends extension { 
    554585  function output() { 
     
    597628  } 
    598629} 
     630class ext_saynumber extends extension { 
     631  var $gender; 
     632  function ext_saynumber($data, $gender = 'f') { 
     633    parent::extension($data); 
     634    $this->gender = $gender; 
     635  } 
     636  function output() { 
     637    return "SayNumber(".$this->data.",".$this->gender.")"; 
     638  } 
     639} 
     640class ext_sayphonetic extends extension { 
     641  function output() { 
     642    return "SayPhonetic(".$this->data.")"; 
     643  } 
     644} 
    599645class ext_system extends extension { 
    600646  function output() { 
     
    607653  } 
    608654} 
     655class ext_pickup extends extension { 
     656  function output() { 
     657    return "Pickup(".$this->data.")"; 
     658  } 
     659} 
     660class ext_dpickup extends extension { 
     661  function output() { 
     662    return "DPickup(".$this->data.")"; 
     663  } 
     664}        
     665class ext_lookupcidname extends extension { 
     666  function output() { 
     667    return "LookupCIDName"; 
     668  } 
     669} 
     670 
     671 
     672class ext_ringing extends extension { 
     673  function output() { 
     674    return "Ringing()"; 
     675  } 
     676} 
     677 
     678class ext_db_put extends extension { 
     679  var $family; 
     680  var $key; 
     681  var $value; 
     682   
     683  function ext_db_put($family, $key, $value) { 
     684    $this->family = $family; 
     685    $this->key = $key; 
     686    $this->value = $value; 
     687  } 
     688   
     689  function output() { 
     690    return 'Set(DB('.$this->family.'/'.$this->key.')='.$this->value.')'; 
     691  } 
     692} 
     693 
     694class ext_zapateller extends extension { 
     695  function output() { 
     696    return "Zapateller(".$this->data.")"; 
     697  } 
     698} 
     699 
     700class ext_musiconhold extends extension { 
     701  function output() { 
     702    return "MusicOnHold(".$this->data.")"; 
     703  } 
     704} 
     705 
     706class ext_congestion extends extension { 
     707  function output() { 
     708    return "Congestion"; 
     709  } 
     710} 
     711 
     712class ext_busy extends extension { 
     713  function output() { 
     714    return "Busy"; 
     715  } 
     716} 
     717 
    609718class ext_flite extends extension { 
    610719  function output() {