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
| using UnityEngine; | |
| using System.Collections.Generic; | |
| using Voximplant; | |
| public class Voximplant : MonoBehaviour { | |
| InvSDK vox; | |
| string ACC = "your-acc-name-here"; | |
| void Start () { | |
| vox = GameObject.FindObjectOfType(); |
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
| require(Modules.Conference); | |
| var conf = null; | |
| var calls = 0; | |
| // Handle the call from the 'incoming' scenario | |
| VoxEngine.addEventListener(AppEvents.CallAlerting, function (e) { | |
| // Create a conference if not created yet | |
| if (!conf) conf = VoxEngine.createConference(); | |
| e.call.answer(); | |
| e.call.addEventListener(CallEvents.Connected, function(e) { |
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
| // Handle incoming call from SDK | |
| VoxEngine.addEventListener(AppEvents.CallAlerting, function(e) { | |
| // Forward to 'conference' scenario | |
| var confcall = VoxEngine.callConference('conference-id',e.callerid); | |
| VoxEngine.easyProcess(e.call, confcall); | |
| }); |
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
| const vox = VoxImplant.getInstance(); | |
| let messenger; | |
| vox.init({micRequired: true}); | |
| vox.addEventListener(VoxImplant.Events.SDKReady, handleSDKReady); | |
| function handleSDKReady(){ | |
| vox.connect(); | |
| vox.addEventListener(VoxImplant.Events.ConnectionEstablished, handleConnectionEstablished); | |
| vox.addEventListener(VoxImplant.Events.ConnectionFailed, handleConnectionFailed); | |
| vox.addEventListener(VoxImplant.Events.ConnectionClosed, handleConnectionClosed); | |
| vox.addEventListener(VoxImplant.Events.AuthResult, handleAuthResult); |
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
| var section = { | |
| "kind":"audio", | |
| "codec": | |
| [ | |
| "opus/48000/2", | |
| "ISAC/16000", | |
| "ISAC/32000", | |
| "G722/8000", | |
| "PCMU/8000", | |
| "PCMA/8000", |
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
| //Google Chrome 54 | |
| codecList = { | |
| "sections":[ | |
| { | |
| "kind":"audio", | |
| "codec": | |
| [ | |
| "opus/48000/2", | |
| "ISAC/16000", | |
| "ISAC/32000", |
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
| yum -y groupinstall 'Development Tools' | |
| yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel | |
| OPENSSL="openssl-1.0.2h" | |
| NGINX="nginx-1.11.2-1" | |
| mkdir -p /opt/lib | |
| wget https://www.openssl.org/source/$OPENSSL.tar.gz -O /opt/lib/$OPENSSL.tar.gz | |
| tar -zxvf /opt/lib/$OPENSSL.tar.gz -C /opt/lib |
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
| *getData(){ | |
| const perPage = 500; | |
| let page=0; | |
| let maxpage = Number.POSITIVE_INFINITY; | |
| let offset = 0; | |
| while (page<maxpage){ | |
| offset = perPage*page; | |
| yield fetch("https://api.voximplant.com/platform_api/GetCallHistory/",{ | |
| method: 'post', | |
| headers: {"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"}, |
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
| var currentCall = vox.call("exampleUser"); | |
| currentCall.on(VoxImplant.CallEvents.Connected,onConnected); | |
| currentCall.on(VoxImplant.CallEvents.Disconnected,onDisconnected); | |
| currentCall.on(VoxImplant.CallEvents.Failed,onFailed); | |
| currentCall.on(VoxImplant.CallEvents.ICETimeout,onICETimeout); |
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
| var currentCall = vox.call("exampleUser"); | |
| currentCall.rearangeCodecs = function(codecList){ | |
| return new Promise(function(resolve,reject){ | |
| // example sorting video section to set h256 first | |
| for(var i=0;i<codecList.sections.length;i++){ | |
| if(codecList.sections[i].kind.toLowerCase()=="video"){ | |
| codecList.sections[i].codec.sort((a:string,b:string)=>{ | |
| if(a.toLowerCase().indexOf("h264")!=-1&&a.toLowerCase().indexOf("uc")==-1) return -1; | |
| if(b.toLowerCase().indexOf("h264")!=-1&&b.toLowerCase().indexOf("uc")==-1) return 1; | |
| return 0; |