1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Fix patch for freepbx fix

This commit is contained in:
Anish Mangal 2019-05-22 04:48:03 +00:00
parent fae81ca105
commit 4169db3080
2 changed files with 27 additions and 27 deletions

View file

@ -35,7 +35,7 @@
- name: FreePBX - Patch FreePBX source - IIAB Bug 1685 - name: FreePBX - Patch FreePBX source - IIAB Bug 1685
patch: patch:
src: "roles/pbx/templates/71-freepbx-framework.patch" src: "roles/pbx/templates/71-freepbx-framework.patch"
dest: "{{ downloads_dir }}/{{ freepbx_src_dir }}/amp_conf/htdocs/admin/libraries/BMO/Framework.class.php" dest: "{{ freepbx_src_dir }}/amp_conf/htdocs/admin/libraries/BMO/Framework.class.php"
- name: FreePBX - Disable & Stop asterisk service - name: FreePBX - Disable & Stop asterisk service
systemd: systemd:

View file

@ -1,26 +1,26 @@
--- Framework.class.php 2019-05-22 08:37:49.748899666 +0530 --- Framework.class.php 2019-05-22 08:37:49.748899666 +0530
+++ Framework.class.php.new 2019-05-22 08:38:04.968584018 +0530 +++ Framework.class.php.new 2019-05-22 08:38:04.968584018 +0530
@@ -177,7 +177,7 @@ @@ -177,7 +177,7 @@
dbug("aborting early because previous errors"); dbug("aborting early because previous errors");
return false; return false;
} }
- if ($this->freepbx->astman->connected()) { - if ($this->freepbx->astman->connected()) {
+ if ($this->freepbx->astman && $this->freepbx->astman->connected()) { + if ($this->freepbx->astman && $this->freepbx->astman->connected()) {
$ast_ret = $this->freepbx->astman->Command('module reload manager'); $ast_ret = $this->freepbx->astman->Command('module reload manager');
} else { } else {
unset($output); unset($output);
@@ -187,12 +187,12 @@ @@ -187,12 +187,12 @@
$this->freepbx->Logger->log(FPBX_LOG_ERROR,_("Failed to reload AMI, manual reload will be necessary, try: [asterisk -rx 'module reload manager']")); $this->freepbx->Logger->log(FPBX_LOG_ERROR,_("Failed to reload AMI, manual reload will be necessary, try: [asterisk -rx 'module reload manager']"));
} }
} }
- if ($this->freepbx->astman->connected()) { - if ($this->freepbx->astman->connected()) {
+ if ($this->freepbx->astman && $this->freepbx->astman->connected()) { + if ($this->freepbx->astman && $this->freepbx->astman->connected()) {
$this->freepbx->astman->disconnect(); $this->freepbx->astman->disconnect();
} }
global $bootstrap_settings; global $bootstrap_settings;
- if (!$res = $this->freepbx->astman->connect($this->freepbx->Config->get('ASTMANAGERHOST') . ":" . $this->freepbx->Config->get('ASTMANAGERPORT'), $this->freepbx->Config->get('AMPMGRUSER') , $this->freepbx->Config->get('AMPMGRPASS'), $bootstrap_settings['astman_events'])) { - if (!$res = $this->freepbx->astman->connect($this->freepbx->Config->get('ASTMANAGERHOST') . ":" . $this->freepbx->Config->get('ASTMANAGERPORT'), $this->freepbx->Config->get('AMPMGRUSER') , $this->freepbx->Config->get('AMPMGRPASS'), $bootstrap_settings['astman_events'])) {
+ if (!$this->freepbx->astman || !$res = $this->freepbx->astman->connect($this->freepbx->Config->get('ASTMANAGERHOST') . ":" . $this->freepbx->Config->get('ASTMANAGERPORT'), $this->freepbx->Config->get('AMPMGRUSER') , $this->freepbx->Config->get('AMPMGRPASS'), $bootstrap_settings['astman_events'])) { + if (!$this->freepbx->astman || !$res = $this->freepbx->astman->connect($this->freepbx->Config->get('ASTMANAGERHOST') . ":" . $this->freepbx->Config->get('ASTMANAGERPORT'), $this->freepbx->Config->get('AMPMGRUSER') , $this->freepbx->Config->get('AMPMGRPASS'), $bootstrap_settings['astman_events'])) {
// couldn't connect at all // couldn't connect at all
$this->freepbx->Logger->log(FPBX_LOG_CRITICAL,"Connection attmempt to AMI failed"); $this->freepbx->Logger->log(FPBX_LOG_CRITICAL,"Connection attmempt to AMI failed");
return false; return false;