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
def play!(*arguments) | |
play *arguments || raise Adhearsion::PlaybackError, "One of the passed outputs is invalid" | |
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
def play(*arguments) | |
result = true | |
arguments.each do |argument| | |
if argument.is_a? Hash | |
value = argument.delete(:value) | |
result = play_ssml_for(value, argument) | |
elsif argument.is_a? RubySpeech::SSML::Speak | |
result = play_ssml argument | |
else | |
result = play_ssml_for(argument) |
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
[root@smh3 ~]# /etc/init.d/dahdi start | |
Loading DAHDI hardware modules: | |
FATAL: Module dahdi not found. | |
wct4xxp: FATAL: Module wct4xxp not found. | |
[FAILED] | |
wcte12xp: FATAL: Module wcte12xp not found. | |
[FAILED] | |
wct1xxp: FATAL: Module wct1xxp not found. | |
[FAILED] | |
wcte11xp: FATAL: Module wcte11xp not found. |
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
Index: res/res_agi.c | |
=================================================================== | |
--- res/res_agi.c (revision 344329) | |
+++ res/res_agi.c (working copy) | |
@@ -3373,16 +3373,17 @@ | |
agi_command *c; | |
const char *ami_res; | |
char *ami_cmd = ast_strdupa(buf); | |
- int command_id = ast_random(); | |
int resultcode; |
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
D, [2011-11-10T12:30:11.175564 #8948] DEBUG -- : [SEND]: Action: agi | |
ActionID: 2cb94ed1-2852-4931-be6d-d98ad668bc98 | |
Channel: SIP/1234-00000029 | |
Command: ANSWER | |
CommandID: fb147480-b732-4556-a1cb-49be4a5b359f | |
[RECV-ACTIONS]: #<RubyAMI::Response @headers={"ActionID"=>"2cb94ed1-2852-4931-be6d-d98ad668bc98", "Message"=>"Added AGI command to queue"}> | |
[RECV-EVENTS]: #<RubyAMI::Event @headers={"SubEvent"=>"Start", "Channel"=>"SIP/1234-00000029", "CommandId"=>"1351651434", "Command"=>"ANSWER"}, @name="AGIExec"> | |
[RECV-EVENTS]: #<RubyAMI::Event @headers={"SubEvent"=>"End", "Channel"=>"SIP/1234-00000029", "CommandId"=>"1351651434", "Command"=>"ANSWER", "ResultCode"=>"200", "Result"=>"Success"}, @name="AGIExec"> | |
[RECV-EVENTS]: #<RubyAMI::Event @headers={"SubEvent"=>"Exec", "Channel"=>"SIP/1234-00000029", "CommandID"=>"fb147480-b732-4556-a1cb-49be4a5b359f", "Result"=>"200%20result%3D0%0A"}, @name="AsyncAGI"> |
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
#!/usr/bin/bash | |
unset SUN_PERSONALITY | |
export LC_CTYPE=en_US.utf-8 | |
export JRUBY_OPTS="--1.9" | |
source /etc/profile.d/rvm.sh | |
rvm use $RUBY | |
bundle install --no-deployment | |
SKIP_RCOV=true bundle exec rake spec |
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
SINGLE_ROLL_MULTIPLIERS = [0, 100, 0, 0, 0, 50, 0] | |
def score(dice) | |
score = 0 | |
(1..6).each do |number| | |
roll_count = dice.count { |dice| dice == number } | |
if roll_count >= 3 | |
score += number == 1 ? 1000 : 100 * number | |
roll_count -= 3 |
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
java.lang.NullPointerException: null | |
com/rubyeventmachine/EmReactor.java:433:in `sendData' | |
com/rubyeventmachine/EmReactor.java:437:in `sendData' | |
/Users/ben/Developer/.rvm/gems/jruby-1.6.5/gems/eventmachine-0.12.10-java/lib/jeventmachine.rb:117:in `send_data' | |
/Users/ben/Developer/.rvm/gems/jruby-1.6.5/gems/eventmachine-0.12.10-java/lib/em/connection.rb:222:in `send_data' | |
/Users/ben/code/VoIP/adhearsion/ruby_ami/lib/ruby_ami/stream.rb:32:in `send_action' | |
/Users/ben/code/VoIP/adhearsion/ruby_ami/lib/ruby_ami/client.rb:63:in `_send_action' | |
/Users/ben/code/VoIP/adhearsion/ruby_ami/lib/ruby_ami/client.rb:14:in `initialize' |
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 'nokogiri' | |
class MyNode < Nokogiri::XML::Node | |
def self.new(*args) | |
super | |
end | |
end | |
class MyNode2 < Nokogiri::XML::Node | |
def initialize(*args) |
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 'nokogiri' | |
class MyNode < Nokogiri::XML::Node | |
def self.new(name, doc) | |
super(name, doc) | |
end | |
end | |
describe MyNode do | |
it 'should be the same as Nokogiri' do |