AsteriskRuby 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,80 @@
1
+ #!/usr/local/bin/ruby -wKU -I ../../lib
2
+ ## Copyright (c) 2007, Vonage Holdings
3
+ ##
4
+ ## All rights reserved.
5
+ ##
6
+ ## Redistribution and use in source and binary forms, with or without
7
+ ## modification, are permitted provided that the following conditions are met:
8
+ ##
9
+ ## * Redistributions of source code must retain the above copyright
10
+ ## notice, this list of conditions and the following disclaimer.
11
+ ## * Redistributions in binary form must reproduce the above copyright
12
+ ## notice, this list of conditions and the following disclaimer in the
13
+ ## documentation and/or other materials provided with the distribution.
14
+ ## * Neither the name of Vonage Holdings nor the names of its
15
+ ## contributors may be used to endorse or promote products derived from this
16
+ ## software without specific prior written permission.
17
+ ##
18
+ ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ ## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
+ ## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22
+ ## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23
+ ## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
+ ## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
+ ## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
+ ## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
+ ## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
+ ## POSSIBILITY OF SUCH DAMAGE.
29
+ ##
30
+ ## Author: Michael Komitee
31
+
32
+ require 'stringio'
33
+ require 'AGIState'
34
+ require "test/unit"
35
+
36
+ class TestAGIState < Test::Unit::TestCase
37
+ def test_init_state
38
+ state = AGIState.new(:threshold => 10)
39
+ 9.times do
40
+ assert_nothing_thrown { state.failure_inc }
41
+ end
42
+ assert_raise(AGIStateFailure) { state.failure_inc }
43
+ end
44
+ def test_classdefault_state
45
+ AGIState.failure_threshold = 5
46
+ state = AGIState.new()
47
+ 4.times do
48
+ assert_nothing_thrown { state.failure_inc }
49
+ end
50
+ assert_raise(AGIStateFailure) { state.failure_inc }
51
+ end
52
+ end
53
+
54
+ ## Copyright (c) 2007, Vonage Holdings
55
+ ##
56
+ ## All rights reserved.
57
+ ##
58
+ ## Redistribution and use in source and binary forms, with or without
59
+ ## modification, are permitted provided that the following conditions are met:
60
+ ##
61
+ ## * Redistributions of source code must retain the above copyright
62
+ ## notice, this list of conditions and the following disclaimer.
63
+ ## * Redistributions in binary form must reproduce the above copyright
64
+ ## notice, this list of conditions and the following disclaimer in the
65
+ ## documentation and/or other materials provided with the distribution.
66
+ ## * Neither the name of Vonage Holdings nor the names of its
67
+ ## contributors may be used to endorse or promote products derived from this
68
+ ## software without specific prior written permission.
69
+ ##
70
+ ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
71
+ ## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
72
+ ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
73
+ ## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
74
+ ## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
75
+ ## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
76
+ ## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
77
+ ## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
78
+ ## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
79
+ ## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
80
+ ## POSSIBILITY OF SUCH DAMAGE.
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.0
3
+ specification_version: 1
4
+ name: AsteriskRuby
5
+ version: !ruby/object:Gem::Version
6
+ version: 1.0.0
7
+ date: 2007-07-27 00:00:00 -04:00
8
+ summary: A full featured Asterisk AGI Framework
9
+ require_paths:
10
+ - lib
11
+ email:
12
+ - mkomitee@vonage.com
13
+ homepage: http://www.vonage.com/
14
+ rubyforge_project:
15
+ description:
16
+ autorequire: AGIFramework
17
+ default_executable:
18
+ bindir: bin
19
+ has_rdoc: true
20
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
21
+ requirements:
22
+ - - ">"
23
+ - !ruby/object:Gem::Version
24
+ version: 0.0.0
25
+ version:
26
+ platform: ruby
27
+ signing_key:
28
+ cert_chain:
29
+ post_install_message:
30
+ authors:
31
+ - Michael Komitee
32
+ files:
33
+ - examples/AGI
34
+ - examples/AGIMenu
35
+ - examples/AGISelection
36
+ - examples/AGIServer
37
+ - examples/AGIState
38
+ - examples/AGIMenu/config
39
+ - examples/AGIMenu/example1-filename.rb
40
+ - examples/AGIMenu/example2-file.rb
41
+ - examples/AGIMenu/example3-yaml.rb
42
+ - examples/AGIMenu/example4-hash.rb
43
+ - examples/AGIMenu/example5-empty.rb
44
+ - examples/AGIMenu/config/menu.yaml
45
+ - examples/AGISelection/example1.rb
46
+ - examples/AGIServer/config
47
+ - examples/AGIServer/example1-routing.rb
48
+ - examples/AGIServer/example2-agiblock.rb
49
+ - examples/AGIServer/example3-agiparamsblock.rb
50
+ - examples/AGIServer/config/example-config.yaml
51
+ - examples/AGIState/example1.rb
52
+ - lib/AGI.rb
53
+ - lib/AGIExceptions.rb
54
+ - lib/AGIFramework.rb
55
+ - lib/AGIMenu.rb
56
+ - lib/AGIResponse.rb
57
+ - lib/AGIRoute.rb
58
+ - lib/AGIRouter.rb
59
+ - lib/AGISelection.rb
60
+ - lib/AGIServer.rb
61
+ - lib/AGIState.rb
62
+ - lib/AsteriskRuby.rb
63
+ - tests/AGI
64
+ - tests/AGIMenu
65
+ - tests/AGISelection
66
+ - tests/AGIServer
67
+ - tests/AGIState
68
+ - tests/AGI/tests.rb
69
+ - tests/AGIMenu/config
70
+ - tests/AGIMenu/tests.rb
71
+ - tests/AGIMenu/config/menu.yaml
72
+ - tests/AGISelection/tests.rb
73
+ - tests/AGIServer/tests.rb
74
+ - tests/AGIState/tests.rb
75
+ - README
76
+ test_files:
77
+ - tests/AGI
78
+ - tests/AGIMenu
79
+ - tests/AGISelection
80
+ - tests/AGIServer
81
+ - tests/AGIState
82
+ - tests/AGI/tests.rb
83
+ - tests/AGIMenu/config
84
+ - tests/AGIMenu/tests.rb
85
+ - tests/AGIMenu/config/menu.yaml
86
+ - tests/AGISelection/tests.rb
87
+ - tests/AGIServer/tests.rb
88
+ - tests/AGIState/tests.rb
89
+ rdoc_options: []
90
+
91
+ extra_rdoc_files:
92
+ - README
93
+ executables: []
94
+
95
+ extensions: []
96
+
97
+ requirements: []
98
+
99
+ dependencies: []
100
+