freec 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.rdoc +9 -16
- data/lib/freec.rb +3 -3
- data/lib/freec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df2fa8a96256734d308ad216676ff07f879d6266
|
4
|
+
data.tar.gz: 7408f1183efa35c140a83515a9d8e40078823980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d6ade697846f0b75566dedf0c0ccc3d0ea78895e8ffe4f42265544c6a8d5620678563717ad22fdf387b18dcfbefa859d4dc1ca674e892d85ec5612b43ff3472
|
7
|
+
data.tar.gz: 4283bc10510063f7a100a5a7bb7025f18b7932506e9b6bc978b1962192b49bd6b10a0cea97c42a595caf6a79d88411b07ab2c99869cd15221e10762412f922a5
|
data/Gemfile.lock
CHANGED
data/README.rdoc
CHANGED
@@ -6,20 +6,20 @@ Freec is a framework you can build voice applications on top of. It makes use of
|
|
6
6
|
|
7
7
|
= Usage
|
8
8
|
1. Install Freeswitch and point a chosen extension to the IP where your app will run:
|
9
|
-
|
9
|
+
|
10
10
|
<extension name="telfa">
|
11
11
|
<condition field="destination_number" expression="^.*$">
|
12
12
|
<action application="socket" data="127.0.0.1:8084 async full" />
|
13
13
|
</condition>
|
14
14
|
</extension>
|
15
|
-
|
15
|
+
|
16
16
|
2. Create a file with the main class of your application (e.g. Jukebox) and make it a subclass of Freec. Name the file according to the class name (e.g. jukebox.rb). Implement
|
17
17
|
a step method instructions for which will follow. Simple example:
|
18
|
-
|
18
|
+
|
19
19
|
#jukebox.rb
|
20
20
|
require 'rubygems'
|
21
21
|
require 'freec'
|
22
|
-
class Jukebox <
|
22
|
+
class Jukebox < FreecBase
|
23
23
|
def step
|
24
24
|
@step ||= 1
|
25
25
|
case @step
|
@@ -34,10 +34,12 @@ Freec is a framework you can build voice applications on top of. It makes use of
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
start
|
38
|
+
|
37
39
|
3. Run it with:
|
38
40
|
ruby jukebox.rb
|
39
41
|
|
40
|
-
= How does it work
|
42
|
+
= How does it work
|
41
43
|
The step method is called after each even is finished (e.g. file is played, recording is finished). Here is what you can do:
|
42
44
|
* read call variables from the hash in call_vars
|
43
45
|
* call one of the following methods (Freeswitch apps):
|
@@ -49,10 +51,10 @@ The step method is called after each even is finished (e.g. file is played, reco
|
|
49
51
|
* set_variable(name, value)
|
50
52
|
* any other via execute_app(app_name, params)
|
51
53
|
If you return nil or false from the step method, the call will be hungup.
|
52
|
-
|
54
|
+
|
53
55
|
= Cool stuff
|
54
56
|
* Your application's main file as well as everything you might have in the lib directory will be reloaded on each step in development mode.
|
55
|
-
* Passing -d will daemonize the application and automatically implies production mode.
|
57
|
+
* Passing -d will daemonize the application and automatically implies production mode.
|
56
58
|
* The log directory contains the log file and the pid file.
|
57
59
|
* There is a hidden feature.
|
58
60
|
|
@@ -62,12 +64,3 @@ What Freec can do at the moment was enough for me to implement Telfa (http://tel
|
|
62
64
|
2. Fork it and change yourself.
|
63
65
|
3. Check Liverpie (http://www.liverpie.com/) or Telegraph (http://code.google.com/p/telegraph/), Freec is inspired by them.
|
64
66
|
4. Write yours :-)
|
65
|
-
|
66
|
-
= License
|
67
|
-
Copyright © 2009 Jan Kubr
|
68
|
-
|
69
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
70
|
-
|
71
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
72
|
-
|
73
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/freec.rb
CHANGED
@@ -46,9 +46,9 @@ def freec_app_configuration_file
|
|
46
46
|
"#{ROOT}/config/config.yml"
|
47
47
|
end
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
ROOT = File.expand_path(File.dirname($0))
|
50
|
+
ENVIRONMENT = ARGV[0] == '-d' ? 'production' : 'development'
|
51
|
+
def start
|
52
52
|
create_freec_app_log_dir
|
53
53
|
load_freec_app_config
|
54
54
|
if ARGV[0] == '-d'
|
data/lib/freec/version.rb
CHANGED