Oh, now i see why i need to restart it everytime lol. Thank you so much!
I got what you said precisely after looking onto the Provisioning Script you linked, but, for some reason, when i set the same script for Provision, he consults the API, get the right return, but, the declare doesn’t set the VParam. When i set the same script on Virtual Parameter tab, it works, but, if i do so, i’ll need to somehow update it’s value on some other Provision Script i guess.
This VParam update would need to be done bt calling its script, not setting an old value again, like the hourly from Default Provisioning. Check it out:
const now = Date.now();
const usernameParam = declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.Username", { value: 1 }).value[0];
const data = ext("cpe-olt", "SetOLT", usernameParam);
if (data.length > 0) {
declare("VirtualParameters.DeviceOLT", { value: data[0].ssid });
log(`DeviceOLT definido para: ${data[0].ssid}`);
return {writable: false, value: [data[0].ssid, "xsd:string"]}
} else {
log("Unable to get API values.");
declare("VirtualParameters.DeviceOLT", { value: "" });
return {writable: false, value: ["", "xsd:string"]}
}
Any thoughts on what could be happening? I’m actually working on GenieACS for 2 weeks by now, so, if i was mistaken on anything i said, it would be a great pleasure if you could give me a hint on how to work things out.
PS: I did some updates to optimize the process and set the PPPoE as a Parameter to call the Extension, then, the API would only return it’s OLT, not a enormous array of data.