trails 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/trails.rb +1 -1
- data/lib/trails/test_helper.rb +7 -1
- data/lib/trails/twilio/incoming.rb +7 -2
- metadata +2 -2
data/lib/trails.rb
CHANGED
data/lib/trails/test_helper.rb
CHANGED
@@ -8,6 +8,11 @@ module Trails
|
|
8
8
|
session
|
9
9
|
end
|
10
10
|
|
11
|
+
def as_twilio_sms( twilio_opts = {}, &block )
|
12
|
+
twilio_opts[:sms] = true
|
13
|
+
as_twilio( twilio_opts, &block )
|
14
|
+
end
|
15
|
+
|
11
16
|
def as_twilio( as_twilio_opts = {}, &block )
|
12
17
|
if( @integration_session )
|
13
18
|
modify_session_with_twilio_opts( @integration_session, as_twilio_opts )
|
@@ -101,7 +106,8 @@ module Trails
|
|
101
106
|
from = as_twilio_opts[:from] || '6665554321'
|
102
107
|
params['Caller'] = caller
|
103
108
|
params['Called'] = called
|
104
|
-
params['From'] = from
|
109
|
+
params['From'] = from
|
110
|
+
params['SmsMessageSid'] = 'DummyMessageSid' if( as_twilio_opts[:sms] )
|
105
111
|
end
|
106
112
|
|
107
113
|
private
|
@@ -7,12 +7,17 @@ module Trails
|
|
7
7
|
@account = Trails::Twilio::Account.from_request( request )
|
8
8
|
end
|
9
9
|
|
10
|
-
protected
|
11
|
-
attr_reader :request
|
12
10
|
def twilio_data
|
13
11
|
@twilio_data ||= request.params.slice( INCOMING_VARS ).dup
|
14
12
|
end
|
15
13
|
|
14
|
+
def is_sms?
|
15
|
+
!sms_message_sid.blank?
|
16
|
+
end
|
17
|
+
|
18
|
+
protected
|
19
|
+
attr_reader :request
|
20
|
+
|
16
21
|
INCOMING_VARS = [
|
17
22
|
# Always available:
|
18
23
|
'CallGuid', # A unique identifier for this call, generated by Twilio. It's 34 characters long, and always starts with the letters CA.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hemant Bhanoo
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-03-
|
12
|
+
date: 2010-03-18 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|