From 888fd4ffce7a858924355a455bfb57b9cc6d21b7 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 15 Oct 2013 19:48:16 -0700 Subject: [PATCH] Wire up the xmpp jingle action --- clientapp/views/call.js | 25 +++++++++++++++++++------ package.json | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/clientapp/views/call.js b/clientapp/views/call.js index a399242..a1ddf5c 100644 --- a/clientapp/views/call.js +++ b/clientapp/views/call.js @@ -1,4 +1,4 @@ -/*global $*/ +/*global $, app*/ "use strict"; var _ = require('underscore'); @@ -35,23 +35,36 @@ module.exports = HumanView.extend({ return this; }, handleAnswerClick: function (e) { - + e.preventDefault(); + var self = this; + app.api.jingle.startLocalMedia(null, function () { + self.model.jingleSession.accept(); + self.model.state = 'active'; + }); return false; }, handleIgnoreClick: function (e) { - + e.preventDefault(); + this.model.jingleSession.end({ + condition: 'decline' + }); return false; }, handleCancelClick: function (e) { - + e.preventDefault(); + this.model.jingleSession.end({ + condition: 'cancel' + }); return false; }, handleEndClick: function (e) { - + e.preventDefault(); + this.model.jingleSession.end({ + condition: 'success' + }); return false; }, handleMuteClick: function (e) { - return false; }, // we want to make sure we show the appropriate buttons diff --git a/package.json b/package.json index c88d8c6..2f89226 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "templatizer": "0.1.2", "underscore": "1.5.1", "raf-component": "1.1.1", - "stanza.io": "2.5.10", + "stanza.io": "2.5.12", "notify.js": "0.0.3", "wildemitter": "0.0.5", "attachmediastream": "",