Skip to content

Instantly share code, notes, and snippets.

@vangberg
vangberg / inbound.rb
Created November 18, 2009 22:21
freeswitcher: inbound/outbound event listener
require 'fsr'
require 'fsr/listener/inbound'
class MyInbound < FSR::Listener::Inbound
# `on_event` is called every time an event is received.
def on_event
# Be sure to check out the content of `event`. It has all the good stuff.
FSR::Log.info "Got event: #{event.content[:event_name]}"
end
require 'rubygems'
require 'eventmachine'
module Echo
def initialize
puts caller(0)
end
def receive_data(data)
send_data data
end
@kwilczynski
kwilczynski / em-expose-queues.rb
Created January 27, 2012 03:18
Accessing EventMachine internal queues -- when working with defer ...
module EventMachine
def self.threadqueue
@threadqueue
end
def self.resultqueue
@resultqueue
end
end
#!/usr/bin/env ruby
require 'monitor'
require 'pp'
require 'timeout'
require 'time'
require 'pp'
require 'rubygems'
require 'AGIServer'
@ik5
ik5 / ahn
Last active August 10, 2016 03:19
Adhearsion init script
#!/bin/bash
### BEGIN INIT INFO
# Provides: ahn
# Required-Start: ahn daemon
# Required-Stop: ahn daemon
# chkconfig: 2345 91 60
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Adhearsion daemon
@bipinu
bipinu / install-bison.sh
Created February 16, 2015 14:49
Install bison 2.7 on Ubuntu 14.04
#!/bin/bash
mkdir /tmp/bison
cd /tmp/bison
apt-get update
apt-get install -y build-essential m4
wget http://ftp.gnu.org/gnu/bison/bison-2.7.tar.gz
tar -xvf bison-2.7.tar.gz
@litnimax
litnimax / ari_originate.py
Last active October 25, 2021 15:09
Asterisk REST interface origination script to call from console or other apps
#!/usr/bin/env python2.7
# Requirements: pip install ari gevent
import argparse
import ari
import gevent
from gevent.monkey import patch_all; patch_all()
from gevent.event import Event
import logging
from requests.exceptions import HTTPError, ConnectionError
import socket