This file contains 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
begin | |
require 'rack' | |
require 'json' | |
rescue LoadError | |
abort "ERROR: restful_rpc requires the 'rack' and 'json' gems" | |
end | |
# Don't you love regular expressions? Matches only 0-255 octets. Recognizes "*" as an octet wildcard. | |
VALID_IP_ADDRESS = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|\*)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|\*)$/ |
This file contains 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
[4352754916] | |
strategy=ringall | |
timeout=15 | |
retry=1 | |
wrapuptime=0 | |
maxlen=0 | |
member=> SIP/elastix-trunk/525 | |
member=> SIP/elastix-trunk/524 |
This file contains 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
// Written by Jay Phillips | |
// The "viewer_element" arg should be a <div> with one <p> child that's hidden by default. | |
function AhnCall(viewer_element, source, destination) { | |
this.viewer = viewer_element; | |
this.text_holder = $(viewer_element.children()[0]); | |
this.source = source; | |
this.destination = destination; | |
This file contains 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
#!/bin/bash | |
############################################################# | |
# SSC - Linux screenshot script | |
# | |
# Take screenshot (window, selection, fullscreen), upload | |
# to ftp, imageshack, or none and copy URL/file location | |
# to clipboard | |
# | |
# Dependencies: scrot, xclip, zenity, imagemagick |
This file contains 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
# Example dialplan to handle asterisk queues | |
# outbound context for a local channel | |
outbound { | |
gconfig = GlobalConfiguration.first | |
trunk = gconfig.main_trunk | |
number = extension.to_s.scan(/\d/).join[-10,10] | |
dialstring = "SIP/#{trunk}/+1#{number}" |
This file contains 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
source 'http://rubygems.org' | |
gem 'adhearsion', '>= 1.2.1' | |
gem 'ahn-restful-rpc' | |
gem 'rails', '3.1.1' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' |
This file contains 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
# app/controllers/admin/base_controller.rb | |
def look_for_needed_db_updates | |
if Migrator.offer_migration_when_available | |
redirect_to :controller => '/admin/settings', :action => 'update_database' if Migrator.migrations_available | |
end | |
end |
This file contains 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
#as soon as caller hangs up, asterisk goes down | |
cellphone_ivr { | |
key = input 1, :timeout => 5.seconds, :speak => {:text => "You appear to be calling from the #{@calling_area} area; Press 1 if correct. Press 2 to enter zipcode.", :interruptible => true} | |
if key == "1" | |
speak "One moment please." | |
+route_to_store | |
elsif key == "2" | |
+play_enter_zip_ivr | |
else |
This file contains 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
class OrganizationalUnit < ActiveRecord::Base | |
has_many :children, :class_name => "OrganizationalUnit", :foreign_key => :parent_id | |
def children? | |
children.present? | |
end | |
end |
This file contains 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
# It's recommended to change the class and filename to be a little more descriptive for your environment | |
class RenameTableColumn < ActiveRecord::Migration | |
def up | |
rename_column :table_name, :producthistory_id, :product_history_id | |
end | |
def down | |
rename_column :table_name, :product_history_id, :producthistory_id | |
end |
OlderNewer