twilio_thinqlcr 1.0.2

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 777c5ca4c94b0661a45c66fed7aee16d65143561d6956f36db613d854d77c6a3
4
+ data.tar.gz: 0df2045cdaff50288aec6776714117fd74f822e95fe6412d682b44d3a7aaf5f4
5
+ SHA512:
6
+ metadata.gz: e64f67256385c94bfb41edfffa77c9b76dd98be7ccaacf48c994ea6202377bffa25f91b3634414a8b201c7bd15d275d262801cae12346ce3430fa0ec96d631b7
7
+ data.tar.gz: 690310365ab0c0932f2369a074d229686481fb351adfd50d3b1a82db225d58bcab0331504183df54187f55efec7d08368fa98eda52e513eecb2a951c31d21e74
@@ -0,0 +1,3 @@
1
+ module TwilioThinqlcr
2
+ VERSION = "1.0.2"
3
+ end
@@ -0,0 +1,41 @@
1
+ module TwilioThinqlcr
2
+ # The main twilio wrapper class that integrates thinQ.
3
+ class TwilioWrapper
4
+
5
+ THINQ_DOMAIN = "wap.thinq.com"
6
+ TWIML_RESOURCE_URL_DEFAULT = "http://demo.twilio.com/docs/voice.xml"
7
+
8
+ attr_accessor :client, :twilio_account_sid, :twilio_account_token, :thinQ_id, :thinQ_token
9
+
10
+ def initialize(twilio_account_sid, twilio_account_token, thinQ_id, thinQ_token)
11
+ @twilio_account_sid = twilio_account_sid
12
+ @twilio_account_token = twilio_account_token
13
+ @thinQ_id = thinQ_id
14
+ @thinQ_token = thinQ_token
15
+
16
+ @client = Twilio::REST::Client.new twilio_account_sid, twilio_account_token
17
+ end
18
+
19
+ def isClientValid?
20
+ !@client.nil? and !@client.account.nil?
21
+ end
22
+
23
+ def call(from, to, twiml_resource_url = nil)
24
+ @twiml_resource_url = twiml_resource_url ||= TWIML_RESOURCE_URL_DEFAULT
25
+ if !self.isClientValid?
26
+ return "Invalid Twilio Account details."
27
+ end
28
+
29
+ begin
30
+ # :url => @twiml_resource_url,
31
+ @call = @client.account.calls.create({:to => "sip:#{to}@#{THINQ_DOMAIN}?thinQid=#{@thinQ_id}&thinQtoken=#{@thinQ_token}",
32
+ :from => from,
33
+ :url => @twiml_resource_url})
34
+ return @call
35
+ rescue Exception => e
36
+ return e.message
37
+ end
38
+ end
39
+
40
+ end
41
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: twilio_thinqlcr
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ platform: ruby
6
+ authors:
7
+ - thinQ
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-04-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: twilio-ruby
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Note that you will need a valid LCR Account with thinQ before using the
70
+ libraries. For more information please contact your thinQ Sales representative at
71
+ http://www.thinq.com/library/.
72
+ email:
73
+ - info@thinq.com
74
+ executables: []
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - lib/twilio_thinqlcr.rb
79
+ - lib/twilio_thinqlcr/version.rb
80
+ homepage: https://github.com/thinqinc/twilio-thinQLCR-ruby
81
+ licenses:
82
+ - MIT
83
+ metadata: {}
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ requirements: []
99
+ rubyforge_project:
100
+ rubygems_version: 2.6.11
101
+ signing_key:
102
+ specification_version: 4
103
+ summary: Twilio Wrapper Ruby Library For thinQ LCR integration.
104
+ test_files: []