exotel_api 0.5.0 → 0.5.1
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.
- checksums.yaml +4 -4
- data/app/controllers/exotel_api/call/after_dtmf/connect_controller.rb +2 -19
- data/app/controllers/exotel_api/call/after_dtmf_controller.rb +2 -19
- data/app/controllers/exotel_api/call/after_greeting/connect_controller.rb +2 -19
- data/app/controllers/exotel_api/call/after_greeting_controller.rb +2 -19
- data/app/controllers/exotel_api/call/connect_controller.rb +2 -19
- data/app/controllers/exotel_api/call_controller.rb +18 -18
- data/app/controllers/exotel_api/ivr/call_controller.rb +0 -2
- data/app/controllers/exotel_api/start_controller.rb +19 -0
- data/config/routes.rb +2 -1
- data/lib/exotel_api/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cd9032584002a065e8875e00362bd88717a81fb
|
4
|
+
data.tar.gz: 1dfbb9cdc4766ea346aa792bf2196b9426c810f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab95301818d01ee0ed2ce99113ccb591d5c39bb1326306234644087ab6bc0368fc61569cddc38eac2db53279f45ce4cd4416221e5ea145232b124dd3239a1db9
|
7
|
+
data.tar.gz: 1b518905b133c183a984f24deaeddcf7ca3571984417b8dbaed3fb3ba8e0360b03b0d8cda78fa70ba7b00759897e976bfc48bd55e176ba1f3bc116ecc8aed85b
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ExotelApi
|
2
2
|
module Call
|
3
3
|
module AfterDtmf
|
4
|
-
class ConnectController <
|
4
|
+
class ConnectController < StartController
|
5
5
|
#response - nil
|
6
6
|
def status
|
7
7
|
begin
|
@@ -15,24 +15,7 @@ module ExotelApi
|
|
15
15
|
end
|
16
16
|
render :plain => '', content_type: "text/plain", :status => 200
|
17
17
|
end
|
18
|
-
|
19
|
-
private
|
20
|
-
def find_call
|
21
|
-
if params[:CustomField].present?
|
22
|
-
params[:CustomField].titleize.split.join.constantize::Call::AfterDtmf::Connect.find_by_call_sid(params[:CallSid])
|
23
|
-
else
|
24
|
-
Call.find_by_call_sid(params[:CallSid])
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def direction
|
29
|
-
if params[:Direction] == 'incoming'
|
30
|
-
eval(ExotelApi.inbound_query)
|
31
|
-
else
|
32
|
-
find_call
|
33
|
-
end
|
34
|
-
end
|
35
18
|
end
|
36
19
|
end
|
37
20
|
end
|
38
|
-
end
|
21
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module ExotelApi
|
2
2
|
module Call
|
3
|
-
class AfterDtmfController <
|
3
|
+
class AfterDtmfController < StartController
|
4
4
|
#response - list of URLs
|
5
5
|
def greeting
|
6
6
|
begin
|
@@ -40,23 +40,6 @@ module ExotelApi
|
|
40
40
|
end
|
41
41
|
render :plain => phones, content_type: "text/plain", :status => 200
|
42
42
|
end
|
43
|
-
|
44
|
-
private
|
45
|
-
def find_call
|
46
|
-
if params[:CustomField].present?
|
47
|
-
params[:CustomField].titleize.split.join.constantize::Call::AfterDtmf.find_by_call_sid(params[:CallSid])
|
48
|
-
else
|
49
|
-
Call.find_by_call_sid(params[:CallSid])
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def direction
|
54
|
-
if params[:Direction] == 'incoming'
|
55
|
-
eval(ExotelApi.inbound_query)
|
56
|
-
else
|
57
|
-
find_call
|
58
|
-
end
|
59
|
-
end
|
60
43
|
end
|
61
44
|
end
|
62
|
-
end
|
45
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ExotelApi
|
2
2
|
module Call
|
3
3
|
module AfterGreeting
|
4
|
-
class ConnectController <
|
4
|
+
class ConnectController < StartController
|
5
5
|
#response - nil
|
6
6
|
def status
|
7
7
|
begin
|
@@ -15,24 +15,7 @@ module ExotelApi
|
|
15
15
|
end
|
16
16
|
render :plain => '', content_type: "text/plain", :status => 200
|
17
17
|
end
|
18
|
-
|
19
|
-
private
|
20
|
-
def find_call
|
21
|
-
if params[:CustomField].present?
|
22
|
-
params[:CustomField].titleize.split.join.constantize::Call::AfterGreeting::Connect.find_by_call_sid(params[:CallSid])
|
23
|
-
else
|
24
|
-
Call.find_by_call_sid(params[:CallSid])
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def direction
|
29
|
-
if params[:Direction] == 'incoming'
|
30
|
-
eval(ExotelApi.inbound_query)
|
31
|
-
else
|
32
|
-
find_call
|
33
|
-
end
|
34
|
-
end
|
35
18
|
end
|
36
19
|
end
|
37
20
|
end
|
38
|
-
end
|
21
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module ExotelApi
|
2
2
|
module Call
|
3
|
-
class AfterGreetingController <
|
3
|
+
class AfterGreetingController < StartController
|
4
4
|
#response - phone
|
5
5
|
def connect
|
6
6
|
begin
|
@@ -14,23 +14,6 @@ module ExotelApi
|
|
14
14
|
end
|
15
15
|
render :plain => phones, content_type: "text/plain", :status => 200
|
16
16
|
end
|
17
|
-
|
18
|
-
private
|
19
|
-
def find_call
|
20
|
-
if params[:CustomField].present?
|
21
|
-
params[:CustomField].titleize.split.join.constantize::Call::AfterGreeting.find_by_call_sid(params[:CallSid])
|
22
|
-
else
|
23
|
-
Call.find_by_call_sid(params[:CallSid])
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def direction
|
28
|
-
if params[:Direction] == 'incoming'
|
29
|
-
eval(ExotelApi.inbound_query)
|
30
|
-
else
|
31
|
-
find_call
|
32
|
-
end
|
33
|
-
end
|
34
17
|
end
|
35
18
|
end
|
36
|
-
end
|
19
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module ExotelApi
|
2
2
|
module Call
|
3
|
-
class ConnectController <
|
3
|
+
class ConnectController < StartController
|
4
4
|
#response - nil
|
5
5
|
def status
|
6
6
|
begin
|
@@ -14,23 +14,6 @@ module ExotelApi
|
|
14
14
|
end
|
15
15
|
render :plain => '', content_type: "text/plain", :status => 200
|
16
16
|
end
|
17
|
-
|
18
|
-
private
|
19
|
-
def find_call
|
20
|
-
if params[:CustomField].present?
|
21
|
-
params[:CustomField].titleize.split.join.constantize::Call::Connect.find_by_call_sid(params[:CallSid])
|
22
|
-
else
|
23
|
-
Call.find_by_call_sid(params[:CallSid])
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def direction
|
28
|
-
if params[:Direction] == 'incoming'
|
29
|
-
eval(ExotelApi.inbound_query)
|
30
|
-
else
|
31
|
-
find_call
|
32
|
-
end
|
33
|
-
end
|
34
17
|
end
|
35
18
|
end
|
36
|
-
end
|
19
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module ExotelApi
|
2
|
-
class CallController <
|
2
|
+
class CallController < StartController
|
3
3
|
skip_before_filter :verify_authenticity_token
|
4
4
|
#response - greeting,menu,connect
|
5
5
|
def start
|
@@ -105,23 +105,23 @@ module ExotelApi
|
|
105
105
|
end
|
106
106
|
render :plain => applet, content_type: "text/html", status: 200
|
107
107
|
end
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
find_call
|
108
|
+
#response - status code 200,302
|
109
|
+
def repeat
|
110
|
+
begin
|
111
|
+
_call = direction
|
112
|
+
if _call.present?
|
113
|
+
answer = _call.play_again(params) if defined?(_call.play_again)
|
114
|
+
if answer == 'yes'
|
115
|
+
status = '200'
|
116
|
+
else
|
117
|
+
status = '302'
|
118
|
+
end
|
119
|
+
end
|
120
|
+
rescue => e
|
121
|
+
logger.error e.message
|
122
|
+
logger.error e.backtrace.join("\n")
|
124
123
|
end
|
124
|
+
render :plain => '', content_type: "text/plain", :status => status
|
125
125
|
end
|
126
126
|
end
|
127
|
-
end
|
127
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ExotelApi
|
2
|
+
class StartController < ApplicationController
|
3
|
+
def direction
|
4
|
+
if params[:Direction] == 'incoming'
|
5
|
+
eval(ExotelApi.inbound_query)
|
6
|
+
else
|
7
|
+
find_call
|
8
|
+
end
|
9
|
+
end
|
10
|
+
private
|
11
|
+
def find_call
|
12
|
+
if params[:CustomField].present?
|
13
|
+
params[:CustomField].titleize.split.join.constantize::Call.find_by_call_sid(params[:CallSid])
|
14
|
+
else
|
15
|
+
eval(ExotelApi.status_callback_query)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/config/routes.rb
CHANGED
data/lib/exotel_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exotel_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aashutosh Chaudhary
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- app/controllers/exotel_api/call/connect_controller.rb
|
112
112
|
- app/controllers/exotel_api/call_controller.rb
|
113
113
|
- app/controllers/exotel_api/ivr/call_controller.rb
|
114
|
+
- app/controllers/exotel_api/start_controller.rb
|
114
115
|
- bin/console
|
115
116
|
- bin/setup
|
116
117
|
- config/routes.rb
|