@telegenta/webclient 3.4.0 → 3.4.1

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.
package/README.md CHANGED
@@ -50,7 +50,8 @@ remembered there, so you will be prompted for the microphone every time.
50
50
  #### Example: phone with a provisioning token
51
51
 
52
52
  `demos/phone_client.html` is a complete softphone - start/stop, outbound calls, transfer, listen-in,
53
- incoming calls and the event client.
53
+ incoming calls and the event client. A hosted copy is published with the docs:
54
+ https://www.telegenta.com/docs/webclient/latest/demos/phone_client.html
54
55
 
55
56
  First create a static API token in the admin interface
56
57
  (https://admin.telegenta.com/integration/access-tokens). Open the demo and paste the token in; it then
@@ -116,7 +116,10 @@
116
116
 
117
117
  <!-- Javascript stuff -->
118
118
  <script>
119
- const API_URL = 'https://api.telegenta.com/api';
119
+ // The demo is published with the docs on both www.telegenta.com and www.telegenta-test.com
120
+ const API_URL = location.hostname.endsWith('telegenta-test.com')
121
+ ? 'https://api.telegenta-test.com/api'
122
+ : 'https://api.telegenta.com/api';
120
123
  let phoneClient = null;
121
124
  let logger;
122
125
  let transferSession;
package/dist/telegenta.js CHANGED
@@ -2621,6 +2621,7 @@ class Session extends EventEmitter {
2621
2621
  this._whisperMode = null;
2622
2622
  this._manualDisposition = null;
2623
2623
  this._transferInitiated = false;
2624
+ this._voicemailDrop = false;
2624
2625
 
2625
2626
  // Quality report
2626
2627
  this._rtcpStatsTimer = null;
@@ -2894,7 +2895,8 @@ class Session extends EventEmitter {
2894
2895
  // jssip fires 'ended' once a call is answered. Its own errors (connection loss, timeouts, ICE failure)
2895
2896
  // also end as 'local' but with their own cause, so only a local BYE is the agent hanging up.
2896
2897
  const agentHangup = data.originator === 'local' && data.cause === JsSIP.C.causes.BYE;
2897
- if (self._phone.options.playCallEndedTone && !agentHangup && !self._transferInitiated) {
2898
+ const agentEnded = agentHangup || self._transferInitiated || self._voicemailDrop;
2899
+ if (self._phone.options.playCallEndedTone && !agentEnded) {
2898
2900
  self._phone._playToneSequence(ST_CALLENDED);
2899
2901
  }
2900
2902
 
@@ -3396,6 +3398,9 @@ class Session extends EventEmitter {
3396
3398
 
3397
3399
  // When playback is acknowledged and 'hangup_after' is true, we set session state into PLAYBACK
3398
3400
  if (hangup_after) {
3401
+ // The server hangs up after the voicemail drop - that's the agent's doing, no call-ended tone
3402
+ this._voicemailDrop = true;
3403
+
3399
3404
  // Stop remote audio
3400
3405
  this._phone._remoteAudioElement.srcObject = null;
3401
3406
 
@@ -3403,10 +3408,16 @@ class Session extends EventEmitter {
3403
3408
  this._webRTCSession.mute();
3404
3409
 
3405
3410
  // When playback starts set state to playback
3406
- p.then(() => {
3407
- // Set session state
3408
- this._setSessionState('PLAYBACK');
3409
- });
3411
+ p.then(
3412
+ () => {
3413
+ // Set session state
3414
+ this._setSessionState('PLAYBACK');
3415
+ },
3416
+ () => {
3417
+ // Call stays up, so a later hangup by the other party should get the cue
3418
+ this._voicemailDrop = false;
3419
+ }
3420
+ );
3410
3421
  }
3411
3422
 
3412
3423
  return p;