Changeset 3896

Show
Ignore:
Timestamp:
04/02/07 21:17:12 (6 years ago)
Author:
p_lindheimer
Message:

open one connection to manager at begining of dialparties instead of each time is_ext_avail() is called

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.2/amp_conf/agi-bin/dialparties.agi

    r3872 r3896  
    4141$AGI = new AGI(); 
    4242debug("Starting New Dialparties.agi", 1); 
     43 
     44$astman = new AGI_AsteriskManager( );  
     45if (!$astman->connect("127.0.0.1", $config["AMPMGRUSER"] , $config["AMPMGRPASS"])) { 
     46  exit (1); 
     47} 
     48   
    4349 
    4450$priority = get_var( $AGI, "priority" ) + 1; 
     
    470476} 
    471477 
     478$astman->disconnect(); 
     479 
    472480// EOF dialparties.agi 
    473481exit( 0 ); 
     
    547555{ 
    548556  global $config; 
    549      
    550   $astman = new AGI_AsteriskManager( );  
    551   if (!$astman->connect("127.0.0.1", $config["AMPMGRUSER"] , $config["AMPMGRPASS"])) 
    552   { 
    553     return false; 
    554   } 
     557  global $astman; 
    555558   
    556559  $status = $astman->ExtensionState( $extnum, 'from-internal' ); 
    557   $astman->disconnect(); 
    558560     
    559561  $status = $status['Status']; 
    560562  debug("ExtensionState: $status", 4); 
    561563  return $status; 
    562    
    563564} 
    564565