cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
900
Views
0
Helpful
0
Replies

Macro - DX80 - xConfiguration

Hey Guys,

 

I am looking to build a macro that would send an xConfiguration Network IPStack: Dual command at 00:01 on weekdays, our DX80 keeps switching to IPv4 as we are using IPv4 in our CUCM but our network uses IPv6 any ideas?

My script below:

const xapi = require('xapi');

const Sunday = 0, Saturday = 6;

const ScheduleTime = '00:01';

function schedule(time, action) {
let [alarmH, alarmM] = time.split(':');
let now = new Date();
now = now.getHours() * 3600 + now.getMinutes() * 60 + now.getSeconds();
// print("Time now:" + now);
let difference = parseInt(alarmH) * 3600 + parseInt(alarmM) * 60 - now;
if (difference <= 0) difference += 24 * 3600;

return setTimeout(action, difference * 1000);
}


function ipstack() {
const weekDay = new Date().getDay();
if (weekDay !== Sunday && weekDay !== Saturday) {
xapi.xConfiguration('Network [1] IPStack: Dual');
}

schedule(ScheduleTime, ipstack);
}

 Any help greatly appreciated.

0 Replies 0
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: