- Timestamp:
- 03/06/06 10:07:41 (7 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/freepbx/amp_conf/bin/retrieve_iax_conf_from_mysql.pl
r912 r1019 32 32 $hostname = $ampconf->{"AMPDBHOST"}; 33 33 34 # the engine to be used for the SQL queries, 35 # if none supplied, backfall to mysql 36 $db_engine = "mysql"; 37 if (exists($ampconf->{"AMPDBENGINE"})) { 38 $db_engine = $ampconf->{"AMPDBENGINE"}; 39 } 34 40 35 41 ################### END OF CONFIGURATION ####################### 36 42 37 $additional = ""; 38 39 open EXTEN, ">$iax_conf" or die "Cannot create/overwrite extensions file: $iax_conf\n"; 40 41 $dbh = DBI->connect("dbi:mysql:dbname=$database;host=$hostname", "$username", "$password"); 43 if ( $db_engine eq "mysql" ) { 44 $dbh = DBI->connect("dbi:mysql:dbname=$database;host=$hostname", "$username", "$password"); 45 } 46 elsif ( $db_engine eq "pgsql" ) { 47 $dbh = DBI->connect("dbi:pgsql:dbname=$database;host=$hostname", "$username", "$password"); 48 } 49 elsif ( $db_engine eq "sqlite" ) { 50 if (!exists($ampconf->{"AMPDBFILE"})) { 51 print "No AMPDBFILE set in /etc/amportal.conf\n"; 52 exit; 53 } 54 55 my $db_file = $ampconf->{"AMPDBFILE"}; 56 $dbh = DBI->connect("dbi:SQLite2:dbname=$db_file","",""); 57 } 42 58 43 59 # items with id=0 get added for all users … … 51 67 exit; 52 68 } 69 70 open EXTEN, ">$iax_conf" or die "Cannot create/overwrite extensions file: $iax_conf\n"; 71 $additional = ""; 53 72 my @resultSet = @{$result}; 54 73 if ( $#resultSet > -1 ) {
