diff options
author | Matt Porter <mporter@konsulko.com> | 2017-08-08 09:17:37 -0400 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-09-26 12:00:47 -0700 |
commit | 28f6028329b573001a16e2792f73a9efaafecf3f (patch) | |
tree | ac2b0122bd1ad330e6a471d37e399433a5200348 /app/api/Telephony.qml | |
parent | edae16e793b2ef2dd680821357128b5165b34b78 (diff) |
Convert telephony-binding and phone app from broadcast events
to subscribe/unsubscribe events.
Bug-AGL: SPEC-815 SPEC-913
Change-Id: I6288db22332277e217b3f1a4e79a391cb63ebc16
Signed-off-by: Matt Porter <mporter@konsulko.com>
Diffstat (limited to 'app/api/Telephony.qml')
-rw-r--r-- | app/api/Telephony.qml | 13 |
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) } } |