-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
68 lines (61 loc) · 1.7 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const {sdk, SpeakerEvent} = require("symbl-node");
const appId = "";
const appSecret = "";
const phoneNumber = ""; // US Zoom Numbers are "+16465588656", or "+14086380968".
const meetingName = "Zoom Test Meeting";
const emailAddress = "[email protected]";
const ZOOM_MEETING_ID = "ZOOM_MEETING_ID";
const ZOOM_PARTICIPANT_ID = "";
const ZOOM_MEETING_PASSCODE = "";
let dtmfSequence = `${ZOOM_MEETING_ID}#`;
if (ZOOM_PARTICIPANT_ID) {
dtmfSequence += `,,${ZOOM_PARTICIPANT_ID}#`;
} else {
dtmfSequence += `,,#`;
}
if (ZOOM_MEETING_PASSCODE) {
dtmfSequence += `,,${ZOOM_MEETING_PASSCODE}#`;
}
sdk.init({
appId: appId,
appSecret: appSecret,
basePath: "https://api.symbl.ai",
}).then(async() => {
console.log('SDK initialized.');
try {
sdk.startEndpoint({
endpoint: {
type: "pstn",
phoneNumber: phoneNumber,
dtmf: dtmfSequence,
},
actions: [
{
invokeOn: "stop",
name: "sendSummaryEmail",
parameters: {
emails: [
emailAddress
],
},
},
],
data: {
session: {
name: meetingName,
},
},
}).then((connection) => {
const connectionId = connection.connectionId;
console.log("Successfully connected.", connectionId);
console.log('Conversation ID', connection.conversationId);
console.log('Full Conection Object', connection);
console.log("Calling into Zoom now, please wait about 30-60 seconds.");
})
.catch((err) => {
console.error("Error while starting the connection", err);
});
} catch (e) {
console.error(e);
}
}).catch(err => console.error('Error in SDK initialization.', err));