surflion-service 1.1.5 → 1.1.7

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 +6 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "surflion-service",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "",
5
5
  "main": "surflion.js",
6
6
  "scripts": {
package/surflion.js CHANGED
@@ -1476,7 +1476,6 @@ var SurfLion = {
1476
1476
  SurfLion.eventHandlers.registered_expiring(data)
1477
1477
  });
1478
1478
  SurfLion.userAgent.on('newRTCSession', function (data) {
1479
- console.log('data', data)
1480
1479
  if (data.originator == 'remote') {
1481
1480
  if (!SurfLion.canIncoming){
1482
1481
  return
@@ -1487,7 +1486,7 @@ var SurfLion = {
1487
1486
  }
1488
1487
  SurfLion.incomingSession = data.session;
1489
1488
  SurfLion.eventHandlers.incoming(data)
1490
- // SurfLion.ringtoneStream.play();
1489
+ SurfLion.ringtoneStream.play();
1491
1490
  } else {
1492
1491
  SurfLion.outgoingSession = data.session;
1493
1492
  SurfLion.outgoingSession.on('connecting', function (data) {
@@ -1498,15 +1497,13 @@ var SurfLion = {
1498
1497
  });
1499
1498
  }
1500
1499
  data.session.on('accepted', function (data) {
1501
- console.log('accepted');
1502
1500
  if (data.originator == 'remote' && SurfLion.currentSession == null) {
1503
1501
  SurfLion.currentSession = SurfLion.incomingSession;
1504
1502
  SurfLion.incomingSession = null;
1505
1503
  }
1506
1504
  });
1507
1505
  data.session.on('confirmed', function (c_data) {
1508
- console.log('confirmed');
1509
- // SurfLion.ringtoneStream.pause();
1506
+ SurfLion.ringtoneStream.pause();
1510
1507
  SurfLion.eventHandlers.confirmed(c_data)
1511
1508
  if (c_data.originator == 'remote' && SurfLion.currentSession == null) {
1512
1509
  SurfLion.currentSession = SurfLion.incomingSession;
@@ -1522,18 +1519,15 @@ var SurfLion = {
1522
1519
  SurfLion.localStream.play();
1523
1520
  });
1524
1521
  data.session.on("failed", function (data) {
1525
- console.log('failed');
1526
- // SurfLion.ringtoneStream.pause();
1522
+ SurfLion.ringtoneStream.pause();
1527
1523
  SurfLion.incomingSession = null;
1528
1524
  SurfLion.eventHandlers.ended(data)
1529
1525
  })
1530
1526
  data.session.on("ended", function (data) {
1531
- console.log('ended');
1532
- // SurfLion.ringtoneStream.pause();
1527
+ SurfLion.ringtoneStream.pause();
1533
1528
  SurfLion.eventHandlers.ended(data)
1534
1529
  })
1535
- data.session.on('sdp', function (data) {
1536
- console.log('sdp');
1530
+ data.session.on('sdp', function (e) {
1537
1531
  const stream = new MediaStream();
1538
1532
  const receivers = data.session.connection?.getReceivers();
1539
1533
  if (receivers) {
@@ -1542,22 +1536,10 @@ var SurfLion = {
1542
1536
  SurfLion.localStream.srcObject = stream;
1543
1537
  SurfLion.localStream.play();
1544
1538
  if (SurfLion.debug) {
1545
- console.info('onSDP, type - ', data.type, ' sdp - ', data.sdp);
1539
+ console.info('onSDP, type - ', e.type, ' sdp - ', e.sdp);
1546
1540
  }
1547
1541
  });
1548
1542
 
1549
- data.session.on('peerconnection', function (e) {
1550
- console.log('peer connection');
1551
-
1552
- e.peerconnection.addEventListener('track', function(event) {
1553
- console.log('onaddstream');
1554
- SurfLion.ringtoneStream.loop = false;
1555
- SurfLion.ringtoneStream.src = null
1556
- SurfLion.ringtoneStream.srcObject = event.streams[0];
1557
- SurfLion.ringtoneStream.srcObject.play();
1558
- });
1559
- });
1560
-
1561
1543
  data.session.on('progress', function (data) {
1562
1544
  });
1563
1545
  });
@@ -1577,7 +1559,6 @@ var SurfLion = {
1577
1559
  SurfLion.userAgent.stop();
1578
1560
  },
1579
1561
  sipCall: function (sip_phone_number_) {
1580
- console.log('sip_phone_number_', sip_phone_number_)
1581
1562
  if(sip_phone_number_ == 'Please input number') return
1582
1563
  if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
1583
1564
  navigator.mediaDevices.getUserMedia({ audio: true })