Skip to content

Instantly share code, notes, and snippets.

View irbisadm's full-sized avatar

Igor Sheko irbisadm

  • Yerevan, Armenia
View GitHub Profile
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();
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) {
// 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);
});
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);
var section = {
"kind":"audio",
"codec":
[
"opus/48000/2",
"ISAC/16000",
"ISAC/32000",
"G722/8000",
"PCMU/8000",
"PCMA/8000",
//Google Chrome 54
codecList = {
"sections":[
{
"kind":"audio",
"codec":
[
"opus/48000/2",
"ISAC/16000",
"ISAC/32000",
@irbisadm
irbisadm / gist:8aedb54bba27ac39267b2140097a94b4
Created July 29, 2016 20:58 — forked from moneytoo/gist:ab3f34e4fddc2110675952f8280f49c5
nginx with OpenSSL 1.0.2 (ALPN) on CentOS 7
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
*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"},
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);
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;