diff --git a/Api/Gql/Extensions.php b/Api/Gql/Extensions.php index ee3357064..adee3d0d7 100644 --- a/Api/Gql/Extensions.php +++ b/Api/Gql/Extensions.php @@ -107,7 +107,7 @@ public function mutationCallback() { $input = $this->getUpdatedValues($extensionExists,$users,$userman,$input); $this->freepbx->Core->delDevice($input['extension'], true); - $this->freepbx->Core->delUser($input['extension']); + $this->freepbx->Core->delUser($input['extension'], true); if(!empty($userman)) $this->freepbx->userman->deleteUserByID($userman['id']); $status = $this->freepbx->Core->processQuickCreate($input['tech'] ,$input['extension'],$input); diff --git a/Core.class.php b/Core.class.php index 25388afe4..31dc27f0d 100644 --- a/Core.class.php +++ b/Core.class.php @@ -2306,11 +2306,13 @@ public function delDevice($account,$editmode=false) { } //voicemail symlink - $spooldir = $this->config->get('ASTSPOOLDIR'); - $account = preg_replace("/\D/","",$account); - if(freepbx_trim ($account) !== "" && file_exists($spooldir."/voicemail/device/".$account)) { - exec("rm -f ".escapeshellarg($spooldir."/voicemail/device/".$account)); - } + if (!$editmode) { + $spooldir = $this->config->get('ASTSPOOLDIR'); + $account = preg_replace("/\D/", "", $account); + if (freepbx_trim($account) !== "" && file_exists($spooldir . "/voicemail/device/" . $account)) { + exec("rm -f " . escapeshellarg($spooldir . "/voicemail/device/" . $account)); + } + } } else { die_freepbx("Cannot connect to Asterisk Manager with ".$this->config->get("AMPMGRUSER")."/".$this->config->get("AMPMGRPASS")); }