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

Macro for Group Button

Laszlo Olah
Level 1
Level 1

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

2 Replies 2

Wayne DeNardi
VIP Alumni
VIP Alumni

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

Wayne

Please remember to mark helpful responses and to set your question as answered if appropriate.

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

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: