Skip to content

Instantly share code, notes, and snippets.

@ajb413
Created May 15, 2019 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajb413/0a413563666c75d119d930cac7cd43e4 to your computer and use it in GitHub Desktop.
Save ajb413/0a413563666c75d119d930cac7cd43e4 to your computer and use it in GitHub Desktop.
confirmCall(name).then((yesDoCall) => {
if (yesDoCall) {
// Get new TURN server credentials from Xirsys
// Not Required but it is more reliable than peer-to-peer
request(turnApiUrl, 'PUT', {
'headers': { 'tok': turnToken }
}).then((response) => {
rtcConfig.iceServers = [response];
webRtcPhone.callUser(userToCall, {
myStream: myAudioVideoStream
});
});
}
});
confirmCall(name).then((yesDoCall) => {
if (yesDoCall) {
webRtcPhone.callUser(userToCall, {
myStream: myAudioVideoStream
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment