TR-69 implement MVP
- Torsten Schmidt
1. Build GenieACS RPM package(s)
Test if it makes sense to build and reference our own RPM package..
This requires to solve dependencies for mongodb and nodejs.
2. Build test environment
Goal:
- get modem to talk with ACS
- get to know and try most important API calls and document them here
- Build NMS Prime Test Lab(s)
Feedback assumes MVP is simply reached with one API call:
Mail from Zitomedia
So again, we have not defined any requirements or required functionality of the ACS server as far as provisioning operations. All we've done, via the OLT CLI, is to instruct all ONUs to connect to the ACS server and provide its TR-069 parameters to the server.
Mainly as a proof of concept, the server does have one function which is if a device announces itself as a certain 'Product Class' (a defined TR-069 parameter which is like a model number), we change that device's admin password. It also tells the device to send updates to the ACS server every 2 minutes and sets the firewall mode to a high level.
The 'Preset' was configured via the GenieACS-GUI but can be configured via API. Here's the 'Preset' from the API.
$ curl 'http://<ip>:7557/presets/?query=%7B%22_id%22%3A%22F680-AdminStuff%22%7D' [ {"_id":"F680-AdminStuff","channel":"","weight":10,"precondition":"{\"InternetGatewayDevice.DeviceInfo.ProductClass\":\"F680\"}","configurations":[{"type":"value","name":"InternetGatewayDevice.X_ZTE-COM_UserInterface.X_ZTE-COM_WebUserInfo.AdminPassword","value":"thisisapassword"},{"type":"value","name":"InternetGatewayDevice.ManagementServer.PeriodicInformInterval","value":"120"},{"type":"value","name":"InternetGatewayDevice.X_ZTE-COM_UserInterface.X_ZTE-COM_WebUserInfo.AdminName","value":"admin"},{"type":"value","name":"InternetGatewayDevice.X_ZTE-COM_Security.X_ZTE-COM_FirewallLevel","value":"HIGH"},{"type":"value","name":"InternetGatewayDevice.X_ZTE-COM_UserInterface.X_ZTE-COM_WebUserInfo.UserName","value":"user"},{"type":"value","name":"InternetGatewayDevice.X_ZTE-COM_UserInterface.X_ZTE-COM_WebUserInfo.UserEnable","value":"true"},{"type":"value","name":"InternetGatewayDevice.X_ZTE-COM_UserInterface.X_ZTE-COM_WebUserInfo.UserPassword","value":"thisisanotherpasswrd"}],"schedule":"","events":{}} ]
See: https://github.com/genieacs/genieacs/wiki/API-Reference#put-presetspreset_name
3. Implement MVP
The first step SHOULD be creating a Minimum Viable Product. We define MVP as: "FTTH device is online and working". After this we will reiterate next R&D steps.
3.1 Save API command Array in Configfiles
This will be solved in 2. FreeRADIUS implementation and could look like
Check notes at 2. FreeRADIUS implementation.
3.2 Connect Modem Observer with API call
1. At the time a DOCSIS configfile is build if a Modem Model is added or changed via Modem Oberservs updated() function. Checkout:
https://github.com/nmsprime/nmsprime/blob/dev/modules/ProvBase/Entities/Modem.php#L1643
It calls make_configfile() here
https://github.com/nmsprime/nmsprime/blob/dev/modules/ProvBase/Entities/Modem.php#L1643
2. There SHOULD be a second function e.g. called make_tr069_call() which must be called when a TR-69 device is added or changed
This function need to parse TR-69 JSON array from configfiles tree, like we do it in make_configfile()
$text = "Main\n{\n".$conf.$this->configfile->text_make($this, 'modem')."\n}";
3. Of cause we need to have a look inside Modem Observers and do something like
if (modem->configfile->type == 'TR-069') make_tr069_call() if (modem->configfile->type == 'DOCSIS') make_configfile()
4. HTTP POST: After building the final JSON array, we simply need to send a HTTP PUT or POST command, like in the example above. This could be done either using PHP system call or Laravel/PHP build-in functions. Since PRESETS CALL is either for CREATE or UPDATE we do not need to handle them differently.
5. We should consider if deleting a Modem should call https://github.com/genieacs/genieacs/wiki/API-Reference#delete-filesfile_name
6. Consider, test and adapt if changing child objects like MTA, Phonenumbers MUST run make_tr069_call()
Note: Example Observer from Modem Model:
https://github.com/nmsprime/nmsprime/blob/dev/modules/ProvBase/Entities/Modem.php#L1548
Legend
MVP = Minimum Viable Product
The first step MUST be creating a Minimum Viable Product. We define MVP as: "FTTH device is online and working". After this we will reiterate next R&D steps.