From a24aee0fdfcbbc2200ad05ee5b789aec5988f1ad Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 24 Jun 2013 16:43:42 +0200 Subject: First step to provide an attended transfer. --- public/js/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'public/js/app.js') diff --git a/public/js/app.js b/public/js/app.js index 6d8448a..efc0752 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -27,10 +27,14 @@ App.SwitchboardRoute = Ember.Route.extend({ // Controller App.SwitchboardController = Ember.ObjectController.extend({ transfer_blind: function(call_id, destination) { - console.log('test') request_url = '/api/v1/calls/' + call_id + '.json'; jQuery.get(request_url, { transfer_blind: destination }); - } + }, + + transfer_attended: function(call_id, destination) { + request_url = '/api/v1/calls/' + call_id + '.json'; + jQuery.get(request_url, { transfer_attended: destination }); + } }); // Models -- cgit v1.2.3 From 14da4be11fe13d4fcd55143c39b73c0d086b901b Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 25 Jun 2013 13:09:07 +0200 Subject: Show transfer buttons only for switchable incoming calls. --- public/js/app.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'public/js/app.js') diff --git a/public/js/app.js b/public/js/app.js index efc0752..1dee270 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -51,6 +51,7 @@ DS.RESTAdapter.reopen({ App.Switchboard = DS.Model.extend({ switchboardEntrys: DS.hasMany('App.SwitchboardEntry'), activeCalls: DS.hasMany('App.ActiveCall'), + dispatchableIncomingCalls: DS.hasMany('App.DispatchableIncomingCall'), name: DS.attr('string') }); @@ -87,6 +88,30 @@ App.ActiveCall = DS.Model.extend({ }.property('b_callstate') }); +App.DispatchableIncomingCall = DS.Model.extend({ + start_stamp: DS.attr('number'), + callstate: DS.attr('string'), + b_callstate: DS.attr('string'), + destination: DS.attr('string'), + b_caller_id_number: DS.attr('string'), + + isActive: function() { + if (this.get('b_callstate') == 'ACTIVE') { + return true + } else { + return false + } + }.property('b_callstate'), + + isRinging: function() { + if (this.get('b_callstate') == 'RINGING') { + return true + } else { + return false + } + }.property('b_callstate') +}); + App.Adapter = DS.RESTAdapter.extend(); App.store = App.Store.create({ -- cgit v1.2.3 From 1c6646bc732def369e54ef4ac576d748c6ba9c92 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Tue, 25 Jun 2013 13:19:26 +0200 Subject: GUI improvements. --- public/js/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'public/js/app.js') diff --git a/public/js/app.js b/public/js/app.js index 1dee270..531e4b8 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -61,7 +61,8 @@ App.SwitchboardEntry = DS.Model.extend({ name: DS.attr('string'), path_to_user: DS.attr('string'), avatar_src: DS.attr('string'), - callstate: DS.attr('string') + callstate: DS.attr('string'), + switchable: DS.attr('boolean') }); App.ActiveCall = DS.Model.extend({ -- cgit v1.2.3