freeswitcher 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/lib/fsr/app/valet_park.rb +37 -0
- data/lib/fsr/version.rb +1 -1
- data/spec/fsr/app/valet_park.rb +22 -0
- data/spec/fsr/loading.rb +1 -1
- metadata +17 -4
data/Rakefile
CHANGED
@@ -2,6 +2,7 @@ require 'rake/clean'
|
|
2
2
|
require "rubygems"
|
3
3
|
require "./lib/fsr"
|
4
4
|
require "pathname"
|
5
|
+
ENV["RUBYLIB"] = ".:#{ENV['RUBYLIB']}"
|
5
6
|
|
6
7
|
PROJECT_COPYRIGHT = Pathname(__FILE__).dirname.join("License.txt").read
|
7
8
|
PROJECT_README = Pathname(__FILE__).dirname.join("README").expand_path.to_s
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "fsr/app"
|
2
|
+
module FSR
|
3
|
+
module App
|
4
|
+
class ValetPark < Application
|
5
|
+
attr_reader :valet_lot, :stall_number, :action, :range, :timeout, :prompt
|
6
|
+
|
7
|
+
def initialize(valet_lot, args = {})
|
8
|
+
@valet_lot = valet_lot
|
9
|
+
@stall_number, @action, @range, @timeout, @prompt = args.values_at(:stall_number, :action, :range, :timeout, :prompt)
|
10
|
+
case action
|
11
|
+
when nil
|
12
|
+
raise "Usage: <valet_info> <stall_number>" unless @valet_lot && @stall_number
|
13
|
+
when :ask
|
14
|
+
raise "Usage: <valet_lot> <range> <timeout> <prompt>" unless @valet_lot && @range && @timeout && @prompt
|
15
|
+
@range = "#{@range.min} #{@range.max}"
|
16
|
+
when :auto
|
17
|
+
raise "Usage: <valet_lot> <range>" unless @valet_lot && @range
|
18
|
+
@range = "#{@range.min} #{@range.max}"
|
19
|
+
@action = "auto in"
|
20
|
+
else
|
21
|
+
raise "Action must be nil, ask or auto"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def arguments
|
26
|
+
[valet_lot, stall_number, action, range, timeout, prompt].compact
|
27
|
+
end
|
28
|
+
|
29
|
+
def app_name
|
30
|
+
'valet_park'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
register(:valet_park, ValetPark)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
data/lib/fsr/version.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec/helper'
|
2
|
+
require "fsr/app"
|
3
|
+
FSR::App.load_application("valet_park")
|
4
|
+
|
5
|
+
describe "Testing FSR::App::ValetPark" do
|
6
|
+
|
7
|
+
it "puts the call into valet lot" do
|
8
|
+
valet = FSR::App::ValetPark.new("mylot", :stall_number => '5555')
|
9
|
+
valet.sendmsg.should == "call-command: execute\nexecute-app-name: valet_park\nexecute-app-arg: mylot 5555\n\n"
|
10
|
+
end
|
11
|
+
|
12
|
+
it "asks which valet lot to take call from" do
|
13
|
+
valet = FSR::App::ValetPark.new("mylot", :action => :ask, :range => 1..11, :timeout => 10000, :prompt => 'enter_ext_pound.wav')
|
14
|
+
valet.sendmsg.should == "call-command: execute\nexecute-app-name: valet_park\nexecute-app-arg: mylot ask 1 11 10000 enter_ext_pound.wav\n\n"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "autoselect parking stall" do
|
18
|
+
valet = FSR::App::ValetPark.new("mylot", :action => :auto, :range => 8501..8599)
|
19
|
+
valet.sendmsg.should == "call-command: execute\nexecute-app-name: valet_park\nexecute-app-arg: mylot auto in 8501 8599\n\n"
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/spec/fsr/loading.rb
CHANGED
@@ -4,7 +4,7 @@ require 'spec/helper'
|
|
4
4
|
describe "Testing FSR module loading methods" do
|
5
5
|
# When you add applications you must modify the expected apps_loaded behavior
|
6
6
|
it "Loads all applications" do
|
7
|
-
all_apps = [:play_and_get_digits, :uuid_dump, :uuid_setvar, :uuid_getvar, :read, :set, :transfer, :speak, :fs_sleep, :playback, :answer, :fifo, :bridge, :hangup, :conference, :fs_break, :log, :limit, :bind_meta_app, :execute_app, :callcenter, :ring_ready, :pre_answer]
|
7
|
+
all_apps = [:play_and_get_digits, :uuid_dump, :uuid_setvar, :uuid_getvar, :read, :set, :transfer, :speak, :fs_sleep, :playback, :answer, :fifo, :bridge, :hangup, :conference, :fs_break, :log, :limit, :bind_meta_app, :execute_app, :callcenter, :ring_ready, :pre_answer, :valet_park]
|
8
8
|
# Add any apps which will load to this set
|
9
9
|
apps_loaded = FSR.load_all_applications
|
10
10
|
apps_loaded.kind_of?(Array).should == true
|
metadata
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freeswitcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 6
|
8
|
+
- 6
|
9
|
+
version: 0.6.6
|
6
10
|
platform: ruby
|
7
11
|
authors:
|
8
12
|
- Jayson Vaughn
|
@@ -13,7 +17,7 @@ autorequire:
|
|
13
17
|
bindir: bin
|
14
18
|
cert_chain: []
|
15
19
|
|
16
|
-
date: 2011-
|
20
|
+
date: 2011-03-05 00:00:00 -06:00
|
17
21
|
default_executable:
|
18
22
|
dependencies:
|
19
23
|
- !ruby/object:Gem::Dependency
|
@@ -24,6 +28,8 @@ dependencies:
|
|
24
28
|
requirements:
|
25
29
|
- - ">="
|
26
30
|
- !ruby/object:Gem::Version
|
31
|
+
segments:
|
32
|
+
- 0
|
27
33
|
version: "0"
|
28
34
|
type: :runtime
|
29
35
|
version_requirements: *id001
|
@@ -74,6 +80,7 @@ files:
|
|
74
80
|
- lib/fsr/app/uuid_dump.rb
|
75
81
|
- lib/fsr/app/uuid_getvar.rb
|
76
82
|
- lib/fsr/app/uuid_setvar.rb
|
83
|
+
- lib/fsr/app/valet_park.rb
|
77
84
|
- lib/fsr/cmd.rb
|
78
85
|
- lib/fsr/cmd/call_center.rb
|
79
86
|
- lib/fsr/cmd/calls.rb
|
@@ -150,6 +157,7 @@ files:
|
|
150
157
|
- spec/fsr/app/ring_ready.rb
|
151
158
|
- spec/fsr/app/set.rb
|
152
159
|
- spec/fsr/app/transfer.rb
|
160
|
+
- spec/fsr/app/valet_park.rb
|
153
161
|
- spec/fsr/cmd.rb
|
154
162
|
- spec/fsr/cmd/call_center.rb
|
155
163
|
- spec/fsr/cmd/calls.rb
|
@@ -364,17 +372,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
364
372
|
requirements:
|
365
373
|
- - ">="
|
366
374
|
- !ruby/object:Gem::Version
|
375
|
+
segments:
|
376
|
+
- 0
|
367
377
|
version: "0"
|
368
378
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
369
379
|
none: false
|
370
380
|
requirements:
|
371
381
|
- - ">="
|
372
382
|
- !ruby/object:Gem::Version
|
383
|
+
segments:
|
384
|
+
- 0
|
373
385
|
version: "0"
|
374
386
|
requirements: []
|
375
387
|
|
376
388
|
rubyforge_project: freeswitcher
|
377
|
-
rubygems_version: 1.
|
389
|
+
rubygems_version: 1.3.7
|
378
390
|
signing_key:
|
379
391
|
specification_version: 3
|
380
392
|
summary: A library for interacting with the "FreeSWITCH":http://freeswitch.org telephony platform
|
@@ -398,6 +410,7 @@ test_files:
|
|
398
410
|
- spec/fsr/app/ring_ready.rb
|
399
411
|
- spec/fsr/app/set.rb
|
400
412
|
- spec/fsr/app/transfer.rb
|
413
|
+
- spec/fsr/app/valet_park.rb
|
401
414
|
- spec/fsr/cmd.rb
|
402
415
|
- spec/fsr/cmd/call_center.rb
|
403
416
|
- spec/fsr/cmd/calls.rb
|