This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Handle commands for PSTN Call-out | |
// To initiate call-out use the URL that looks as follows: media_session_access_url/CallOut/phonenumber | |
VoxEngine.addEventListener(AppEvents.HttpRequest, function (e) { | |
//Logger.write("HTTP REQUEST:"); | |
//Logger.write(e.path); | |
var path = e.path.split("/"), | |
num; | |
if (path[path.length - 2] == "CallOut") { | |
num = path[path.length - 1]; | |
handleCallOut(num); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(Modules.Conference); | |
var customData, | |
confName, | |
conference, | |
pstnCalls = []; | |
/** | |
* Handle StartConference request | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* X-Wiki Parser to get JSON from infobox | |
*/ | |
var generate = function(length) { | |
if (length !== 0) { | |
length = Math.abs(length) || 10; | |
} | |
var output = Math.random().toString(36).slice(2).toUpperCase(); | |
if (length === 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enable ASR module for speech recognition capabilities | |
require(Modules.ASR); | |
var call, asr, | |
baseURL = "https://api.api.ai/v1/", | |
accessToken = "PUT YOUR API.AI ACCESS TOKEN HERE", | |
nlp_result; | |
// Inbound call arrives | |
VoxEngine.addEventListener(AppEvents.CallAlerting, function (e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VoxEngine.forwardCallToUserDirect(null, true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Require Conference module to get conferencing functionality | |
*/ | |
require(Modules.Conference); | |
var videoconf, | |
calls = [], | |
clientType; | |
// Add event handler for session start event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(Modules.ASR); | |
require(Modules.Recorder); | |
/** | |
* Conference Gatekeeper | |
* Handle inbound calls and route them to the conference | |
*/ | |
var call, | |
conferenceId, | |
conf, | |
API_KEY = "YOUR_GOOGLE_TRANSLATE_API_KEY", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enable ASR module | |
require(Modules.ASR); | |
var call, asr; | |
// Answer inbound call | |
VoxEngine.addEventListener(AppEvents.CallAlerting, function (e) { | |
call = e.call; | |
call.addEventListener(CallEvents.Connected, onCallConnected); | |
call.addEventListener(CallEvents.Disconnected, VoxEngine.terminate); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var streaming_result = ""; | |
asr.addEventListener(ASREvents.SpeechCaptured, function (e) { | |
// Don't stop sending media after SpeechCaptured event | |
//call.stopMediaTo(asr); | |
}); | |
// Recognition results will continue arriving to the Result handler | |
asr.addEventListener(ASREvents.Result, function (e) { | |
if (e.confidence > 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enable ASR module | |
require(Modules.ASR); | |
var call, asr; | |
// Answer inbound call | |
VoxEngine.addEventListener(AppEvents.CallAlerting, function (e) { | |
call = e.call; | |
call.addEventListener(CallEvents.Connected, onCallConnected); | |
call.addEventListener(CallEvents.Disconnected, VoxEngine.terminate); |