Changeset 9580
- Timestamp:
- 05/03/10 08:37:37 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.8/directory/agi-bin/directory.agi
r9566 r9580 3 3 require_once(dirname(__FILE__).'/directory.lib.php'); 4 4 $loopcounter1=$loopcounter2=0; 5 $matches=false; 5 6 $search=array(); 6 7 $dir=new Dir(); … … 24 25 $matchesloop=0; 25 26 $matches=$dir->search($search,1); 26 dbug('$matches',$matches); 27 27 28 //prompt the caller for more info if there are too many results (and he didnt terminate with #) 28 29 while($matches > 1 && $matchesloop < $dir->dir['repeat_loops'] && substr($search,-1)!='#'){ modules/branches/2.8/directory/agi-bin/directory.lib.php
r9566 r9580 29 29 //get agi handel/inital agi vars, called by __construct() 30 30 function __construct_agi(){ 31 require_once(' /var/lib/asterisk/agi-bin/phpagi.php');//todo: remove hardcoded path31 require_once('phpagi.php'); 32 32 $agi=new AGI(); 33 33 foreach($agi->request as $key => $value){//strip agi_ prefix from keys 34 34 if(substr($key,0,4)=='agi_'){ 35 $opts[s tr_replace('agi_','',$key)]=$value;35 $opts[substr($key,4)]=$value; 36 36 } 37 37 } … … 58 58 //get ami handel, called by __construct() 59 59 function __construct_ami(){ 60 require_once( $this->agi_get_var('ASTAGIDIR').'/phpagi-asmanager.php');//todo: remove hardcoded path60 require_once('phpagi-asmanager.php'); 61 61 $ami=new AGI_AsteriskManager(); 62 62 return $ami; … … 66 66 function __construct_db(){ 67 67 require_once("DB.php"); 68 $dbhost=$this->agi_get_var('AMPDBHOST'); 69 $dbname=$this->agi_get_var('AMPDBNAME'); 70 $dbuser=$this->agi_get_var('AMPDBUSER'); 71 $dbpass=$this->agi_get_var('AMPDBPASS'); 72 $db=DB::connect('mysql://'.$dbuser.':'.$dbpass.'@'.$dbhost.'/'.$dbname); 68 $dsn=array( 69 'phptype' => $this->agi_get_var('AMPDBENGINE'), 70 'hostspec' => $this->agi_get_var('AMPDBHOST'), 71 'database' => $this->agi_get_var('AMPDBNAME'), 72 'username' => $this->agi_get_var('AMPDBUSER'), 73 'password' => $this->agi_get_var('AMPDBPASS'), 74 ); 75 $db=DB::connect($dsn); 73 76 return $db; 74 77 }
