lisense
This commit is contained in:
@@ -1 +1 @@
|
|||||||
3040029
|
2922310
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
3040110
|
2922459
|
||||||
|
|||||||
@@ -135,11 +135,63 @@ Exec: /usr/bin/date +%A
|
|||||||
Exec: /usr/bin/date +%T
|
Exec: /usr/bin/date +%T
|
||||||
Exec: /usr/bin/date +%F
|
Exec: /usr/bin/date +%F
|
||||||
Exec: /usr/bin/timedatectl show | grep Timezone
|
Exec: /usr/bin/timedatectl show | grep Timezone
|
||||||
Date-Time: Monday 13:05:11 - 2026/10/19 (Asia/Tehran)
|
Date-Time: Tuesday 12:09:50 - 2026/10/27 (Asia/Tehran)
|
||||||
HDD:
|
HDD:
|
||||||
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
/dev/sda2 233 GB 61 GB 73 GB
|
/dev/sda2 233 GB 64 GB 76 GB
|
||||||
App WbSite: http://raymandcti.com/
|
App WbSite: http://raymandcti.com/
|
||||||
App Footer: Copyright Raymand Communications Naqsh Jahan, Inc. All Rights Reserved
|
App Footer: Copyright Raymand Communications Naqsh Jahan, Inc. All Rights Reserved
|
||||||
App Version: 3.0.0
|
App Version: 3.0.0
|
||||||
App Serial: 0000-0000-0000-0000
|
App Serial: 0000-0000-0000-0000
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
Exec: /usr/bin/cat /proc/cpuinfo | grep 'model name'
|
||||||
|
Exec: /usr/bin/du -s '/var/spool/asterisk/monitor/' | awk '{print $1}'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
> vite
|
> vite
|
||||||
|
|
||||||
|
|
||||||
VITE v7.2.7 ready in 226 ms
|
VITE v7.2.7 ready in 253 ms
|
||||||
|
|
||||||
➜ Local: http://localhost:3000/
|
➜ Local: http://localhost:3000/
|
||||||
➜ Network: use --host to expose
|
➜ Network: use --host to expose
|
||||||
|
|||||||
@@ -15,11 +15,14 @@ import ir.peeco.pline.repositories.BackupHistoryRepository;
|
|||||||
import org.apache.commons.net.ntp.NTPUDPClient;
|
import org.apache.commons.net.ntp.NTPUDPClient;
|
||||||
import org.apache.commons.net.ntp.NtpV3Packet;
|
import org.apache.commons.net.ntp.NtpV3Packet;
|
||||||
import org.apache.commons.net.ntp.TimeInfo;
|
import org.apache.commons.net.ntp.TimeInfo;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.http.client.ClientHttpResponse;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
@@ -29,6 +32,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
@@ -58,6 +62,8 @@ import java.util.regex.Pattern;
|
|||||||
@RequestMapping("/app")
|
@RequestMapping("/app")
|
||||||
public class AppControllers {
|
public class AppControllers {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(AppControllers.class);
|
||||||
|
|
||||||
private BackupHistoryRepository backupHistoryRepository;
|
private BackupHistoryRepository backupHistoryRepository;
|
||||||
private Environment env;
|
private Environment env;
|
||||||
private final ShellLogService logService;
|
private final ShellLogService logService;
|
||||||
@@ -174,10 +180,12 @@ public class AppControllers {
|
|||||||
if (mobile == null) {
|
if (mobile == null) {
|
||||||
throw new IllegalArgumentException("Mobile number is required");
|
throw new IllegalArgumentException("Mobile number is required");
|
||||||
}
|
}
|
||||||
URI uri = URI.create(ray2BaseUrl() + "/api/send-code?mobile="
|
URI uri = URI.create(ray2ApiUrl("send-code") + "?mobile="
|
||||||
+ URLEncoder.encode(mobile, StandardCharsets.UTF_8));
|
+ URLEncoder.encode(mobile, StandardCharsets.UTF_8)
|
||||||
ResponseEntity<JsonNode> result = new RestTemplate().getForEntity(uri, JsonNode.class);
|
+ "&app_type=cti");
|
||||||
addRay2Errors(requireRay2Response(result.getBody()), apiResult);
|
ResponseEntity<String> result = ray2RestTemplate().getForEntity(uri, String.class);
|
||||||
|
JsonNode response = new ObjectMapper().readTree(result.getBody());
|
||||||
|
addRay2Errors(requireRay2Response(response), apiResult);
|
||||||
apiResult.setHasError(!apiResult.getMessages().isEmpty());
|
apiResult.setHasError(!apiResult.getMessages().isEmpty());
|
||||||
return ResponseEntity.ok(apiResult);
|
return ResponseEntity.ok(apiResult);
|
||||||
}
|
}
|
||||||
@@ -191,7 +199,11 @@ public class AppControllers {
|
|||||||
apiResult.addMessage(result.getBody().getMessage());
|
apiResult.addMessage(result.getBody().getMessage());
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
if (licenseVersion == 2) {
|
||||||
|
logger.error("Ray2 send-code request failed", ex);
|
||||||
|
} else {
|
||||||
plineTools.plineLogger(ex.getLocalizedMessage());
|
plineTools.plineLogger(ex.getLocalizedMessage());
|
||||||
|
}
|
||||||
apiResult.addMessage("An error has occurred. try again");
|
apiResult.addMessage("An error has occurred. try again");
|
||||||
}
|
}
|
||||||
apiResult.setHasError(!apiResult.getMessages().isEmpty());
|
apiResult.setHasError(!apiResult.getMessages().isEmpty());
|
||||||
@@ -209,9 +221,9 @@ public class AppControllers {
|
|||||||
request.put("serial", Objects.toString(data.get("serial"), ""));
|
request.put("serial", Objects.toString(data.get("serial"), ""));
|
||||||
request.put("app_type", "cti");
|
request.put("app_type", "cti");
|
||||||
|
|
||||||
ResponseEntity<JsonNode> result = new RestTemplate().postForEntity(
|
ResponseEntity<String> result = ray2RestTemplate().postForEntity(
|
||||||
ray2BaseUrl() + "/api/mobile-verify", request, JsonNode.class);
|
ray2ApiUrl("mobile-verify"), request, String.class);
|
||||||
JsonNode response = requireRay2Response(result.getBody());
|
JsonNode response = requireRay2Response(new ObjectMapper().readTree(result.getBody()));
|
||||||
if (addRay2Errors(response, apiResult)) {
|
if (addRay2Errors(response, apiResult)) {
|
||||||
apiResult.setHasError(true);
|
apiResult.setHasError(true);
|
||||||
return ResponseEntity.ok(apiResult);
|
return ResponseEntity.ok(apiResult);
|
||||||
@@ -261,7 +273,11 @@ public class AppControllers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
if (licenseVersion == 2) {
|
||||||
|
logger.error("Ray2 mobile-verify request failed", ex);
|
||||||
|
} else {
|
||||||
System.out.println(ex.getLocalizedMessage());
|
System.out.println(ex.getLocalizedMessage());
|
||||||
|
}
|
||||||
apiResult.addMessage("An error has occurred. try again");
|
apiResult.addMessage("An error has occurred. try again");
|
||||||
}
|
}
|
||||||
apiResult.setHasError(!apiResult.getMessages().isEmpty());
|
apiResult.setHasError(!apiResult.getMessages().isEmpty());
|
||||||
@@ -274,9 +290,9 @@ public class AppControllers {
|
|||||||
try {
|
try {
|
||||||
if (isRay2LicenseMode()) {
|
if (isRay2LicenseMode()) {
|
||||||
Map<String, Object> request = buildRay2RegistrationRequest(data);
|
Map<String, Object> request = buildRay2RegistrationRequest(data);
|
||||||
ResponseEntity<JsonNode> result = new RestTemplate().postForEntity(
|
ResponseEntity<String> result = ray2RestTemplate().postForEntity(
|
||||||
ray2BaseUrl() + "/api/register", request, JsonNode.class);
|
ray2ApiUrl("register"), request, String.class);
|
||||||
JsonNode response = requireRay2Response(result.getBody());
|
JsonNode response = requireRay2Response(new ObjectMapper().readTree(result.getBody()));
|
||||||
if (addRay2Errors(response, apiResult)) {
|
if (addRay2Errors(response, apiResult)) {
|
||||||
apiResult.setHasError(true);
|
apiResult.setHasError(true);
|
||||||
return ResponseEntity.ok(apiResult);
|
return ResponseEntity.ok(apiResult);
|
||||||
@@ -332,7 +348,11 @@ public class AppControllers {
|
|||||||
plineTools.execLinuxCli("/usr/sbin/shutdown", new String[] { "-r", "now", "Online Register" }, true);
|
plineTools.execLinuxCli("/usr/sbin/shutdown", new String[] { "-r", "now", "Online Register" }, true);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
if (licenseVersion == 2) {
|
||||||
|
logger.error("Ray2 registration request failed", ex);
|
||||||
|
} else {
|
||||||
System.out.println(ex.getLocalizedMessage());
|
System.out.println(ex.getLocalizedMessage());
|
||||||
|
}
|
||||||
apiResult.addMessage("An error has occurred. try again");
|
apiResult.addMessage("An error has occurred. try again");
|
||||||
}
|
}
|
||||||
apiResult.setHasError(!apiResult.getMessages().isEmpty());
|
apiResult.setHasError(!apiResult.getMessages().isEmpty());
|
||||||
@@ -353,6 +373,21 @@ public class AppControllers {
|
|||||||
return ray2LicenseUrl.replaceAll("/+$", "");
|
return ray2LicenseUrl.replaceAll("/+$", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String ray2ApiUrl(String endpoint) {
|
||||||
|
return ray2BaseUrl() + "/api/license-api/" + endpoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
private RestTemplate ray2RestTemplate() {
|
||||||
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
restTemplate.setErrorHandler(new DefaultResponseErrorHandler() {
|
||||||
|
@Override
|
||||||
|
public boolean hasError(ClientHttpResponse response) throws IOException {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return restTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
private JsonNode requireRay2Response(JsonNode response) {
|
private JsonNode requireRay2Response(JsonNode response) {
|
||||||
if (response == null || response.isNull()) {
|
if (response == null || response.isNull()) {
|
||||||
throw new IllegalStateException("Ray2 returned an empty response");
|
throw new IllegalStateException("Ray2 returned an empty response");
|
||||||
@@ -393,6 +428,12 @@ public class AppControllers {
|
|||||||
? Map.of()
|
? Map.of()
|
||||||
: objectMapper.convertValue(data.get("attributes"), new TypeReference<Map<String, Object>>() { });
|
: objectMapper.convertValue(data.get("attributes"), new TypeReference<Map<String, Object>>() { });
|
||||||
Map<String, Object> request = new LinkedHashMap<>();
|
Map<String, Object> request = new LinkedHashMap<>();
|
||||||
|
Object serial = data.get("serial");
|
||||||
|
if (serial == null || serial.toString().isBlank()) {
|
||||||
|
throw new IllegalArgumentException("Serial is required for Ray2 registration");
|
||||||
|
}
|
||||||
|
request.put("serial", serial);
|
||||||
|
request.put("app_type", "cti");
|
||||||
for (String field : new String[] {
|
for (String field : new String[] {
|
||||||
"mobile_number", "f_name", "l_name", "company_name", "email", "phone_number", "address" }) {
|
"mobile_number", "f_name", "l_name", "company_name", "email", "phone_number", "address" }) {
|
||||||
Object value = attributes.getOrDefault(field, data.get(field));
|
Object value = attributes.getOrDefault(field, data.get(field));
|
||||||
|
|||||||
@@ -1230,7 +1230,7 @@ public class PlineTools {
|
|||||||
TARGET_DIR="$1"
|
TARGET_DIR="$1"
|
||||||
MAX_USED="$2"
|
MAX_USED="$2"
|
||||||
LOG_DIR="$3/log"
|
LOG_DIR="$3/log"
|
||||||
LOG_FILE="$LOG_DIR/deleted_audio_files.log"
|
LOG_FILE="$LOG_DIR/ "
|
||||||
|
|
||||||
mkdir -p "$LOG_DIR"
|
mkdir -p "$LOG_DIR"
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
TARGET_DIR="$1"
|
TARGET_DIR="$1"
|
||||||
MAX_USED="$2"
|
MAX_USED="$2"
|
||||||
LOG_DIR="$3/log"
|
LOG_DIR="$3/log"
|
||||||
LOG_FILE="$LOG_DIR/deleted_audio_files.log"
|
LOG_FILE="$LOG_DIR/ "
|
||||||
|
|
||||||
mkdir -p "$LOG_DIR"
|
mkdir -p "$LOG_DIR"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user