Created
July 19, 2017 15:53
-
-
Save aylarov/360018174f33bca4a366120e962bece0 to your computer and use it in GitHub Desktop.
PSTN call-out
This file contains hidden or 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
/** | |
* Make PSTN call-out | |
*/ | |
function handleCallOut(num) { | |
var pstn = VoxEngine.callPSTN(num); | |
pstn.addEventListener(CallEvents.Connected, function (e) { | |
pstnCalls.push(e.call); | |
VoxEngine.sendMediaBetween(pstn, conference); | |
}); | |
pstn.addEventListener(CallEvents.Disconnected, function (e) { | |
if (pstnCalls.indexOf(e.call) > -1) pstnCalls.splice(pstnCalls.indexOf(e.call), 1); | |
}); | |
pstn.addEventListener(CallEvents.Failed, function (e) { | |
// Couldn't reach the callee | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to make a sip call to a cell phone number voximplant