|
@@ -152,7 +152,12 @@
|
|
|
},
|
|
|
hangUp: function() {
|
|
|
if(this.otSession) {
|
|
|
- this.otSession.disconnect();
|
|
|
+ try {
|
|
|
+ this.otSession.disconnect();
|
|
|
+ }
|
|
|
+ catch (e) {
|
|
|
+ console.log('Was already disconnected.');
|
|
|
+ }
|
|
|
this.otSession = false;
|
|
|
this.otSessionId = '';
|
|
|
this.started = false;
|
|
@@ -288,22 +293,28 @@
|
|
|
|
|
|
self.activateParty('self');
|
|
|
|
|
|
+ @if(!$guest)
|
|
|
+ if(event.target.connection.data.split('|')[1] === 'CLIENT') {
|
|
|
+ self.hangUp();
|
|
|
+ }
|
|
|
+ @endif
|
|
|
+
|
|
|
var remoteViewElem = $('[data-stream="' + event.stream.id + '"]');
|
|
|
if(remoteViewElem.length) {
|
|
|
remoteViewElem.attr('data-stream', '');
|
|
|
remoteViewElem.attr('data-from', '');
|
|
|
}
|
|
|
-
|
|
|
@if($guest)
|
|
|
- self.pro = false;
|
|
|
+ self.pro = false;
|
|
|
@else
|
|
|
- self.client = false;
|
|
|
+ self.client = false;
|
|
|
@endif
|
|
|
|
|
|
// if no other parties in call, hang up
|
|
|
if(!$('[data-stream]:not([data-stream=""])').length) {
|
|
|
self.hangUp();
|
|
|
}
|
|
|
+
|
|
|
});
|
|
|
|
|
|
// self connected
|