01-31-2020 02:21 PM
Anyone can tell me why my button action is not working for this macro code ? I have added a button with Id 'callCatering' and added this macro. But I keep pressing that button which I have created in UI Extensions configuration. But no call is coming.
const xapi = require('xapi');
const number_to_dial = '8771';
function listenToGui() {
xapi.event.on('UserInterface Extensions Widget Action', (event) => {
//console.log('event', event.WidgetId);
if (event.WidgetId == 'callCatering'){
xapi.command('Dial', {'Number': number_to_dial});
}
});
}
listenToGui();
However, if I use this following macro code as soon as I am saving, I am getting the call.
const xapi = require('xapi');
const number_to_dial = '8771';
xapi.command('Dial', {'Number': number_to_dial});
02-02-2020 12:30 AM
Try adding event type like below:
if (event.WidgetId === 'callCatering' && event.Type === 'clicked'){ xapi.command('Dial', {'Number': number_to_dial}); }
02-03-2020 06:57 AM
I tried that. But click the button is not doing anything.
02-03-2020 09:50 AM
02-10-2020 07:59 PM
Have a look at the Speed Dials example on github.
Please remember to mark helpful responses and to set your question as answered if appropriate.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide