@absolutejs/voice 0.0.22-beta.541 → 0.0.22-beta.542

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/dist/index.js CHANGED
@@ -24261,6 +24261,7 @@ var createTwilioMediaStreamBridge = (socket, options) => {
24261
24261
  audioConditioning,
24262
24262
  context: options.context,
24263
24263
  costTelemetry: options.costTelemetry,
24264
+ greeting: options.greeting,
24264
24265
  id: bridgeState.sessionId,
24265
24266
  languageStrategy: options.languageStrategy,
24266
24267
  lexicon,
@@ -24277,6 +24278,7 @@ var createTwilioMediaStreamBridge = (socket, options) => {
24277
24278
  tts: options.tts,
24278
24279
  turnDetection
24279
24280
  });
24281
+ await sessionHandle.connect(voiceSocket);
24280
24282
  return sessionHandle;
24281
24283
  };
24282
24284
  return {
@@ -24429,12 +24431,14 @@ var createTwilioVoiceRoutes = (options) => {
24429
24431
  });
24430
24432
  }).ws(streamPath, {
24431
24433
  close: async (ws, _code, reason) => {
24432
- const bridge = bridges.get(ws);
24433
- bridges.delete(ws);
24434
+ const key = ws.raw ?? ws;
24435
+ const bridge = bridges.get(key);
24436
+ bridges.delete(key);
24434
24437
  await bridge?.close(reason);
24435
24438
  },
24436
24439
  message: async (ws, raw) => {
24437
- let bridge = bridges.get(ws);
24440
+ const key = ws.raw ?? ws;
24441
+ let bridge = bridges.get(key);
24438
24442
  if (!bridge) {
24439
24443
  bridge = createTwilioMediaStreamBridge({
24440
24444
  close: (code, reason) => {
@@ -24444,7 +24448,7 @@ var createTwilioVoiceRoutes = (options) => {
24444
24448
  ws.send(data);
24445
24449
  }
24446
24450
  }, options);
24447
- bridges.set(ws, bridge);
24451
+ bridges.set(key, bridge);
24448
24452
  }
24449
24453
  await bridge.handleMessage(raw);
24450
24454
  }
@@ -25088,8 +25092,9 @@ var createPlivoVoiceRoutes = (options = {}) => {
25088
25092
  });
25089
25093
  }).ws(streamPath, {
25090
25094
  close: async (ws, _code, reason) => {
25091
- const bridge = bridges.get(ws);
25092
- bridges.delete(ws);
25095
+ const key = ws.raw ?? ws;
25096
+ const bridge = bridges.get(key);
25097
+ bridges.delete(key);
25093
25098
  await bridge?.close(reason);
25094
25099
  },
25095
25100
  message: async (ws, raw) => {
@@ -25097,7 +25102,8 @@ var createPlivoVoiceRoutes = (options = {}) => {
25097
25102
  ws.close(1011, "Plivo media bridge is not configured.");
25098
25103
  return;
25099
25104
  }
25100
- let bridge = bridges.get(ws);
25105
+ const key = ws.raw ?? ws;
25106
+ let bridge = bridges.get(key);
25101
25107
  if (!bridge) {
25102
25108
  bridge = createPlivoMediaStreamBridge({
25103
25109
  close: (code, reason) => {
@@ -25107,7 +25113,7 @@ var createPlivoVoiceRoutes = (options = {}) => {
25107
25113
  ws.send(data);
25108
25114
  }
25109
25115
  }, options.bridge);
25110
- bridges.set(ws, bridge);
25116
+ bridges.set(key, bridge);
25111
25117
  }
25112
25118
  await bridge.handleMessage(raw);
25113
25119
  }
@@ -25702,8 +25708,9 @@ var createTelnyxVoiceRoutes = (options = {}) => {
25702
25708
  });
25703
25709
  }).ws(streamPath, {
25704
25710
  close: async (ws, _code, reason) => {
25705
- const bridge = bridges.get(ws);
25706
- bridges.delete(ws);
25711
+ const key = ws.raw ?? ws;
25712
+ const bridge = bridges.get(key);
25713
+ bridges.delete(key);
25707
25714
  await bridge?.close(reason);
25708
25715
  },
25709
25716
  message: async (ws, raw) => {
@@ -25711,7 +25718,8 @@ var createTelnyxVoiceRoutes = (options = {}) => {
25711
25718
  ws.close(1011, "Telnyx media bridge is not configured.");
25712
25719
  return;
25713
25720
  }
25714
- let bridge = bridges.get(ws);
25721
+ const key = ws.raw ?? ws;
25722
+ let bridge = bridges.get(key);
25715
25723
  if (!bridge) {
25716
25724
  bridge = createTelnyxMediaStreamBridge({
25717
25725
  close: (code, reason) => {
@@ -25721,7 +25729,7 @@ var createTelnyxVoiceRoutes = (options = {}) => {
25721
25729
  ws.send(data);
25722
25730
  }
25723
25731
  }, options.bridge);
25724
- bridges.set(ws, bridge);
25732
+ bridges.set(key, bridge);
25725
25733
  }
25726
25734
  await bridge.handleMessage(raw);
25727
25735
  }
@@ -12939,6 +12939,7 @@ var createTwilioMediaStreamBridge = (socket, options) => {
12939
12939
  audioConditioning,
12940
12940
  context: options.context,
12941
12941
  costTelemetry: options.costTelemetry,
12942
+ greeting: options.greeting,
12942
12943
  id: bridgeState.sessionId,
12943
12944
  languageStrategy: options.languageStrategy,
12944
12945
  lexicon,
@@ -12955,6 +12956,7 @@ var createTwilioMediaStreamBridge = (socket, options) => {
12955
12956
  tts: options.tts,
12956
12957
  turnDetection
12957
12958
  });
12959
+ await sessionHandle.connect(voiceSocket);
12958
12960
  return sessionHandle;
12959
12961
  };
12960
12962
  return {
@@ -13107,12 +13109,14 @@ var createTwilioVoiceRoutes = (options) => {
13107
13109
  });
13108
13110
  }).ws(streamPath, {
13109
13111
  close: async (ws, _code, reason) => {
13110
- const bridge = bridges.get(ws);
13111
- bridges.delete(ws);
13112
+ const key = ws.raw ?? ws;
13113
+ const bridge = bridges.get(key);
13114
+ bridges.delete(key);
13112
13115
  await bridge?.close(reason);
13113
13116
  },
13114
13117
  message: async (ws, raw) => {
13115
- let bridge = bridges.get(ws);
13118
+ const key = ws.raw ?? ws;
13119
+ let bridge = bridges.get(key);
13116
13120
  if (!bridge) {
13117
13121
  bridge = createTwilioMediaStreamBridge({
13118
13122
  close: (code, reason) => {
@@ -13122,7 +13126,7 @@ var createTwilioVoiceRoutes = (options) => {
13122
13126
  ws.send(data);
13123
13127
  }
13124
13128
  }, options);
13125
- bridges.set(ws, bridge);
13129
+ bridges.set(key, bridge);
13126
13130
  }
13127
13131
  await bridge.handleMessage(raw);
13128
13132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.541",
3
+ "version": "0.0.22-beta.542",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",