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/env ruby | |
# This application was made and tested in production with Ruby 1.8x | |
require 'rubygems' | |
require 'mysql' | |
require 'active_record' | |
require 'AGIServer' | |
require 'AGIMenu' | |
require 'AGISelection' |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'rastman' | |
require 'AGIServer' | |
require 'AGISelection' | |
require 'AGIMenu' | |
AMI = Rastman::Manager.new(@@config[:manager][:user], | |
@@config[:manager][:secret], |
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
# Migration | |
create_table :business_time_members do |t| | |
t.string :name, :limit => 100 | |
t.integer :business_time_id | |
t.time :time_from, :default => '2000-01-01 00:00:00' | |
t.time :time_to, :default => '2000-01-01 23:59:59' | |
t.integer :weekday # 0 - sunday, 1 - monday, 2 -tuesday, ... | |
t.integer :day_of_month # 1-31 | |
t.integer :month # 1-12 |
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
#!/usr/bin/env ruby | |
# NOTE - Following code was tested with AsteriskRuby gem and Adhearsion v. 1.2.3 | |
require 'rubygems' | |
require 'pp' | |
require 'monitor' | |
require 'timeout' | |
require 'time' | |
require 'AGIServer' |
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
#!/usr/bin/env ruby | |
require 'monitor' | |
require 'pp' | |
require 'timeout' | |
require 'time' | |
require 'pp' | |
require 'rubygems' | |
require 'AGIServer' |
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
desc "Loads initial data (use once after migration)" | |
task "db:initialize" do | |
require './lib/initialize' | |
require 'fileutils' | |
# Print out DB log | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Base.logger.level = Logger::DEBUG | |
YAML::load_file("#{APP_ROOT}/config/pbxes.yml").each_pair do |name,params| |
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 | |
# function to generate random password, on input requires an argument - lenght of password | |
genpasswd() { | |
local l=$1 | |
[ "$l" == "" ] && l=20 | |
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs | |
} | |
# MySQL default root password |
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
# Find next number to send call | |
def next_number | |
# first parse CDRs | |
Cdr.parse | |
# find number | |
sql_request = %{campaign_id = ? and | |
call_state = ? and | |
number_of_retries < ? and | |
(UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(updated_at)) <= ? |
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 | |
#title : tts.sh | |
#description : This script will convert text to speech using Google translate API | |
# and then to Asterisk formats (wav, sln, gsm) | |
# | |
#author : Andrius Kairiukstis <[email protected]> | |
#date : 26 July 2013 | |
#version : 0.1 | |
#usage : bash tts.sh FILENAME VOICE PHRASE |
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/sh | |
### 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 |
OlderNewer