opensips-js-vue 0.1.26 → 0.1.27

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/library/super.mjs CHANGED
@@ -23547,7 +23547,7 @@ class YI {
23547
23547
  output: "default"
23548
23548
  }, this.callStatus = {}, this.callTime = {}, this.callMetrics = {}, this.timeIntervals = {}, this.metricConfig = {
23549
23549
  refreshEvery: 1e3
23550
- }, this.activeStreamValue = null, this.initialStreamValue = null, this.vadSessions = {}, this.vadSessionsState = {}, this.vadIntervals = {}, this.vadMrsIntervals = {}, this.ringbackTimers = {}, this.ringbackAudioContexts = {}, this.ringbackSessionProgressReceived = {}, this.managedAudioContext = new WI(), this.context = n, this.context.on(
23550
+ }, this.activeStreamValue = null, this.initialStreamValue = null, this.vadSessions = {}, this.vadSessionsState = {}, this.vadIntervals = {}, this.vadMrsIntervals = {}, this.ringbackTimers = {}, this.ringbackAudioContexts = {}, this.ringbackSessionProgressReceived = {}, this.hangupBeepContext = null, this.managedAudioContext = new WI(), this.context = n, this.context.on(
23551
23551
  this.context.newRTCSessionEventName,
23552
23552
  this.newRTCSessionCallback.bind(this)
23553
23553
  ), this.VUMeter = new GI({
@@ -24454,6 +24454,35 @@ class YI {
24454
24454
  cleanupRingbackTone(n) {
24455
24455
  this.ringbackTimers[n] && (clearTimeout(this.ringbackTimers[n]), delete this.ringbackTimers[n]), this.stopLocalRingbackTone(n), delete this.ringbackSessionProgressReceived[n];
24456
24456
  }
24457
+ /**
24458
+ * Play a hangup beep sound when a call is terminated
24459
+ * Standard hangup beep: single tone, short duration (~200ms)
24460
+ */
24461
+ async playHangupBeep() {
24462
+ var n, r;
24463
+ if (!this.hangupBeepContext)
24464
+ try {
24465
+ const a = await this.managedAudioContext.getContext(), c = a.createOscillator(), e = a.createGain();
24466
+ c.frequency.value = 800, c.type = "sine", e.gain.value = 0, c.connect(e), e.connect(a.destination), this.hangupBeepContext = {
24467
+ context: a,
24468
+ oscillator: c,
24469
+ gainNode: e
24470
+ }, c.start();
24471
+ const _ = a.currentTime;
24472
+ e.gain.setValueAtTime(0, _), e.gain.linearRampToValueAtTime(0.3, _ + 0.01), e.gain.setValueAtTime(0.3, _ + 0.15), e.gain.linearRampToValueAtTime(0, _ + 0.2), c.stop(_ + 0.2), setTimeout(() => {
24473
+ if (this.hangupBeepContext) {
24474
+ try {
24475
+ this.hangupBeepContext.oscillator && this.hangupBeepContext.oscillator.disconnect(), this.hangupBeepContext.gainNode && this.hangupBeepContext.gainNode.disconnect();
24476
+ } catch (v) {
24477
+ console.error("[playHangupBeep] Cleanup playing hangup beep error:", v);
24478
+ }
24479
+ this.hangupBeepContext = null;
24480
+ }
24481
+ }, 250), (n = this.context.logger) == null || n.log("[playHangupBeep] Played hangup beep");
24482
+ } catch (a) {
24483
+ (r = this.context.logger) == null || r.error("[playHangupBeep] Error playing hangup beep:", a), console.error("[playHangupBeep] Error playing hangup beep:", a), this.hangupBeepContext = null;
24484
+ }
24485
+ }
24457
24486
  transferCall(n, r) {
24458
24487
  if (r.toString().length === 0)
24459
24488
  return new Error("Target must be passed");
@@ -24657,7 +24686,7 @@ class YI {
24657
24686
  listenerType: es.CALL_ENDED,
24658
24687
  session: r,
24659
24688
  event: c
24660
- }), r.connection) {
24689
+ }), r._is_confirmed && this.playHangupBeep(), r.connection) {
24661
24690
  const C = r.connection.connectionState;
24662
24691
  (C === "closed" || C === "disconnected") && this.context.emit("connectionStateChange", {
24663
24692
  session: r,