Skip to content

Instantly share code, notes, and snippets.

@voipnorm
Last active December 3, 2018 21:07
Show Gist options
  • Save voipnorm/9b65383e109e365eef511e507c3a40b6 to your computer and use it in GitHub Desktop.
Save voipnorm/9b65383e109e365eef511e507c3a40b6 to your computer and use it in GitHub Desktop.
//Constructor for creating a endpoint object with video xapi. Ability to scrape multiple API's.
const xapi = require('xapi');
const ZOOM = 'vip2.zoomcrc.com';
function zoomMeeting() {
xapi.event.on('UserInterface Extensions Panel Clicked', (event) => {
console.log('event', event.PanelId);
if (event.PanelId == 'zoom_dial') {
//Intial press of zoom button
xapi.command('UserInterface Message TextInput Display', {
FeedbackId: 'MeetingID_zoom',
InputType: 'Numeric',
KeyboardState: 'Open',
Title: 'Join a Zoom Meeting',
Text: 'Enter the Meeting ID',
Placeholder: 'Powered by Josh',
SubmitText: 'Join'
});
}
});
//Making calling to Zoom meeeting once ID is entered.
xapi.event.on('UserInterface Message TextInput Response', (event) => {
if (event.FeedbackId === 'MeetingID_zoom') {
var ID = event.Text;
var URI = ID + '@' + ZOOM;
xapi.command('Dial', {Number: URI});
}
});
}
function onError() {
xapi.on('error', (err) => {
console.error(`Macro failed: ${err}`);
});
}
function onReady(cb) {
zoomMeeting();
onError();
cb();
}
onReady(function () {
console.log("Loading complete");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment