08-21-2019 02:04 AM
Dear Colleagues,
I am going to write a simple macro for group button with no success. I guess the widgetID format does not fit, for example: group:call1 (widgetID: group, buttonID:call1)
Here you can see the current status:
const xapi = require('xapi');
function guiEvent(event) {
if (event.Type === 'pressed' && event.WidgetId === 'group:call1'){
xapi.command('Dial', { Number: 'call1@domain.com' });
}
if (event.Type === 'pressed' && event.WidgetId === 'group:call2'){
xapi.command('Dial', { Number: 'call2@domain.com' });
}
if (event.Type === 'pressed' && event.WidgetId === 'group:call3'){
xapi.command('Dial', { Number: 'call3@domain.com' });
}
}
xapi.event.on('UserInterface Extensions Widget Action', guiEvent);
----------------------------
<Extensions>
<Version>1.5</Version>
<Panel>
<PanelId>Quick_dial</PanelId>
<Type>Statusbar</Type>
<Icon>Handset</Icon>
<Order>2</Order>
<Name>Quick Dial</Name>
<Page>
<Name>Quick Dial</Name>
<Row>
<Name>Call</Name>
<Widget>
<WidgetId>group</WidgetId>
<Type>GroupButton</Type>
<Options>size=4</Options>
<ValueSpace>
<Value>
<Key>call1</Key>
<Name>One</Name>
</Value>
<Value>
<Key>call2</Key>
<Name>Two</Name>
</Value>
<Value>
<Key>call3</Key>
<Name>Three</Name>
</Value>
</ValueSpace>
</Widget>
</Row>
<PageId>Quick_dial</PageId>
<Options/>
</Page>
</Panel>
</Extensions>
Would you be so kind to help me out?
Thanks,
Laszlo
08-21-2019 06:36 PM
I'm not sure why you would want to do this with a group button which would normally be a switch between different functions.
You would be better off using normal buttons - there is an example of creating these types of Speed Dial buttons on github: https://github.com/CiscoDevNet/roomdevices-macros-samples/tree/master/Speed%20Dials
Please remember to mark helpful responses and to set your question as answered if appropriate.
08-23-2019 09:08 AM
Hi,
Thank you for your reply.
In the meantime I found the solution:
if (event.Type == 'released' && event.WidgetId == 'group' && event.Value == 'call1')
instead of
if (event.Type == 'released' && event.WidgetId == 'group:call1')
Kind regards,
Laszlo
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