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
events.asterisk.hungup_call do |event| | |
#code here | |
end |
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
events.asterisk.hungup_call do |event| | |
#code here | |
end |
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
##events.rb | |
events.asterisk.manager_interface.each do |event| | |
if event.name.downcase == "newchannel" | |
launch_new_call_method(event) | |
end | |
end | |
##component.rb | |
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
task :export do | |
require 'sequel' | |
require 'fastercsv' | |
db = Sequel.connect(ENV['DATABASE_URL']) | |
table_name = ENV['table'].to_sym | |
table = db[table_name] | |
fields = table.first.keys |
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
#record in dialplan.rb | |
thread = Thread.new do | |
#do stuff | |
end | |
thread.join |
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 'rubygems' | |
require 'sinatra' | |
require 'appengine-apis/logger' | |
require 'appengine-apis/datastore' | |
require 'json' | |
get '/' do | |
logger.info "Sinatra in your Google Appengine p0wning your JRuby" | |
"I AM SINATRA! Doing a ditty for you on Google Appengine with JRuby!" | |
end |
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 'rubygems' | |
require 'eventmachine' | |
module DigitCollector | |
def post_init | |
puts "-- someone connected to the echo server!" | |
end | |
def receive_data data | |
p ">>>you sent: #{data}" |
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 "socket" | |
tcp_socket = TCPSocket.new('thehost', 20000) | |
active_call = true | |
options = { :choices => '1,2,3,4,5,6,7,8,9,0' } | |
while active_call == true do | |
result = ask 'Please enter a command.', options | |
if result.value == 0 | |
active_call = false |
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
{ | |
"tropo": [ | |
{ | |
"say": [ | |
{ | |
"value": "Please hold while your call is transferred to a customer service agent." | |
} | |
] | |
}, | |
{ |
OlderNewer