surflion-service 1.3.9 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/surflion.js +11 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "surflion-service",
3
- "version": "1.3.9",
3
+ "version": "1.4.0",
4
4
  "description": "",
5
5
  "main": "surflion.js",
6
6
  "scripts": {
package/surflion.js CHANGED
@@ -1356,13 +1356,15 @@ var SurfLion = {
1356
1356
  const events = new Event('localStorageSurflionCalling');
1357
1357
  window.dispatchEvent(events);
1358
1358
  let callInfo = {
1359
- CallNumber : e.request.from._uri._user
1359
+ CallNumber : e.request.from._display_name
1360
1360
  }
1361
- if(SurfLion.ext_num == e.request.from._uri._user) {
1361
+
1362
+
1363
+ if(SurfLion.ext_num == e.request.from._display_name) {
1362
1364
  SurfLion.endReason = 'Cannot call oneself '
1363
1365
  SurfLion.sipHangUp()
1364
1366
  } else {
1365
- SurfLion.showPhoneNumber = e.request.from._uri._user
1367
+ SurfLion.showPhoneNumber = e.request.from._display_name
1366
1368
  SurfLion.onCallIn(callInfo)
1367
1369
  SurfLion.createVAnswer(callInfo)
1368
1370
  }
@@ -1486,7 +1488,6 @@ var SurfLion = {
1486
1488
  iceServers: [],
1487
1489
  contact_uri: sip_uri_ + ';transport=wss'
1488
1490
  };
1489
- console.log(';transport=ws')
1490
1491
 
1491
1492
  function createDialerButton(digit) {
1492
1493
  const button = document.createElement('button');
@@ -1516,6 +1517,7 @@ var SurfLion = {
1516
1517
  SurfLion.eventHandlers.registered_expiring(data)
1517
1518
  });
1518
1519
  SurfLion.userAgent.on('newRTCSession', function (data) {
1520
+
1519
1521
  if (data.originator == 'remote') {
1520
1522
  if (!SurfLion.canIncoming){
1521
1523
  return
@@ -1639,6 +1641,11 @@ var SurfLion = {
1639
1641
  if (SurfLion.currentSession && SurfLion.currentSession.isEnded() === false) {
1640
1642
  SurfLion.currentSession.terminate();
1641
1643
  }
1644
+ setTimeout(()=>{
1645
+ const endEvent = new Event('SurflionPhoneEnd');
1646
+ window.dispatchEvent(endEvent);
1647
+ },100)
1648
+
1642
1649
  SurfLion.currentSession = null;
1643
1650
 
1644
1651
  },
@@ -1796,10 +1803,6 @@ var SurfLion = {
1796
1803
  window.dispatchEvent(event);
1797
1804
  }
1798
1805
  if (event.data == "connectselect") {
1799
- console.log(
1800
- 'window.localStorage.getItem("surflion_registered")',
1801
- window.localStorage.getItem("surflion_registered")
1802
- );
1803
1806
  if (window.localStorage.getItem("surflion_registered") == "3") {
1804
1807
  return;
1805
1808
  } else {
@@ -1834,7 +1837,6 @@ var SurfLion = {
1834
1837
  },
1835
1838
 
1836
1839
  visibilityListen: function(address) {
1837
- console.log('address', address, !document.hidden);
1838
1840
  if (!document.hidden) {
1839
1841
  setTimeout(() => {
1840
1842
  const port = SurfLion.worker.port;