Send download url and version when Device gets inform request with vendor sepecific value

Hi
I wanted to send download URL and file version to a CWMP device when it sends Inform request with 4 VALUE CHANGE event with X_vendor_value=7.

I see an option to do with preset or provisioning. Please guide me how to do that.

http://docs.genieacs.com/en/latest/provisions.html#downloads

I created a preset with following
Name : Dowload
Event : 4 VALUE CHANGE
provision : download_test

script as follows:

declare(“Downloads.[FileType:1 Firmware Upgrade Image]”, {path: 1}, {path: 1});
declare(“Downloads.[FileType:1 Firmware Upgrade Image].FileName”, {value: 1}, {value: “firmware-2017.01.tar”});
declare(“Downloads.[FileType:1 Firmware Upgrade Image].Download”, {value: 1}, {value: Date.now()});

I see it executed only one time when i get the event from a device, next time i don’t see this executed. Am i miss anything ? do i need to configure any extra paramter to define the execution counts ?? ;
I wanted to run this every time the even value changes comes from any device.

Are you sending the same tar file every time? I’m not sure 100% how Downloads work under the covers, but if they work anything like the rest of the ACS provision scripts work then GenieACS won’t send the same file twice because it thinks the CPE already has the file you requested.

Yes got it. Are you saying provisioning will work only one time for a device even though it is linked to preset with an event (Value Change)?

preset will not be executed repeatedly ? if not , what is the recommendation for below requirement.

ACS have to send download command every time it receives a VALUE CHANGE event from Device with vendor attribute Device.X_vendor_value=7 as ex.

if the vendor attribute is 0 , no need to send Download command.

This is how the rest of the provisioning system works. I’m not sure if there are some exceptions for Downloads.

The preset will be executed repeatedly. But GenieACS only does a SPV if it detects a change between the current state of the CPE and the desired state. One way around this might be to append a nonce to the end of the filename.

declare("Downloads.[FileType:1 Firmware Upgrade Image].FileName", {value: 1}, {value: "firmware-2017.01.tar?" + Date.now()});

I’ve only tested this from the command line, but at the command line GenieACS ignores all query params when downloading a file.

Thanks. Let me check
GenieACS only does a SPV if it detects a change between the current state of the CPE and the desired state. One way around this might be to append a nonce to the end of the filename.

I am not getting SPV and state of CPE check like current state and desired state ? can you elaborate more on this ?

Hi @akcoder I see URL is formed by ACS in sendACSRequest with prefix from.
Wanted to form the URL here, shall we use as below

declare("Downloads.url, {value: 1}, {value: “http://10.10.10.1/acsFile.tar” + Date.now()});

Also how does provisioning script calls the functions, is it through API?