eric-adhearsion 0.7.999 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +8 -2
- data/EVENTS +11 -0
- data/Rakefile +96 -24
- data/adhearsion.gemspec +148 -0
- data/app_generators/ahn/ahn_generator.rb +24 -9
- data/app_generators/ahn/templates/.ahnrc +25 -3
- data/app_generators/ahn/templates/Rakefile +22 -2
- data/app_generators/ahn/templates/components/ami_remote/ami_remote.rb +15 -0
- data/app_generators/ahn/templates/components/disabled/HOW_TO_ENABLE +7 -0
- data/app_generators/ahn/templates/components/disabled/stomp_gateway/README.markdown +47 -0
- data/app_generators/ahn/templates/components/disabled/stomp_gateway/config.yml +12 -0
- data/app_generators/ahn/templates/components/disabled/stomp_gateway/stomp_gateway.rb +34 -0
- data/app_generators/ahn/templates/components/simon_game/{lib/simon_game.rb → simon_game.rb} +14 -19
- data/app_generators/ahn/templates/config/startup.rb +3 -6
- data/app_generators/ahn/templates/dialplan.rb +2 -3
- data/app_generators/ahn/templates/events.rb +32 -0
- data/bin/jahn +10 -0
- data/examples/asterisk_manager_interface/standalone.rb +51 -0
- data/lib/adhearsion.rb +17 -11
- data/lib/adhearsion/cli.rb +141 -24
- data/lib/adhearsion/component_manager.rb +169 -238
- data/lib/adhearsion/component_manager/component_tester.rb +55 -0
- data/lib/adhearsion/component_manager/spec_framework.rb +24 -0
- data/lib/adhearsion/events_support.rb +84 -0
- data/lib/adhearsion/{core_extensions → foundation}/all.rb +0 -0
- data/lib/adhearsion/{blank_slate.rb → foundation/blank_slate.rb} +0 -0
- data/lib/adhearsion/{core_extensions → foundation}/custom_daemonizer.rb +0 -0
- data/lib/adhearsion/foundation/event_socket.rb +203 -0
- data/lib/adhearsion/foundation/future_resource.rb +36 -0
- data/lib/adhearsion/{core_extensions → foundation}/global.rb +0 -0
- data/lib/adhearsion/{core_extensions → foundation}/metaprogramming.rb +0 -0
- data/lib/adhearsion/foundation/numeric.rb +13 -0
- data/lib/adhearsion/foundation/pseudo_guid.rb +10 -0
- data/lib/adhearsion/{core_extensions → foundation}/relationship_properties.rb +2 -0
- data/lib/adhearsion/foundation/string.rb +26 -0
- data/lib/adhearsion/foundation/synchronized_hash.rb +96 -0
- data/lib/adhearsion/{core_extensions → foundation}/thread_safety.rb +0 -0
- data/lib/adhearsion/host_definitions.rb +5 -1
- data/lib/adhearsion/initializer.rb +229 -73
- data/lib/adhearsion/initializer/asterisk.rb +33 -11
- data/lib/adhearsion/initializer/configuration.rb +58 -6
- data/lib/adhearsion/initializer/database.rb +3 -46
- data/lib/adhearsion/initializer/drb.rb +9 -3
- data/lib/adhearsion/initializer/freeswitch.rb +3 -3
- data/lib/adhearsion/initializer/rails.rb +1 -1
- data/lib/adhearsion/tasks.rb +2 -1
- data/lib/adhearsion/tasks/deprecations.rb +59 -0
- data/lib/adhearsion/version.rb +3 -3
- data/lib/adhearsion/voip/asterisk.rb +2 -2
- data/lib/adhearsion/voip/asterisk/agi_server.rb +9 -6
- data/lib/adhearsion/voip/asterisk/commands.rb +106 -4
- data/lib/adhearsion/voip/asterisk/manager_interface.rb +562 -0
- data/lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb +1754 -0
- data/lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb +286 -0
- data/lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb +78 -0
- data/lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl +87 -0
- data/lib/adhearsion/voip/asterisk/super_manager.rb +19 -0
- data/lib/adhearsion/voip/call.rb +51 -2
- data/lib/adhearsion/voip/dial_plan.rb +74 -61
- data/lib/adhearsion/voip/dsl/dialing_dsl.rb +1 -1
- data/lib/adhearsion/voip/dsl/dialplan/parser.rb +2 -6
- data/lib/adhearsion/voip/dsl/numerical_string.rb +2 -2
- data/lib/adhearsion/voip/freeswitch/oes_server.rb +2 -2
- data/lib/theatre.rb +151 -0
- data/lib/theatre/README.markdown +64 -0
- data/lib/theatre/callback_definition_loader.rb +84 -0
- data/lib/theatre/guid.rb +23 -0
- data/lib/theatre/invocation.rb +121 -0
- data/lib/theatre/namespace_manager.rb +153 -0
- data/lib/theatre/version.rb +2 -0
- metadata +63 -138
- data/Manifest.txt +0 -149
- data/README.txt +0 -6
- data/ahn_generators/component/USAGE +0 -5
- data/ahn_generators/component/component_generator.rb +0 -57
- data/ahn_generators/component/templates/configuration.rb +0 -0
- data/ahn_generators/component/templates/lib/lib.rb.erb +0 -3
- data/ahn_generators/component/templates/test/test.rb.erb +0 -12
- data/ahn_generators/component/templates/test/test_helper.rb +0 -14
- data/app_generators/ahn/templates/components/simon_game/configuration.rb +0 -0
- data/app_generators/ahn/templates/components/simon_game/test/test_helper.rb +0 -14
- data/app_generators/ahn/templates/components/simon_game/test/test_simon_game.rb +0 -31
- data/lib/adhearsion/core_extensions/array.rb +0 -0
- data/lib/adhearsion/core_extensions/guid.rb +0 -5
- data/lib/adhearsion/core_extensions/hash.rb +0 -0
- data/lib/adhearsion/core_extensions/numeric.rb +0 -4
- data/lib/adhearsion/core_extensions/proc.rb +0 -0
- data/lib/adhearsion/core_extensions/pseudo_uuid.rb +0 -11
- data/lib/adhearsion/core_extensions/publishable.rb +0 -73
- data/lib/adhearsion/core_extensions/string.rb +0 -26
- data/lib/adhearsion/core_extensions/thread.rb +0 -13
- data/lib/adhearsion/core_extensions/time.rb +0 -0
- data/lib/adhearsion/distributed/gateways/dbus_gateway.rb +0 -0
- data/lib/adhearsion/distributed/gateways/osa_gateway.rb +0 -0
- data/lib/adhearsion/distributed/gateways/rest_gateway.rb +0 -9
- data/lib/adhearsion/distributed/gateways/soap_gateway.rb +0 -9
- data/lib/adhearsion/distributed/gateways/xmlrpc_gateway.rb +0 -9
- data/lib/adhearsion/distributed/peer_finder.rb +0 -0
- data/lib/adhearsion/distributed/remote_cli.rb +0 -0
- data/lib/adhearsion/hooks.rb +0 -57
- data/lib/adhearsion/initializer/paths.rb +0 -55
- data/lib/adhearsion/services/scheduler.rb +0 -5
- data/lib/adhearsion/voip/asterisk/ami.rb +0 -147
- data/lib/adhearsion/voip/asterisk/ami/actions.rb +0 -238
- data/lib/adhearsion/voip/asterisk/ami/machine.rb +0 -871
- data/lib/adhearsion/voip/asterisk/ami/machine.rl +0 -109
- data/lib/adhearsion/voip/asterisk/ami/parser.rb +0 -262
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/spec/fixtures/dialplan.rb +0 -3
- data/spec/initializer/test_configuration.rb +0 -267
- data/spec/initializer/test_loading.rb +0 -162
- data/spec/initializer/test_paths.rb +0 -43
- data/spec/silence.rb +0 -10
- data/spec/test_ahn_command.rb +0 -149
- data/spec/test_code_quality.rb +0 -87
- data/spec/test_component_manager.rb +0 -97
- data/spec/test_constants.rb +0 -8
- data/spec/test_drb.rb +0 -104
- data/spec/test_helper.rb +0 -94
- data/spec/test_hooks.rb +0 -37
- data/spec/test_host_definitions.rb +0 -79
- data/spec/test_initialization.rb +0 -105
- data/spec/test_logging.rb +0 -80
- data/spec/test_relationship_properties.rb +0 -54
- data/spec/voip/asterisk/ami_response_definitions.rb +0 -23
- data/spec/voip/asterisk/config_file_generators/test_agents.rb +0 -253
- data/spec/voip/asterisk/config_file_generators/test_queues.rb +0 -325
- data/spec/voip/asterisk/config_file_generators/test_voicemail.rb +0 -306
- data/spec/voip/asterisk/menu_command/test_calculated_match.rb +0 -111
- data/spec/voip/asterisk/menu_command/test_matchers.rb +0 -98
- data/spec/voip/asterisk/mock_ami_server.rb +0 -176
- data/spec/voip/asterisk/test_agi_server.rb +0 -451
- data/spec/voip/asterisk/test_ami.rb +0 -227
- data/spec/voip/asterisk/test_commands.rb +0 -2006
- data/spec/voip/asterisk/test_config_manager.rb +0 -129
- data/spec/voip/dsl/dispatcher_spec_helper.rb +0 -45
- data/spec/voip/dsl/test_dialing_dsl.rb +0 -268
- data/spec/voip/dsl/test_dispatcher.rb +0 -82
- data/spec/voip/dsl/test_parser.rb +0 -87
- data/spec/voip/freeswitch/test_basic_connection_manager.rb +0 -39
- data/spec/voip/freeswitch/test_inbound_connection_manager.rb +0 -39
- data/spec/voip/freeswitch/test_oes_server.rb +0 -9
- data/spec/voip/test_call_routing.rb +0 -127
- data/spec/voip/test_dialplan_manager.rb +0 -372
- data/spec/voip/test_numerical_string.rb +0 -48
- data/spec/voip/test_phone_number.rb +0 -36
- data/test/test_ahn_generator.rb +0 -59
- data/test/test_component_generator.rb +0 -52
- data/test/test_generator_helper.rb +0 -20
data/CHANGELOG
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
0.8.0 rev 2
|
|
2
|
+
- Added a few non-critical files to the .gemspec. They were ignored
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
Notes from before 0.8.0:
|
|
5
|
+
- (NOTE: This is obviously not a comprehensive list of pre-0.8.0 work. 0.8.0 was a complete rewrite of the previous version)
|
|
6
|
+
- Adding a deprecation warning about Fixnum#digit and Fixnum#digits
|
|
7
|
+
- Removed the AMI class and replaced it with the ManagerInterface class.
|
|
8
|
+
- The old AMI high-level instance methods are available in the new ManagerInterface class, but a deprecation warning will be logged each time they're used. When the SuperManager class is implemented, they'll be removed entirely.
|
|
9
|
+
- Moved Theatre into Adhearsion's lib folder.
|
data/EVENTS
ADDED
data/Rakefile
CHANGED
|
@@ -2,47 +2,119 @@
|
|
|
2
2
|
ENV['RUBY_FLAGS'] = "-I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}"
|
|
3
3
|
|
|
4
4
|
require 'rubygems'
|
|
5
|
-
require '
|
|
5
|
+
require 'rake/gempackagetask'
|
|
6
|
+
|
|
7
|
+
begin
|
|
8
|
+
require 'spec/rake/spectask'
|
|
9
|
+
rescue LoadError
|
|
10
|
+
abort "You must install RSpec: sudo gem install rspec"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
begin
|
|
14
|
+
require 'yard'
|
|
15
|
+
YARD::Rake::YardocTask.new do |t|
|
|
16
|
+
t.files = ['lib/**/*.rb'] + %w[README.markdown TODO.markdown LICENSE]
|
|
17
|
+
end
|
|
18
|
+
rescue LoadError
|
|
19
|
+
STDERR.puts "\nCould not require() YARD! Install with 'gem install yard' to get the 'yardoc' task\n\n"
|
|
20
|
+
end
|
|
21
|
+
|
|
6
22
|
require 'lib/adhearsion/version'
|
|
7
23
|
|
|
24
|
+
AHN_TESTS = ['spec/**/test_*.rb']
|
|
25
|
+
GEMSPEC = eval File.read("adhearsion.gemspec")
|
|
26
|
+
RAGEL_FILES = %w[lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb]
|
|
27
|
+
THEATRE_TESTS = 'theatre-spec/**/*_spec.rb'
|
|
28
|
+
|
|
8
29
|
begin
|
|
9
30
|
require 'rcov/rcovtask'
|
|
10
31
|
Rcov::RcovTask.new do |t|
|
|
11
|
-
t.test_files = Dir[
|
|
32
|
+
t.test_files = Dir[*AHN_TESTS]
|
|
12
33
|
t.output_dir = 'coverage'
|
|
13
34
|
t.verbose = true
|
|
14
35
|
t.rcov_opts.concat %w[--sort coverage --sort-reverse -x gems -x /var --no-validator-links]
|
|
15
36
|
end
|
|
16
37
|
rescue LoadError
|
|
17
|
-
STDERR.puts "Could not load rcov tasks -- rcov does not appear to be installed."
|
|
38
|
+
STDERR.puts "Could not load rcov tasks -- rcov does not appear to be installed. Continuing anyway."
|
|
18
39
|
end
|
|
19
40
|
|
|
20
|
-
|
|
41
|
+
Rake::GemPackageTask.new(GEMSPEC).define
|
|
21
42
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
43
|
+
# YARD::Rake::YardocTask.new do |t|
|
|
44
|
+
# t.files = ['lib/**/*.rb'] # optional
|
|
45
|
+
# # t.options = ['--any', '--extra', '--opts'] # optional
|
|
46
|
+
# end
|
|
47
|
+
|
|
48
|
+
desc "Run the unit tests for Adhearsion"
|
|
49
|
+
task :spec do
|
|
50
|
+
Dir[*AHN_TESTS].each do |file|
|
|
51
|
+
load file
|
|
52
|
+
end
|
|
25
53
|
end
|
|
26
54
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
p.changes = "" # Removed because History.txt is tedious.
|
|
36
|
-
p.test_globs = TestGlob
|
|
37
|
-
p.extra_deps = [['rubigen', '>=1.0.6'], ['log4r', '>=1.0.5']]
|
|
55
|
+
desc "Check Ragel version"
|
|
56
|
+
task :check_ragel_version do
|
|
57
|
+
ragel_version_match = `ragel --version`.match(/(\d)\.(\d)+/)
|
|
58
|
+
abort "Could not get Ragel version! Is it installed? You must have at least version 6.3" unless ragel_version_match
|
|
59
|
+
big, small = ragel_version_match.captures.map { |n| n.to_i }
|
|
60
|
+
if big < 6 || (big == 6 && small < 3)
|
|
61
|
+
abort "Please upgrade Ragel! You're on version #{ragel_version_match[0]} and must be on 6.3 or later"
|
|
62
|
+
end
|
|
38
63
|
end
|
|
39
64
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
65
|
+
desc "Used to regenerate the AMI source code files. Note: requires Ragel 6.3 or later be installed on your system"
|
|
66
|
+
task :ragel => :check_ragel_version do
|
|
67
|
+
RAGEL_FILES.each do |ragel_file|
|
|
68
|
+
ruby_file = ragel_file.sub(".rl.rb", ".rb")
|
|
69
|
+
puts `ragel -n -R #{ragel_file} -o #{ruby_file} 2>&1`
|
|
70
|
+
raise "Failed generating code from Ragel file #{ragel_file}" if $?.to_i.nonzero?
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
desc "Generates a GraphVis document showing the Ragel state machine"
|
|
75
|
+
task :visualize_ragel => :check_ragel_version do
|
|
76
|
+
RAGEL_FILES.each do |ragel_file|
|
|
77
|
+
base_name = File.basename ragel_file, ".rl.rb"
|
|
78
|
+
puts "ragel -V #{ragel_file} -o #{base_name}.dot 2>&1"
|
|
79
|
+
puts `ragel -V #{ragel_file} -o #{base_name}.dot 2>&1`
|
|
80
|
+
raise "Failed generating code from Ragel file #{ragel_file}" if $?.to_i.nonzero?
|
|
43
81
|
end
|
|
44
82
|
end
|
|
45
83
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
84
|
+
desc "Run all RSpecs for Theatre"
|
|
85
|
+
Spec::Rake::SpecTask.new("theatre_specs") do |t|
|
|
86
|
+
t.spec_files = FileList[THEATRE_TESTS]
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
desc "Compares Adhearsion's files with those listed in adhearsion.gemspec"
|
|
90
|
+
task :check_gemspec_files do
|
|
91
|
+
|
|
92
|
+
files_from_gemspec = ADHEARSION_FILES
|
|
93
|
+
files_from_filesystem = Dir.glob(File.dirname(__FILE__) + "/**/*").map do |filename|
|
|
94
|
+
filename[0...Dir.pwd.length] == Dir.pwd ? filename[(Dir.pwd.length+1)..-1] : filename
|
|
95
|
+
end
|
|
96
|
+
files_from_filesystem.reject! { |f| File.directory? f }
|
|
97
|
+
|
|
98
|
+
puts
|
|
99
|
+
puts 'Pipe this command to "grep -v \'spec/\' | grep -v test" to ignore test files'
|
|
100
|
+
puts
|
|
101
|
+
puts '##########################################'
|
|
102
|
+
puts '## Files on filesystem not in the gemspec:'
|
|
103
|
+
puts '##########################################'
|
|
104
|
+
puts((files_from_filesystem - files_from_gemspec).map { |f| " " + f })
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
puts '##########################################'
|
|
108
|
+
puts '## Files in gemspec not in the filesystem:'
|
|
109
|
+
puts '##########################################'
|
|
110
|
+
puts((files_from_gemspec - files_from_filesystem).map { |f| " " + f })
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
desc "Test that the .gemspec file executes"
|
|
114
|
+
task :debug_gem do
|
|
115
|
+
require 'rubygems/specification'
|
|
116
|
+
gemspec = File.read('adhearsion.gemspec')
|
|
117
|
+
spec = nil
|
|
118
|
+
Thread.new { spec = eval("$SAFE = 3\n#{gemspec}") }.join
|
|
119
|
+
puts "SUCCESS: Gemspec runs at the $SAFE level 3."
|
|
120
|
+
end
|
data/adhearsion.gemspec
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
ADHEARSION_FILES = %w{
|
|
2
|
+
adhearsion.gemspec
|
|
3
|
+
app_generators/ahn/ahn_generator.rb
|
|
4
|
+
app_generators/ahn/templates/.ahnrc
|
|
5
|
+
app_generators/ahn/templates/components/ami_remote/ami_remote.rb
|
|
6
|
+
app_generators/ahn/templates/components/disabled/HOW_TO_ENABLE
|
|
7
|
+
app_generators/ahn/templates/components/disabled/stomp_gateway/config.yml
|
|
8
|
+
app_generators/ahn/templates/components/disabled/stomp_gateway/README.markdown
|
|
9
|
+
app_generators/ahn/templates/components/disabled/stomp_gateway/stomp_gateway.rb
|
|
10
|
+
app_generators/ahn/templates/components/restful_rpc/config.yml
|
|
11
|
+
app_generators/ahn/templates/components/restful_rpc/example-client.rb
|
|
12
|
+
app_generators/ahn/templates/components/restful_rpc/README.markdown
|
|
13
|
+
app_generators/ahn/templates/components/restful_rpc/restful_rpc.rb
|
|
14
|
+
app_generators/ahn/templates/components/restful_rpc/spec/restful_rpc_spec.rb
|
|
15
|
+
app_generators/ahn/templates/components/simon_game/simon_game.rb
|
|
16
|
+
app_generators/ahn/templates/config/startup.rb
|
|
17
|
+
app_generators/ahn/templates/dialplan.rb
|
|
18
|
+
app_generators/ahn/templates/events.rb
|
|
19
|
+
app_generators/ahn/templates/Rakefile
|
|
20
|
+
app_generators/ahn/templates/README
|
|
21
|
+
app_generators/ahn/USAGE
|
|
22
|
+
bin/ahn
|
|
23
|
+
bin/ahnctl
|
|
24
|
+
bin/jahn
|
|
25
|
+
CHANGELOG
|
|
26
|
+
EVENTS
|
|
27
|
+
examples/asterisk_manager_interface/standalone.rb
|
|
28
|
+
lib/adhearsion.rb
|
|
29
|
+
lib/adhearsion/cli.rb
|
|
30
|
+
lib/adhearsion/component_manager.rb
|
|
31
|
+
lib/adhearsion/component_manager/component_tester.rb
|
|
32
|
+
lib/adhearsion/component_manager/spec_framework.rb
|
|
33
|
+
lib/adhearsion/events_support.rb
|
|
34
|
+
lib/adhearsion/foundation/all.rb
|
|
35
|
+
lib/adhearsion/foundation/blank_slate.rb
|
|
36
|
+
lib/adhearsion/foundation/custom_daemonizer.rb
|
|
37
|
+
lib/adhearsion/foundation/event_socket.rb
|
|
38
|
+
lib/adhearsion/foundation/future_resource.rb
|
|
39
|
+
lib/adhearsion/foundation/global.rb
|
|
40
|
+
lib/adhearsion/foundation/metaprogramming.rb
|
|
41
|
+
lib/adhearsion/foundation/numeric.rb
|
|
42
|
+
lib/adhearsion/foundation/pseudo_guid.rb
|
|
43
|
+
lib/adhearsion/foundation/relationship_properties.rb
|
|
44
|
+
lib/adhearsion/foundation/string.rb
|
|
45
|
+
lib/adhearsion/foundation/synchronized_hash.rb
|
|
46
|
+
lib/adhearsion/foundation/thread_safety.rb
|
|
47
|
+
lib/adhearsion/host_definitions.rb
|
|
48
|
+
lib/adhearsion/initializer.rb
|
|
49
|
+
lib/adhearsion/initializer/asterisk.rb
|
|
50
|
+
lib/adhearsion/initializer/configuration.rb
|
|
51
|
+
lib/adhearsion/initializer/database.rb
|
|
52
|
+
lib/adhearsion/initializer/drb.rb
|
|
53
|
+
lib/adhearsion/initializer/freeswitch.rb
|
|
54
|
+
lib/adhearsion/initializer/rails.rb
|
|
55
|
+
lib/adhearsion/logging.rb
|
|
56
|
+
lib/adhearsion/tasks.rb
|
|
57
|
+
lib/adhearsion/tasks/database.rb
|
|
58
|
+
lib/adhearsion/tasks/deprecations.rb
|
|
59
|
+
lib/adhearsion/tasks/generating.rb
|
|
60
|
+
lib/adhearsion/tasks/lint.rb
|
|
61
|
+
lib/adhearsion/tasks/testing.rb
|
|
62
|
+
lib/adhearsion/version.rb
|
|
63
|
+
lib/adhearsion/voip/asterisk.rb
|
|
64
|
+
lib/adhearsion/voip/asterisk/agi_server.rb
|
|
65
|
+
lib/adhearsion/voip/asterisk/commands.rb
|
|
66
|
+
lib/adhearsion/voip/asterisk/config_generators/agents.conf.rb
|
|
67
|
+
lib/adhearsion/voip/asterisk/config_generators/config_generator.rb
|
|
68
|
+
lib/adhearsion/voip/asterisk/config_generators/queues.conf.rb
|
|
69
|
+
lib/adhearsion/voip/asterisk/config_generators/voicemail.conf.rb
|
|
70
|
+
lib/adhearsion/voip/asterisk/config_manager.rb
|
|
71
|
+
lib/adhearsion/voip/asterisk/manager_interface.rb
|
|
72
|
+
lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rb
|
|
73
|
+
lib/adhearsion/voip/asterisk/manager_interface/ami_lexer.rl.rb
|
|
74
|
+
lib/adhearsion/voip/asterisk/manager_interface/ami_messages.rb
|
|
75
|
+
lib/adhearsion/voip/asterisk/manager_interface/ami_protocol_lexer_machine.rl
|
|
76
|
+
lib/adhearsion/voip/asterisk/special_dial_plan_managers.rb
|
|
77
|
+
lib/adhearsion/voip/asterisk/super_manager.rb
|
|
78
|
+
lib/adhearsion/voip/call.rb
|
|
79
|
+
lib/adhearsion/voip/call_routing.rb
|
|
80
|
+
lib/adhearsion/voip/commands.rb
|
|
81
|
+
lib/adhearsion/voip/constants.rb
|
|
82
|
+
lib/adhearsion/voip/conveniences.rb
|
|
83
|
+
lib/adhearsion/voip/dial_plan.rb
|
|
84
|
+
lib/adhearsion/voip/dsl/dialing_dsl.rb
|
|
85
|
+
lib/adhearsion/voip/dsl/dialing_dsl/dialing_dsl_monkey_patches.rb
|
|
86
|
+
lib/adhearsion/voip/dsl/dialplan/control_passing_exception.rb
|
|
87
|
+
lib/adhearsion/voip/dsl/dialplan/dispatcher.rb
|
|
88
|
+
lib/adhearsion/voip/dsl/dialplan/parser.rb
|
|
89
|
+
lib/adhearsion/voip/dsl/dialplan/thread_mixin.rb
|
|
90
|
+
lib/adhearsion/voip/dsl/numerical_string.rb
|
|
91
|
+
lib/adhearsion/voip/freeswitch/basic_connection_manager.rb
|
|
92
|
+
lib/adhearsion/voip/freeswitch/event_handler.rb
|
|
93
|
+
lib/adhearsion/voip/freeswitch/freeswitch_dialplan_command_factory.rb
|
|
94
|
+
lib/adhearsion/voip/freeswitch/inbound_connection_manager.rb
|
|
95
|
+
lib/adhearsion/voip/freeswitch/oes_server.rb
|
|
96
|
+
lib/adhearsion/voip/menu_state_machine/calculated_match.rb
|
|
97
|
+
lib/adhearsion/voip/menu_state_machine/matchers.rb
|
|
98
|
+
lib/adhearsion/voip/menu_state_machine/menu_builder.rb
|
|
99
|
+
lib/adhearsion/voip/menu_state_machine/menu_class.rb
|
|
100
|
+
lib/theatre.rb
|
|
101
|
+
lib/theatre/callback_definition_loader.rb
|
|
102
|
+
lib/theatre/guid.rb
|
|
103
|
+
lib/theatre/invocation.rb
|
|
104
|
+
lib/theatre/namespace_manager.rb
|
|
105
|
+
lib/theatre/README.markdown
|
|
106
|
+
lib/theatre/version.rb
|
|
107
|
+
LICENSE
|
|
108
|
+
Rakefile
|
|
109
|
+
README.txt
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
Gem::Specification.new do |s|
|
|
113
|
+
s.name = "adhearsion"
|
|
114
|
+
s.version = "0.8.0"
|
|
115
|
+
|
|
116
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
117
|
+
s.authors = ["Jay Phillips"]
|
|
118
|
+
|
|
119
|
+
s.date = "2008-08-21"
|
|
120
|
+
s.description = "Adhearsion is an open-source telephony development framework"
|
|
121
|
+
s.email = "Jay -at- Codemecca.com"
|
|
122
|
+
s.executables = ["ahn", "ahnctl", "jahn"]
|
|
123
|
+
|
|
124
|
+
s.files = ADHEARSION_FILES
|
|
125
|
+
|
|
126
|
+
s.has_rdoc = false
|
|
127
|
+
s.homepage = "http://adhearsion.com"
|
|
128
|
+
s.require_paths = ["lib"]
|
|
129
|
+
s.rubyforge_project = "adhearsion"
|
|
130
|
+
s.rubygems_version = "1.2.0"
|
|
131
|
+
s.summary = "Adhearsion, open-source telephony development framework"
|
|
132
|
+
|
|
133
|
+
if s.respond_to? :specification_version then
|
|
134
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
135
|
+
s.specification_version = 2
|
|
136
|
+
|
|
137
|
+
if current_version >= 3 then
|
|
138
|
+
s.add_runtime_dependency("rubigen", [">= 1.0.6"])
|
|
139
|
+
s.add_runtime_dependency("log4r", [">= 1.0.5"])
|
|
140
|
+
else
|
|
141
|
+
s.add_dependency("rubigen", [">= 1.0.6"])
|
|
142
|
+
s.add_dependency("log4r", [">= 1.0.5"])
|
|
143
|
+
end
|
|
144
|
+
else
|
|
145
|
+
s.add_dependency("rubigen", [">= 1.0.6"])
|
|
146
|
+
s.add_dependency("log4r", [">= 1.0.5"])
|
|
147
|
+
end
|
|
148
|
+
end
|
|
@@ -24,18 +24,30 @@ class AhnGenerator < RubiGen::Base
|
|
|
24
24
|
|
|
25
25
|
m.file *[".ahnrc"]*2
|
|
26
26
|
|
|
27
|
-
m.file *["components/simon_game/
|
|
28
|
-
m.file *["components/
|
|
29
|
-
|
|
30
|
-
m.file *["components/
|
|
27
|
+
m.file *["components/simon_game/simon_game.rb"]*2
|
|
28
|
+
m.file *["components/ami_remote/ami_remote.rb"]*2
|
|
29
|
+
|
|
30
|
+
m.file *["components/disabled/stomp_gateway/stomp_gateway.rb"]*2
|
|
31
|
+
m.file *["components/disabled/stomp_gateway/config.yml"]*2
|
|
32
|
+
m.file *["components/disabled/stomp_gateway/README.markdown"]*2
|
|
33
|
+
|
|
34
|
+
m.file *["components/disabled/restful_rpc/restful_rpc.rb"]*2
|
|
35
|
+
m.file *["components/disabled/restful_rpc/config.yml"]*2
|
|
36
|
+
m.file *["components/disabled/restful_rpc/README.markdown"]*2
|
|
37
|
+
m.file *["components/disabled/restful_rpc/example-client.rb"]*2
|
|
38
|
+
m.file *["components/disabled/restful_rpc/spec/restful_rpc_spec.rb"]*2
|
|
39
|
+
|
|
40
|
+
m.file *["components/disabled/sandbox/config.yml"]*2
|
|
41
|
+
m.file *["components/disabled/sandbox/sandbox.rb"]*2
|
|
31
42
|
|
|
32
43
|
m.file *["config/startup.rb"]*2
|
|
33
44
|
m.file *["dialplan.rb"]*2
|
|
45
|
+
m.file *["events.rb"]*2
|
|
34
46
|
m.file *["README"]*2
|
|
35
47
|
m.file *["Rakefile"]*2
|
|
36
48
|
|
|
37
|
-
m.dependency "install_rubigen_scripts", [destination_root, 'ahn', 'adhearsion', 'test_spec'],
|
|
38
|
-
|
|
49
|
+
# m.dependency "install_rubigen_scripts", [destination_root, 'ahn', 'adhearsion', 'test_spec'],
|
|
50
|
+
# :shebang => options[:shebang], :collision => :force
|
|
39
51
|
end
|
|
40
52
|
end
|
|
41
53
|
|
|
@@ -69,8 +81,11 @@ EOS
|
|
|
69
81
|
# Installation skeleton. Intermediate directories are automatically
|
|
70
82
|
# created so don't sweat their absence here.
|
|
71
83
|
BASEDIRS = %w(
|
|
72
|
-
components/simon_game
|
|
73
|
-
components/
|
|
84
|
+
components/simon_game
|
|
85
|
+
components/disabled/stomp_gateway
|
|
86
|
+
components/disabled/sandbox
|
|
87
|
+
components/ami_remote
|
|
88
|
+
components/disabled/restful_rpc/spec
|
|
74
89
|
config
|
|
75
90
|
)
|
|
76
|
-
end
|
|
91
|
+
end
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Adhearsion Runtime Configuration.
|
|
2
2
|
|
|
3
|
+
# You can use the "gems" section to force Adhearsion to load a particular version of a gem.
|
|
4
|
+
# This is useful when a component require()s a gem, but you don't want it to use the latest one installed on the system.
|
|
5
|
+
# For example, if a component require()s activerecord, sucking in the latest on the system, and then you enable a Rails app
|
|
6
|
+
# which wants a particular version of activerecord, RubyGems will raise an error saying "you cannot activate two versions of
|
|
7
|
+
# the same gem". Note: specifying the version, source and require names is optional, but you must include a : after the gem name to make it a YAML key/value pair (with a nil value).
|
|
8
|
+
gems:
|
|
9
|
+
# twitter:
|
|
10
|
+
# hpricot:
|
|
11
|
+
# rack:
|
|
12
|
+
# # require() one library when initializing:
|
|
13
|
+
# require: rack
|
|
14
|
+
# memcache-client:
|
|
15
|
+
# version >= 1.5.2
|
|
16
|
+
# require:
|
|
17
|
+
# # require() an Array of libraries when initializing:
|
|
18
|
+
# - memcache
|
|
19
|
+
# - memcache_util
|
|
20
|
+
# activerecord:
|
|
21
|
+
# version: >= 2.1.0
|
|
22
|
+
# aasm:
|
|
23
|
+
# source: http://gems.github.com
|
|
24
|
+
|
|
3
25
|
paths:
|
|
4
26
|
|
|
5
27
|
# All paths are relative to this file's directory
|
|
@@ -7,6 +29,6 @@ paths:
|
|
|
7
29
|
|
|
8
30
|
dialplan: dialplan.rb
|
|
9
31
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
32
|
+
events: events.rb
|
|
33
|
+
|
|
34
|
+
models: models/*.rb
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
require 'rubygems'
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
begin
|
|
4
|
+
require 'adhearsion'
|
|
5
|
+
require 'adhearsion/tasks'
|
|
6
|
+
rescue LoadError
|
|
7
|
+
STDERR.puts "\nCannot load Adhearsion! Not all Rake tasks will be loaded!\n\n"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
desc "Writes a .gitignore file that ignores certain SCM annoyances such as log files"
|
|
11
|
+
task :gitignore do
|
|
12
|
+
ignore_file = "#{Dir.pwd}/.gitignore"
|
|
13
|
+
if File.exists? ignore_file
|
|
14
|
+
STDERR.puts "File #{ignore_file} already exists!"
|
|
15
|
+
else
|
|
16
|
+
File.open ignore_file, 'w' do |file|
|
|
17
|
+
# Add other files to the Array below
|
|
18
|
+
%w[ log ].each do |pattern|
|
|
19
|
+
file.puts pattern
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
methods_for :rpc do
|
|
2
|
+
|
|
3
|
+
# Simply create proxy methods for the high-level AMI methods
|
|
4
|
+
|
|
5
|
+
[:send_action, :introduce, :originate, :call_into_context, :call_and_exec].each do |method_name|
|
|
6
|
+
define_method(method_name) do |*args|
|
|
7
|
+
if VoIP::Asterisk.manager_interface
|
|
8
|
+
VoIP::Asterisk.manager_interface.send(method_name, *args)
|
|
9
|
+
else
|
|
10
|
+
ahn_log.ami_remote.error "AMI has not been enabled in startup.rb!"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
end
|