cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1356
Views
10
Helpful
4
Replies

(CE9.3) Reset all setting after video meeting end - Macro

QNZenX
Level 1
Level 1

Hi all, during the meeting, some users can change the setting of volume, camera, LCD... on touchpad, so I want to reset all the settings on the touchpad as default after the meeting end, any idea for event listeners? I use Zoom room on the cisco. I also see Room Reset sample code but when I applied it, it did not run anything. Thank you.

1 Accepted Solution

Accepted Solutions

At a quick look at your code, you have nothing that will trigger the reset.

 

You likely want a combination of @Lawrence James's code and yours.

Something like:

xapi.event.on('CallDisconnect', (event) => {
  if(event.Duration > 0)
  {
      xapi.command('Audio Volume SetToDefault');
      xapi.command('RoomPreset Activate', { PresetId: '1' });
      xapi.config.set("Video Output Connector 1 MonitorRole", 'Auto');
      xapi.config.set("Video Output Connector 2 MonitorRole", 'Auto');
    }
});

Then, when the call disconnects, your room settings will be applied.

This also assumes that you're not using Multisite on the endpoint, as this will trigger on any call disconnect event (ie even if the endpoint is still in a call with other participants if only a single participant has been disconnected).

Wayne

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

View solution in original post

4 Replies 4

Lawrence James
Level 1
Level 1

There are a few options for this but you mentioned you tried the macro already so if that doesn't work there are a couple of steps required to allow Macros to run. First, the Macro Mode is Off by default so you need to turn that on - 

 

xConfiguration Macros Mode On

 

Second, the runtime AutoStart needs to be on so after a reboot it starts this is On by default but check it to be sure. 

 

Post the code to the Macro if the above steps were completed already as maybe there is something in the code that needs correcting/changed for your system. If you are using the Macro from the Git Hub site you would need to add an end of meeting status event to trigger the macro. I haven't used that macro but just looking at it doesn't have a status event to trigger it to run 

 

something like

xapi.event.on('CallDisconnect', (event) => {
if(event.Duration > 0)
{
<<Room Change Code Goes Here - Less than second do nothing>>
}
else
{
<<Room Change Code Goes Here>>
}
});

 

 

Dear Lawrence,
Thank you for your post. As I checked,xConfiguration Macros Mode On and AutoStart also ON.
Can you take a look about this code below?
const xapi = require('xapi');

function resetRoomToDefault() {
xapi.command('Audio Volume SetToDefault');
xapi.command('RoomPreset Activate', { PresetId: '1' });
xapi.config.set("Video Output Connector 1 MonitorRole", 'Auto');
xapi.config.set("Video Output Connector 2 MonitorRole", 'Auto');
}

xapi.event.on('RoomReset SecondsToReset', (event) => {
if (event.SecondsToReset) {
xapi.command('UserInterface Message TextLine display',
{
Text: `System will be reset to default settings in ${event.SecondsToReset} Seconds`,
Duration: 5,
});
}
});

xapi.event.on('RoomReset Reset', (event) => {
if (event.SecondsToReset) {
resetRoomToDefault();
}
});

At a quick look at your code, you have nothing that will trigger the reset.

 

You likely want a combination of @Lawrence James's code and yours.

Something like:

xapi.event.on('CallDisconnect', (event) => {
  if(event.Duration > 0)
  {
      xapi.command('Audio Volume SetToDefault');
      xapi.command('RoomPreset Activate', { PresetId: '1' });
      xapi.config.set("Video Output Connector 1 MonitorRole", 'Auto');
      xapi.config.set("Video Output Connector 2 MonitorRole", 'Auto');
    }
});

Then, when the call disconnects, your room settings will be applied.

This also assumes that you're not using Multisite on the endpoint, as this will trigger on any call disconnect event (ie even if the endpoint is still in a call with other participants if only a single participant has been disconnected).

Wayne

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

It works. Thank you Wayne.