mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2025-11-05 05:08:06 +00:00
Support both internal and external rttys
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "framework/KafkaTopics.h"
|
||||
#include "framework/RESTAPI_errors.h"
|
||||
#include "framework/ConfigurationValidator.h"
|
||||
#include "rttys/RTTYS_server.h"
|
||||
|
||||
namespace OpenWifi {
|
||||
|
||||
@@ -711,7 +712,7 @@ void RESTAPI_device_commandHandler::MakeRequest() {
|
||||
|
||||
void RESTAPI_device_commandHandler::Rtty() {
|
||||
Logger_.information(Poco::format("RTTY: user=%s serial=%s", UserInfo_.userinfo.email,SerialNumber_));
|
||||
if (MicroService::instance().ConfigGetString("rtty.enabled", "false") == "true") {
|
||||
if (MicroService::instance().ConfigGetBool("rtty.enabled", false)) {
|
||||
GWObjects::Device Device;
|
||||
if (StorageService()->GetDevice(SerialNumber_, Device)) {
|
||||
auto CommandUUID = MicroService::CreateUUID();
|
||||
@@ -726,9 +727,14 @@ void RESTAPI_device_commandHandler::MakeRequest() {
|
||||
.Started = (uint64_t)time(nullptr),
|
||||
.CommandUUID = CommandUUID,
|
||||
.ViewPort = MicroService::instance().ConfigGetInt("rtty.viewport", 5913),
|
||||
|
||||
};
|
||||
|
||||
if(RTTYS_server()->UseInternal()) {
|
||||
Rtty.ConnectionId = MicroService::instance().CreateHash(std::to_string(std::time(nullptr))+SerialNumber_);
|
||||
Rtty.Token = MicroService::instance().CreateHash(UserInfo_.webtoken.refresh_token_ + std::to_string(std::time(nullptr)));
|
||||
RTTYS_server()->CreateEndPoint(Rtty.ConnectionId,Rtty.Token);
|
||||
}
|
||||
|
||||
Poco::JSON::Object ReturnedObject;
|
||||
Rtty.to_json(ReturnedObject);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user