Skip to content

Commit

Permalink
Remove asmanager requirement to issabel-pbx installer. Fixes creation…
Browse files Browse the repository at this point in the history
… of trunks.db tables
  • Loading branch information
asternic committed May 3, 2024
1 parent f08a86c commit c0f0250
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion issabel-pbx.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Summary: Issabel PBX Module
Name: issabel-pbx
Version: 5.0.0
Release: 1
Release: 2
License: GPL
Group: Applications/System
Source0: issabel-%{modname}-%{version}.tar.gz
Expand Down
10 changes: 9 additions & 1 deletion setup/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,20 @@

require_once "/var/www/html/libs/paloSantoDB.class.php";
require_once "/var/www/html/libs/misc.lib.php";
require_once "/var/lib/asterisk/agi-bin/phpagi-asmanager.php";
//require_once "/var/lib/asterisk/agi-bin/phpagi-asmanager.php";

$DocumentRoot = (isset($_SERVER['argv'][1]))?$_SERVER['argv'][1]:"/var/www/html";
$DataBaseRoot = "/var/www/db";
$tmpDir = '/tmp/new_module/pbx'; # in this folder the load module extract the package content

/*
if (!file_exists("$DataBaseRoot/control_panel_design.db")) {
$cmd_mv = "mv $tmpDir/setup/control_panel_design.db $DataBaseRoot/";
$cmd_chown = "chown asterisk.asterisk $DataBaseRoot/control_panel_design.db";
exec($cmd_mv);
exec($cmd_chown);
}
*/

createTrunkDB($DataBaseRoot);
if (!file_exists("$DataBaseRoot/trunk.db")) {
Expand Down Expand Up @@ -528,15 +530,19 @@ function do_reloadAll($data_connection, $arrAST, $arrAMP, &$pDB)
$retrieve = $arrAMP['AMPBIN']['valor'].'/retrieve_conf';
exec($retrieve);

/*
//reload MOH to get around 'reload' not actually doing that, reload asterisk
$command_data = array("moh reload", "reload");
$arrResult = AsteriskManager_Command($data_connection['host'], $data_connection['user'], $data_connection['password'], $command_data);
*/

/*
if (isset($arrAMP['FOPRUN']['valor'])) {
//bounce op_server.pl
$wOpBounce = $arrAMP['AMPBIN']['valor'].'/bounce_op.sh';
exec($wOpBounce.' &>'.$arrAST['astlogdir']['valor'].'/issabelpbx-bounce_op.log');
}
*/

//store asterisk reloaded status
$sql = "UPDATE admin SET value = 'false' WHERE variable = 'need_reload'";
Expand All @@ -554,6 +560,7 @@ function do_reloadAll($data_connection, $arrAST, $arrAMP, &$pDB)
else return true;
}

/*
function AsteriskManager_Command($host, $user, $password, $command_data)
{
$salida = array();
Expand All @@ -574,4 +581,5 @@ function AsteriskManager_Command($host, $user, $password, $command_data)
}
return false;
}
*/
?>

0 comments on commit c0f0250

Please sign in to comment.