From b97103d6be5844684381c57deda19d4af3672afd Mon Sep 17 00:00:00 2001 From: Seven Du Date: Tue, 30 Jul 2013 02:18:14 +0800 Subject: [PATCH] Oops, we already have auto_update with pulling Only use events to update calls when not pulling --- htdocs/portal/assets/js/fsportal.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/htdocs/portal/assets/js/fsportal.js b/htdocs/portal/assets/js/fsportal.js index 4738f90143..ab99306846 100644 --- a/htdocs/portal/assets/js/fsportal.js +++ b/htdocs/portal/assets/js/fsportal.js @@ -728,11 +728,28 @@ function eventCallback(data) { direction: data["Call-Direction"] } App.channelsController.pushObject(App.Channel.create(channel)); + + var x = $('#auto_update_calls')[0]; + if (typeof x != "undefined" && x.checked) { + return; + } + App.callsController.pushObject(App.Call.create(channel)); } else if (data["Event-Name"] == "CHANNEL_HANGUP_COMPLETE") { App.channelsController.delete(data["Unique-ID"]); + + var x = $('#auto_update_calls')[0]; + if (typeof x != "undefined" && x.checked) { + return; + } + App.callsController.delete(data["Unique-ID"]); } else if (data["Event-Name"] == "CHANNEL_BRIDGE") { + var x = $('#auto_update_calls')[0]; + if (typeof x != "undefined" && x.checked) { + return; + } + App.callsController.delete(data["Unique-ID"]); App.callsController.delete(data["Other-Leg-Unique-ID"]);