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
| class CallFlow < ActiveRecord::Base | |
| belongs_to :routable, :polymorphic => true | |
| #validates_presence_of :dnis | |
| #validates_uniqueness_of :dnis | |
| def dialplan | |
| puts self.routable.description.squeeze("\n").strip | |
| end | |
| def target_route=(params) |
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
| class ApplicationController < ActionController::Base | |
| around_filter :check_dry_run | |
| def check_dry_run | |
| ActiveRecord::Base.transaction do | |
| yield | |
| raise ActiveRecord::Rollback, "dry_run specified; no changes made" if @dry_run | |
| end | |
| 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
| function push_file() { | |
| file=$1 | |
| host=wherever.com | |
| pass=secret | |
| user=bau5 | |
| dir=dir_to_cdto | |
| ftp -invp $host<<ENDOFUPLOAD | |
| user $user $pass | |
| cd $dir |
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 'server_mon' | |
| require 'call_testing' | |
| SCHEDULER = Rufus::Scheduler.start_new | |
| TESTCALL = SCHEDULER.every '10m', :tags => 'testcall' do | |
| CallTesting.test_call | |
| end | |
| CALLENGINE_MON = SCHEDULER.every '5m', :tags => 'callengine' do |
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
| class CallFlow < ActiveRecord::Base | |
| belongs_to :routable, :polymorphic => true | |
| def dialplan | |
| puts self.routable.description.squeeze("\n").strip | |
| end | |
| def target_route=(params) | |
| self.routable = params[:kind].constantize.new(params.reject {|k,v| k == "kind"}) | |
| 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
| class Medium < ActiveRecord::Base | |
| attr_accessible :title, :wav | |
| has_attached_file :wav, | |
| :styles => { | |
| :mp3 => { | |
| :params => "-encode --vbr-new -V7", | |
| :format => "mp3" } | |
| }, | |
| :default_style => :normal, | |
| :processors => [:wav_mp3], |
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
| diff -ruN app_swift-2.0_ast-1.6.orig/app_swift.c app_swift-2.0_ast-1.6/app_swift.c | |
| --- app_swift-2.0_ast-1.6.orig/app_swift.c 2010-06-16 08:35:30.000000000 +0930 | |
| +++ app_swift-2.0_ast-1.6/app_swift.c 2010-08-17 20:31:08.000000000 +0930 | |
| @@ -409,7 +409,8 @@ | |
| ASTOBJ_WRLOCK(ps); | |
| ps->immediate_exit = 1; | |
| ASTOBJ_UNLOCK(ps); | |
| - } else if (f->frametype == AST_FRAME_DTMF && timeout > 0 && max_digits > 0) { | |
| + } else { | |
| + if (f->frametype == AST_FRAME_DTMF && timeout > 0 && max_digits > 0) { |
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
| #return a 6 digit DTMF entry from the caller | |
| postcode = input 6, :speak => { :text => 'enter your postal code' } | |
| postparts = postcode.split(//) | |
| #simple map of possible alphabetical entries for a canadian post code | |
| dtmf_map = { '2' => ['"A"','"B"','"C"'], '3' => ['"E"'], '4' => ['"G"','"H"'], '5' => ['"J"','"K"','"L"'], '6' => ['"M"','"N"'], '7' => ['"P"','"R"','"S"'], '8' => ['"T"','"V"'], '9' => ['"X"','"Y"'] } | |
| #first, third, and fifth characters are always alphabetical | |
| first_char = dtmf_map[postparts[0]].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
| # Check pin number against user's attempt, wait for a number to dial, connect caller to callee and play disclaimer to callee | |
| # The method of setting these variables has been simplified for clarity | |
| pin = '1234' | |
| caller_id = '1112223333' | |
| play_prompt = true | |
| tts = '...' | |
| if play_prompt | |
| tts = format_ssml("Please enter your pin number.") |
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
| <?php | |
| /* LogMyCalls public API | |
| * | |
| * PHP Sample | |
| * Author: David Ryder | |
| * dryder@contactpoint.com | |
| * http://github.com/libryder | |
| * | |
| * The LmcApi is a JSON wrapper using CURL to send and receive data |