]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Oops, we already have auto_update with pulling
authorSeven Du <dujinfang@gmail.com>
Mon, 29 Jul 2013 18:18:14 +0000 (02:18 +0800)
committerSeven Du <dujinfang@gmail.com>
Mon, 29 Jul 2013 18:18:48 +0000 (02:18 +0800)
Only use events to update calls when not pulling

htdocs/portal/assets/js/fsportal.js

index 4738f9014316065387eeaba743337dcf38855fc3..ab9930684639bdf6dbacb56c02ffb046f68fcb86 100644 (file)
@@ -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"]);