Skip to content

Instantly share code, notes, and snippets.

View irbisadm's full-sized avatar

Igor Sheko irbisadm

  • Yerevan, Armenia
View GitHub Profile
@irbisadm
irbisadm / test-deploy.sh
Created September 24, 2013 23:35
symfony2 git test-deploy script
#!/bin/bash
git pull
app/console cache:clear --env=dev
app/console cache:clear --env=prod
chmod -R 777 app/cache/
chmod -R 777 app/logs/
<script type="text/javascript" src="//cdn.voximplant.com/edge/voximplant.min.js"></script>
var vox = VoxImplant.getInstance();
vox.init({micRequired: true});
vox.addEventListener(VoxImplant.Events.SDKReady, handleSDKReady);
vox.connect();
vox.addEventListener(VoxImplant.Events.ConnectionEstablished, handleConnectionEstablished);
vox.addEventListener(VoxImplant.Events.ConnectionFailed, handleConnectionFailed);
vox.addEventListener(VoxImplant.Events.ConnectionClosed, handleConnectionClosed);
function handleConnectionEstablished() {
if (typeof console != "undefined") console.log("Connected to VoxImplant:" +vox.connected());
}
function handleConnectionFailed(e) {
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;
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);
*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"},
@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
//Google Chrome 54
codecList = {
"sections":[
{
"kind":"audio",
"codec":
[
"opus/48000/2",
"ISAC/16000",
"ISAC/32000",
var section = {
"kind":"audio",
"codec":
[
"opus/48000/2",
"ISAC/16000",
"ISAC/32000",
"G722/8000",
"PCMU/8000",
"PCMA/8000",