alucma 1.0.5 → 1.0.6
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/lib/alucma/client.rb +12 -4
- data/lib/alucma/http.rb +7 -2
- 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: 1fec90d123890ff5b6d2b2ae51c2ec5f7edba828
|
|
4
|
+
data.tar.gz: 96ecaf1d17de694cf22d3d602860c4a4280cd49c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d5804680356d1f736ffb6cfca80217b920d5b6e7ed75390b2fb5d131180b9a43cb2935dbfe1236236b6aba337038dfa6e22023847a4ce5ea867041d9bd466775
|
|
7
|
+
data.tar.gz: abfbd7d3e33d1ea2de4a7b4cc5b9d0128e10518f7374bcc9eb646c6b08d17e61b6f6fe619091ad486ae17f8a8a17230f3d7f1103818197b95ea87ad510312c13
|
data/lib/alucma/client.rb
CHANGED
|
@@ -9,13 +9,21 @@ class Client
|
|
|
9
9
|
}
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
def
|
|
13
|
-
return Http.post("http://api.foundry.att.net:9001/a1/nca/
|
|
14
|
-
"
|
|
15
|
-
"
|
|
12
|
+
def subscribe_to_number(phonenumber,direction,criteria,callback_url)
|
|
13
|
+
return Http.post("http://api.foundry.att.net:9001/a1/nca/subscription/callEvent/#{phonenumber}", self.headers, {
|
|
14
|
+
"addressDirection" => direction,
|
|
15
|
+
"criteria" => criteria,
|
|
16
|
+
"url" => callback_url
|
|
16
17
|
}.to_json)
|
|
17
18
|
end
|
|
18
19
|
|
|
20
|
+
def make_call(phonenumber,displayname,recording_url=nil)
|
|
21
|
+
params = {}
|
|
22
|
+
params["p1_displayName"] = displayname
|
|
23
|
+
params["announcement"] = recording_url if recording_url
|
|
24
|
+
return Http.post("http://api.foundry.att.net:9001/a1/nca/callcontrol/call/#{phonenumber}", self.headers, params.to_json)
|
|
25
|
+
end
|
|
26
|
+
|
|
19
27
|
def subscribe_to_call(session_id,callback_url)
|
|
20
28
|
return Http.post("http://api.foundry.att.net:9001/a1/nca/interaction/subscribe", self.headers, {
|
|
21
29
|
"sessionId": session_id,
|
data/lib/alucma/http.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class Http
|
|
2
|
-
def self.post(url, headers, payload)
|
|
2
|
+
def self.post(url, headers, payload=nil)
|
|
3
3
|
begin
|
|
4
4
|
uri = URI.parse(url)
|
|
5
5
|
http = Net::HTTP.new(uri.host,uri.port)
|
|
@@ -15,7 +15,12 @@ class Http
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
res = http.request(req)
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
if res.body
|
|
20
|
+
return JSON.parse res.body
|
|
21
|
+
else
|
|
22
|
+
return { :error => true, :response => res.body }
|
|
23
|
+
end
|
|
19
24
|
rescue => e
|
|
20
25
|
puts e.to_s
|
|
21
26
|
return false
|