summaryrefslogtreecommitdiffstats
path: root/app/api
diff options
context:
space:
mode:
authorMatt Porter <mporter@konsulko.com>2017-08-08 09:17:37 -0400
committerMatt Porter <mporter@konsulko.com>2017-08-08 09:55:25 -0400
commit05861567c962cea3216a2c46227366639fa70525 (patch)
treef4ce62a0767aadc5f5290a6016db3a25e25b2546 /app/api
parente598975c8374effa043eb83dcae1c08749f3ea91 (diff)
Convert telephony-binding and phone app from broadcast events to subscribe/unsubscribe events. Bug-AGL: SPEC-815 Change-Id: I6288db22332277e217b3f1a4e79a391cb63ebc16 Signed-off-by: Matt Porter <mporter@konsulko.com>
Diffstat (limited to 'app/api')
-rw-r--r--app/api/Telephony.qml13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/api/Telephony.qml b/app/api/Telephony.qml
index c7d9218..2db2d0b 100644
--- a/app/api/Telephony.qml
+++ b/app/api/Telephony.qml
@@ -58,6 +58,7 @@ WebSocket {
var payload = JSON.parse(JSON.stringify(json[2]))
var event = payload.event
var data = payload.data
+ console.debug("event: " + event)
if (event == "telephony/incomingCall") {
callClipColp = data.clip
callStatus = "incoming"
@@ -76,6 +77,10 @@ WebSocket {
onStatusChanged: {
switch (status) {
case WebSocket.Open:
+ sendSocketMessage("subscribe", { value: "callStateChanged" })
+ sendSocketMessage("subscribe", { value: "dialingCall" })
+ sendSocketMessage("subscribe", { value: "incomingCall" })
+ sendSocketMessage("subscribe", { value: "terminatedCall" })
break
case WebSocket.Error:
root.statusString = "WebSocket error: " + root.errorString
@@ -83,7 +88,7 @@ WebSocket {
}
}
- function sendSocketMesage(verb, parameter) {
+ function sendSocketMessage(verb, parameter) {
var requestJson = [ msgid.call, payloadLength, apiString + '/' + verb, parameter ]
verbs.push(verb)
sendTextMessage(JSON.stringify(requestJson))
@@ -91,16 +96,16 @@ WebSocket {
function dial(number) {
var parameterJson = { value: number }
- sendSocketMesage("dial", parameterJson)
+ sendSocketMessage("dial", parameterJson)
}
function answer() {
var parameterJson = 'None'
- sendSocketMesage("answer", parameterJson)
+ sendSocketMessage("answer", parameterJson)
}
function hangup() {
var parameterJson = 'None'
- sendSocketMesage("hangup", parameterJson)
+ sendSocketMessage("hangup", parameterJson)
}
}