@memberjunction/telephony-adapters 6.2.0-edge.2 → 6.2.0-edge.3
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.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/resolvers/LiveKitSipResolver.d.ts +21 -0
- package/dist/resolvers/LiveKitSipResolver.d.ts.map +1 -0
- package/dist/resolvers/LiveKitSipResolver.js +87 -0
- package/dist/resolvers/LiveKitSipResolver.js.map +1 -0
- package/dist/resolvers/RingCentralTelephonyResolver.d.ts.map +1 -1
- package/dist/resolvers/RingCentralTelephonyResolver.js +4 -1
- package/dist/resolvers/RingCentralTelephonyResolver.js.map +1 -1
- package/dist/resolvers/TelephonyResolver.d.ts.map +1 -1
- package/dist/resolvers/TelephonyResolver.js +4 -1
- package/dist/resolvers/TelephonyResolver.js.map +1 -1
- package/dist/resolvers/VonageTelephonyResolver.d.ts.map +1 -1
- package/dist/resolvers/VonageTelephonyResolver.js +4 -1
- package/dist/resolvers/VonageTelephonyResolver.js.map +1 -1
- package/dist/resolvers/index.d.ts +1 -0
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +1 -0
- package/dist/resolvers/index.js.map +1 -1
- package/dist/server-extensions/LiveKitSipExtension.d.ts +14 -0
- package/dist/server-extensions/LiveKitSipExtension.d.ts.map +1 -0
- package/dist/server-extensions/LiveKitSipExtension.js +93 -0
- package/dist/server-extensions/LiveKitSipExtension.js.map +1 -0
- package/dist/server-extensions/RingCentralTelephonyExtension.d.ts.map +1 -1
- package/dist/server-extensions/RingCentralTelephonyExtension.js +8 -2
- package/dist/server-extensions/RingCentralTelephonyExtension.js.map +1 -1
- package/dist/server-extensions/TwilioTelephonyExtension.d.ts.map +1 -1
- package/dist/server-extensions/TwilioTelephonyExtension.js +10 -4
- package/dist/server-extensions/TwilioTelephonyExtension.js.map +1 -1
- package/dist/server-extensions/VonageTelephonyExtension.d.ts.map +1 -1
- package/dist/server-extensions/VonageTelephonyExtension.js +8 -4
- package/dist/server-extensions/VonageTelephonyExtension.js.map +1 -1
- package/dist/telephony/LiveKitSipRouter.d.ts +26 -0
- package/dist/telephony/LiveKitSipRouter.d.ts.map +1 -0
- package/dist/telephony/LiveKitSipRouter.js +62 -0
- package/dist/telephony/LiveKitSipRouter.js.map +1 -0
- package/dist/telephony/LiveKitSipTelephonyService.d.ts +130 -0
- package/dist/telephony/LiveKitSipTelephonyService.d.ts.map +1 -0
- package/dist/telephony/LiveKitSipTelephonyService.js +453 -0
- package/dist/telephony/LiveKitSipTelephonyService.js.map +1 -0
- package/dist/telephony/RingCentralTelephonyService.d.ts +57 -8
- package/dist/telephony/RingCentralTelephonyService.d.ts.map +1 -1
- package/dist/telephony/RingCentralTelephonyService.js +137 -77
- package/dist/telephony/RingCentralTelephonyService.js.map +1 -1
- package/dist/telephony/TwilioTelephonyRouter.d.ts +36 -6
- package/dist/telephony/TwilioTelephonyRouter.d.ts.map +1 -1
- package/dist/telephony/TwilioTelephonyRouter.js +150 -54
- package/dist/telephony/TwilioTelephonyRouter.js.map +1 -1
- package/dist/telephony/TwilioTelephonyService.d.ts +64 -16
- package/dist/telephony/TwilioTelephonyService.d.ts.map +1 -1
- package/dist/telephony/TwilioTelephonyService.js +151 -77
- package/dist/telephony/TwilioTelephonyService.js.map +1 -1
- package/dist/telephony/VonageTelephonyRouter.d.ts +29 -1
- package/dist/telephony/VonageTelephonyRouter.d.ts.map +1 -1
- package/dist/telephony/VonageTelephonyRouter.js +84 -72
- package/dist/telephony/VonageTelephonyRouter.js.map +1 -1
- package/dist/telephony/VonageTelephonyService.d.ts +66 -8
- package/dist/telephony/VonageTelephonyService.d.ts.map +1 -1
- package/dist/telephony/VonageTelephonyService.js +152 -67
- package/dist/telephony/VonageTelephonyService.js.map +1 -1
- package/dist/telephony/agentIdentityLookup.d.ts +30 -0
- package/dist/telephony/agentIdentityLookup.d.ts.map +1 -0
- package/dist/telephony/agentIdentityLookup.js +129 -0
- package/dist/telephony/agentIdentityLookup.js.map +1 -0
- package/dist/telephony/callEndObserver.d.ts +47 -0
- package/dist/telephony/callEndObserver.d.ts.map +1 -0
- package/dist/telephony/callEndObserver.js +95 -0
- package/dist/telephony/callEndObserver.js.map +1 -0
- package/dist/telephony/callLifecycleTracker.d.ts +83 -0
- package/dist/telephony/callLifecycleTracker.d.ts.map +1 -0
- package/dist/telephony/callLifecycleTracker.js +155 -0
- package/dist/telephony/callLifecycleTracker.js.map +1 -0
- package/dist/telephony/callerIdentity.d.ts +65 -0
- package/dist/telephony/callerIdentity.d.ts.map +1 -0
- package/dist/telephony/callerIdentity.js +72 -0
- package/dist/telephony/callerIdentity.js.map +1 -0
- package/dist/telephony/handoffDestinations.d.ts +57 -0
- package/dist/telephony/handoffDestinations.d.ts.map +1 -0
- package/dist/telephony/handoffDestinations.js +78 -0
- package/dist/telephony/handoffDestinations.js.map +1 -0
- package/dist/telephony/index.d.ts +21 -0
- package/dist/telephony/index.d.ts.map +1 -1
- package/dist/telephony/index.js +23 -0
- package/dist/telephony/index.js.map +1 -1
- package/dist/telephony/interactionLifecycle.d.ts +100 -0
- package/dist/telephony/interactionLifecycle.d.ts.map +1 -0
- package/dist/telephony/interactionLifecycle.js +338 -0
- package/dist/telephony/interactionLifecycle.js.map +1 -0
- package/dist/telephony/livekit-sip-runtime.d.ts +12 -0
- package/dist/telephony/livekit-sip-runtime.d.ts.map +1 -0
- package/dist/telephony/livekit-sip-runtime.js +21 -0
- package/dist/telephony/livekit-sip-runtime.js.map +1 -0
- package/dist/telephony/mediaSocketAuth.d.ts +77 -0
- package/dist/telephony/mediaSocketAuth.d.ts.map +1 -0
- package/dist/telephony/mediaSocketAuth.js +136 -0
- package/dist/telephony/mediaSocketAuth.js.map +1 -0
- package/dist/telephony/numberPoolSelector.d.ts +62 -0
- package/dist/telephony/numberPoolSelector.d.ts.map +1 -0
- package/dist/telephony/numberPoolSelector.js +201 -0
- package/dist/telephony/numberPoolSelector.js.map +1 -0
- package/dist/telephony/outboundCallPolicy.d.ts +226 -0
- package/dist/telephony/outboundCallPolicy.d.ts.map +1 -0
- package/dist/telephony/outboundCallPolicy.js +364 -0
- package/dist/telephony/outboundCallPolicy.js.map +1 -0
- package/dist/telephony/roomCallSession.d.ts +136 -0
- package/dist/telephony/roomCallSession.d.ts.map +1 -0
- package/dist/telephony/roomCallSession.js +359 -0
- package/dist/telephony/roomCallSession.js.map +1 -0
- package/dist/telephony/roomCallTools.d.ts +99 -0
- package/dist/telephony/roomCallTools.d.ts.map +1 -0
- package/dist/telephony/roomCallTools.js +255 -0
- package/dist/telephony/roomCallTools.js.map +1 -0
- package/dist/telephony/runAsIdentity.d.ts +62 -0
- package/dist/telephony/runAsIdentity.d.ts.map +1 -0
- package/dist/telephony/runAsIdentity.js +89 -0
- package/dist/telephony/runAsIdentity.js.map +1 -0
- package/dist/telephony/sipTrunkCarrier.d.ts +100 -0
- package/dist/telephony/sipTrunkCarrier.d.ts.map +1 -0
- package/dist/telephony/sipTrunkCarrier.js +118 -0
- package/dist/telephony/sipTrunkCarrier.js.map +1 -0
- package/dist/telephony/teamsAcsMediaRegistry.d.ts.map +1 -1
- package/dist/telephony/teamsAcsMediaRegistry.js +3 -2
- package/dist/telephony/teamsAcsMediaRegistry.js.map +1 -1
- package/dist/telephony/telephonyCallSession.d.ts +130 -0
- package/dist/telephony/telephonyCallSession.d.ts.map +1 -0
- package/dist/telephony/telephonyCallSession.js +315 -0
- package/dist/telephony/telephonyCallSession.js.map +1 -0
- package/dist/telephony/telephonyCallTools.d.ts +112 -0
- package/dist/telephony/telephonyCallTools.d.ts.map +1 -0
- package/dist/telephony/telephonyCallTools.js +269 -0
- package/dist/telephony/telephonyCallTools.js.map +1 -0
- package/dist/telephony/telephonyCapacity.d.ts +63 -0
- package/dist/telephony/telephonyCapacity.d.ts.map +1 -0
- package/dist/telephony/telephonyCapacity.js +94 -0
- package/dist/telephony/telephonyCapacity.js.map +1 -0
- package/dist/telephony/telephonySettings.d.ts +40 -0
- package/dist/telephony/telephonySettings.d.ts.map +1 -0
- package/dist/telephony/telephonySettings.js +69 -0
- package/dist/telephony/telephonySettings.js.map +1 -0
- package/dist/telephony/twilioMediaRegistry.d.ts +83 -11
- package/dist/telephony/twilioMediaRegistry.d.ts.map +1 -1
- package/dist/telephony/twilioMediaRegistry.js +145 -22
- package/dist/telephony/twilioMediaRegistry.js.map +1 -1
- package/dist/telephony/vonageMediaRegistry.d.ts +96 -2
- package/dist/telephony/vonageMediaRegistry.d.ts.map +1 -1
- package/dist/telephony/vonageMediaRegistry.js +227 -26
- package/dist/telephony/vonageMediaRegistry.js.map +1 -1
- package/dist/telephony/webhookParams.d.ts +21 -0
- package/dist/telephony/webhookParams.d.ts.map +1 -0
- package/dist/telephony/webhookParams.js +45 -0
- package/dist/telephony/webhookParams.js.map +1 -0
- package/dist/types.d.ts +90 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +16 -13
|
@@ -1,27 +1,123 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Per-call WebSocket-media pump registry for the Vonage telephony ingress.
|
|
3
3
|
*
|
|
4
|
+
* Mirrors the Twilio registry's contract (see `twilioMediaRegistry.ts`): sockets are authenticated against a
|
|
5
|
+
* per-call token MJ registered, never replace an attached socket, never create state for an unregistered
|
|
6
|
+
* call, and both pre-attach / pre-handler buffers are bounded.
|
|
7
|
+
*
|
|
8
|
+
* **Vonage-specific: outbound correlation.** An outbound call's UUID is not known until `createCall`
|
|
9
|
+
* resolves, yet Vonage may open the media websocket before that response is processed. So an outbound call is
|
|
10
|
+
* first registered under a **correlation id** carried in the websocket URI (`mj_cid`); once the UUID is known
|
|
11
|
+
* ({@link BindOutboundCall}) the correlation id becomes an alias of it and the channel — socket, buffers and
|
|
12
|
+
* all — moves under the UUID. Every method accepts either id.
|
|
13
|
+
*
|
|
4
14
|
* @module @memberjunction/telephony-adapters
|
|
5
15
|
*/
|
|
16
|
+
import { LogError, LogStatus } from '@memberjunction/core';
|
|
17
|
+
import { ExpectedCallStore } from './mediaSocketAuth.js';
|
|
6
18
|
/**
|
|
7
19
|
* The exact byte size of one outbound audio frame Vonage expects on the `audio/l16;rate=8000` leg: a
|
|
8
20
|
* 20 ms slice = 8000 Hz × 0.020 s = 160 samples × 2 bytes = **320 bytes**.
|
|
9
21
|
*/
|
|
10
22
|
const OUTBOUND_FRAME_BYTES = 320;
|
|
23
|
+
/** Default outbound pre-attach cap: 500 frames ≈ 10 s of 20 ms audio. */
|
|
24
|
+
const DEFAULT_MAX_OUTBOUND_BUFFER_FRAMES = 500;
|
|
25
|
+
/** Default inbound pre-handler audio cap: 5 s of 8 kHz 16-bit mono PCM (16 000 bytes/s). */
|
|
26
|
+
const DEFAULT_MAX_EARLY_INBOUND_BYTES = 5 * 16_000;
|
|
27
|
+
/** Default inbound pre-handler control-event cap (events are tiny and rare — DTMF, connected, close). */
|
|
28
|
+
const DEFAULT_MAX_EARLY_INBOUND_EVENTS = 50;
|
|
11
29
|
/**
|
|
12
|
-
* Coordinates Vonage media websockets with the bridge bindings, keyed by call UUID
|
|
30
|
+
* Coordinates Vonage media websockets with the bridge bindings, keyed by call UUID (or, for an outbound call
|
|
31
|
+
* whose UUID is not yet known, its correlation id).
|
|
13
32
|
*/
|
|
14
33
|
export class VonageCallMediaRegistry {
|
|
15
|
-
constructor() {
|
|
34
|
+
constructor(options = {}) {
|
|
16
35
|
this.channels = new Map();
|
|
36
|
+
this.aliases = new Map();
|
|
37
|
+
this.maxOutboundBufferFrames = options.MaxOutboundBufferFrames ?? DEFAULT_MAX_OUTBOUND_BUFFER_FRAMES;
|
|
38
|
+
this.maxEarlyInboundBytes = options.MaxEarlyInboundBytes ?? DEFAULT_MAX_EARLY_INBOUND_BYTES;
|
|
39
|
+
this.expected = new ExpectedCallStore((callKey) => this.handleConnectTimeout(callKey), options.ExpectationTtlMs);
|
|
17
40
|
}
|
|
18
41
|
/** Ensures a channel exists for a call (called when a bridge session for the call starts). */
|
|
19
42
|
RegisterCall(callUuid) {
|
|
20
43
|
this.ensureChannel(callUuid);
|
|
21
44
|
}
|
|
45
|
+
// ── Authentication / expectation ────────────────────────────────────────────
|
|
46
|
+
/** Registers an INBOUND call MJ accepted, with the token its media socket must present. */
|
|
47
|
+
ExpectCall(callUuid, token, ttlMs) {
|
|
48
|
+
this.ensureChannel(callUuid);
|
|
49
|
+
this.expected.Expect(callUuid, token, ttlMs);
|
|
50
|
+
this.callRegisteredListener?.(callUuid);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Registers the listener told the moment a call's UUID becomes known to MJ — {@link ExpectCall} for an
|
|
54
|
+
* inbound call, {@link BindOutboundCall} for an outbound one (the instant `createCall` yields the UUID,
|
|
55
|
+
* which is earlier than the bridge session finishing its start). One listener; the latest wins.
|
|
56
|
+
*/
|
|
57
|
+
OnCallRegistered(listener) {
|
|
58
|
+
this.callRegisteredListener = listener;
|
|
59
|
+
}
|
|
60
|
+
/** @inheritdoc — registers an OUTBOUND call under its correlation id, before `createCall` is issued. */
|
|
61
|
+
ExpectOutboundCall(correlationId, token, ttlMs) {
|
|
62
|
+
this.ensureChannel(correlationId);
|
|
63
|
+
this.expected.Expect(correlationId, token, ttlMs);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @inheritdoc — makes the correlation id an alias of the real call UUID and moves the channel (socket,
|
|
67
|
+
* handlers, buffers) under the UUID. Safe whether or not the socket has already connected.
|
|
68
|
+
*/
|
|
69
|
+
BindOutboundCall(correlationId, callUuid) {
|
|
70
|
+
if (correlationId === callUuid) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
this.aliases.set(correlationId, callUuid);
|
|
74
|
+
this.moveChannel(correlationId, callUuid);
|
|
75
|
+
this.expected.Rekey(correlationId, callUuid);
|
|
76
|
+
this.callRegisteredListener?.(callUuid);
|
|
77
|
+
}
|
|
78
|
+
/** @inheritdoc — `createCall` failed: nothing will ever connect, so drop the expectation and channel. */
|
|
79
|
+
AbandonOutboundCall(correlationId) {
|
|
80
|
+
this.EndCall(correlationId);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Registers the listener told when a call's media socket never connected within its TTL — the call has
|
|
84
|
+
* been dropped from the registry and the owner should end the session. One listener; the latest wins.
|
|
85
|
+
* The key passed is the call UUID once known, otherwise the correlation id.
|
|
86
|
+
*/
|
|
87
|
+
OnConnectTimeout(listener) {
|
|
88
|
+
this.connectTimeoutListener = listener;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Authenticates and binds a connected media socket to a call MJ registered. A refused socket is NOT
|
|
92
|
+
* attached and changes no state; the caller closes it.
|
|
93
|
+
*
|
|
94
|
+
* @param ref The id the socket claims (`call_uuid` for inbound, `mj_cid` for outbound).
|
|
95
|
+
* @param token The `mj_token` query param (absent ⇒ refused).
|
|
96
|
+
* @param socket The connected socket.
|
|
97
|
+
* @returns The channel key to dispatch under (`CallKey`), or why the socket was refused.
|
|
98
|
+
*/
|
|
99
|
+
TryAttachSocket(ref, token, socket) {
|
|
100
|
+
const claimed = ref.CallUuid ?? ref.CorrelationId;
|
|
101
|
+
if (!claimed) {
|
|
102
|
+
return { Ok: false, Reason: 'unknown-call' };
|
|
103
|
+
}
|
|
104
|
+
const callKey = this.canon(claimed);
|
|
105
|
+
const verdict = this.expected.Verify(callKey, token);
|
|
106
|
+
const channel = this.channels.get(callKey);
|
|
107
|
+
if (!verdict.Ok) {
|
|
108
|
+
return verdict;
|
|
109
|
+
}
|
|
110
|
+
if (!channel) {
|
|
111
|
+
return { Ok: false, Reason: 'unknown-call' };
|
|
112
|
+
}
|
|
113
|
+
this.expected.MarkAttached(callKey);
|
|
114
|
+
channel.socket = socket;
|
|
115
|
+
this.flushOutbound(channel, socket);
|
|
116
|
+
return { Ok: true, CallKey: callKey };
|
|
117
|
+
}
|
|
22
118
|
// ── IVonageMediaPump ─────────────────────────────────────────────────────────
|
|
23
119
|
SendAudio(callUuid, pcm) {
|
|
24
|
-
const channel = this.ensureChannel(callUuid);
|
|
120
|
+
const channel = this.ensureChannel(this.canon(callUuid));
|
|
25
121
|
const incoming = new Uint8Array(pcm);
|
|
26
122
|
const data = channel.partial.length > 0 ? concatBytes(channel.partial, incoming) : incoming;
|
|
27
123
|
let offset = 0;
|
|
@@ -32,19 +128,29 @@ export class VonageCallMediaRegistry {
|
|
|
32
128
|
channel.socket.sendBinary(frame);
|
|
33
129
|
}
|
|
34
130
|
else {
|
|
35
|
-
|
|
131
|
+
this.bufferOutbound(callUuid, channel, frame);
|
|
36
132
|
}
|
|
37
133
|
}
|
|
38
134
|
channel.partial = offset < data.length ? data.slice(offset) : new Uint8Array(0);
|
|
39
135
|
}
|
|
136
|
+
/** @inheritdoc — also replays inbound audio that arrived before the first handler registered. */
|
|
40
137
|
OnAudio(callUuid, handler) {
|
|
41
|
-
this.ensureChannel(
|
|
138
|
+
const channel = this.ensureChannel(this.canon(callUuid));
|
|
139
|
+
channel.audioHandlers.push(handler);
|
|
140
|
+
for (const pcm of channel.earlyAudio) {
|
|
141
|
+
handler(pcm);
|
|
142
|
+
}
|
|
42
143
|
}
|
|
144
|
+
/** @inheritdoc — also replays control events that arrived before the first handler registered. */
|
|
43
145
|
OnEvent(callUuid, handler) {
|
|
44
|
-
this.ensureChannel(
|
|
146
|
+
const channel = this.ensureChannel(this.canon(callUuid));
|
|
147
|
+
channel.eventHandlers.push(handler);
|
|
148
|
+
for (const event of channel.earlyEvents) {
|
|
149
|
+
handler(event);
|
|
150
|
+
}
|
|
45
151
|
}
|
|
46
152
|
Clear(callUuid) {
|
|
47
|
-
const channel = this.channels.get(callUuid);
|
|
153
|
+
const channel = this.channels.get(this.canon(callUuid));
|
|
48
154
|
if (!channel) {
|
|
49
155
|
return;
|
|
50
156
|
}
|
|
@@ -53,53 +159,148 @@ export class VonageCallMediaRegistry {
|
|
|
53
159
|
channel.socket?.sendText(JSON.stringify({ action: 'clear' }));
|
|
54
160
|
}
|
|
55
161
|
// ── WSS-server side ─────────────────────────────────────────────────────────
|
|
56
|
-
AttachSocket(callUuid, socket) {
|
|
57
|
-
const channel = this.ensureChannel(callUuid);
|
|
58
|
-
channel.socket = socket;
|
|
59
|
-
const buffered = channel.outboundBuffer.splice(0, channel.outboundBuffer.length);
|
|
60
|
-
for (const frame of buffered) {
|
|
61
|
-
socket.sendBinary(frame);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
162
|
DispatchInboundAudio(callUuid, pcm) {
|
|
65
|
-
const
|
|
163
|
+
const key = this.canon(callUuid);
|
|
164
|
+
const channel = this.channels.get(key);
|
|
66
165
|
if (!channel) {
|
|
67
166
|
return;
|
|
68
167
|
}
|
|
168
|
+
if (channel.audioHandlers.length === 0) {
|
|
169
|
+
this.bufferEarlyAudio(key, channel, pcm);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
69
172
|
for (const handler of channel.audioHandlers) {
|
|
70
173
|
handler(pcm);
|
|
71
174
|
}
|
|
72
175
|
}
|
|
73
176
|
DispatchInboundEvent(callUuid, event) {
|
|
74
|
-
const
|
|
177
|
+
const key = this.canon(callUuid);
|
|
178
|
+
const channel = this.channels.get(key);
|
|
75
179
|
if (!channel) {
|
|
76
180
|
return;
|
|
77
181
|
}
|
|
182
|
+
if (channel.eventHandlers.length === 0) {
|
|
183
|
+
if (channel.earlyEvents.length < DEFAULT_MAX_EARLY_INBOUND_EVENTS) {
|
|
184
|
+
channel.earlyEvents.push(event);
|
|
185
|
+
}
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
78
188
|
for (const handler of channel.eventHandlers) {
|
|
79
189
|
handler(event);
|
|
80
190
|
}
|
|
81
191
|
}
|
|
82
192
|
EndCall(callUuid) {
|
|
83
|
-
const
|
|
193
|
+
const key = this.canon(callUuid);
|
|
194
|
+
this.expected.Forget(key);
|
|
195
|
+
const channel = this.channels.get(key);
|
|
196
|
+
this.dropAliasesTo(key);
|
|
84
197
|
if (!channel) {
|
|
85
198
|
return;
|
|
86
199
|
}
|
|
87
200
|
try {
|
|
88
201
|
channel.socket?.close();
|
|
89
202
|
}
|
|
90
|
-
catch {
|
|
91
|
-
|
|
203
|
+
catch (err) {
|
|
204
|
+
LogError(`[VonageMediaRegistry] Error closing socket for call ${key}`, undefined, err);
|
|
92
205
|
}
|
|
93
|
-
this.channels.delete(
|
|
206
|
+
this.channels.delete(key);
|
|
94
207
|
}
|
|
95
208
|
HasCall(callUuid) {
|
|
96
|
-
return this.channels.has(callUuid);
|
|
209
|
+
return this.channels.has(this.canon(callUuid));
|
|
210
|
+
}
|
|
211
|
+
/** Whether MJ is still waiting for (or has already authenticated) a socket for the call. */
|
|
212
|
+
IsExpected(callUuid) {
|
|
213
|
+
return this.expected.Has(this.canon(callUuid));
|
|
214
|
+
}
|
|
215
|
+
/** Cancels every outstanding connect timer (server shutdown). */
|
|
216
|
+
Dispose() {
|
|
217
|
+
this.expected.Clear();
|
|
218
|
+
}
|
|
219
|
+
// ── internals ────────────────────────────────────────────────────────────────
|
|
220
|
+
/** Resolves a correlation id to the call UUID it was bound to (identity for anything else). */
|
|
221
|
+
canon(id) {
|
|
222
|
+
return this.aliases.get(id) ?? id;
|
|
223
|
+
}
|
|
224
|
+
/** Removes every alias that points at the (now ended) call so the table cannot grow without bound. */
|
|
225
|
+
dropAliasesTo(callKey) {
|
|
226
|
+
for (const [alias, target] of this.aliases) {
|
|
227
|
+
if (alias === callKey || target === callKey) {
|
|
228
|
+
this.aliases.delete(alias);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/** Connect TTL elapsed with no socket: free the channel, then tell the owner so it can end the session. */
|
|
233
|
+
handleConnectTimeout(callKey) {
|
|
234
|
+
LogStatus(`[Telephony][Vonage] media socket never connected for call ${callKey}; dropping its channel.`);
|
|
235
|
+
this.EndCall(callKey);
|
|
236
|
+
this.connectTimeoutListener?.(callKey);
|
|
237
|
+
}
|
|
238
|
+
/** Moves a channel from one key to another, merging into an existing destination channel if there is one. */
|
|
239
|
+
moveChannel(fromKey, toKey) {
|
|
240
|
+
const from = this.channels.get(fromKey);
|
|
241
|
+
if (!from) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
this.channels.delete(fromKey);
|
|
245
|
+
const to = this.channels.get(toKey);
|
|
246
|
+
if (!to) {
|
|
247
|
+
this.channels.set(toKey, from);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
to.socket = to.socket ?? from.socket;
|
|
251
|
+
to.audioHandlers.push(...from.audioHandlers);
|
|
252
|
+
to.eventHandlers.push(...from.eventHandlers);
|
|
253
|
+
to.outboundBuffer.unshift(...from.outboundBuffer);
|
|
254
|
+
to.earlyAudio.unshift(...from.earlyAudio);
|
|
255
|
+
to.earlyAudioBytes += from.earlyAudioBytes;
|
|
256
|
+
to.earlyEvents.unshift(...from.earlyEvents);
|
|
257
|
+
}
|
|
258
|
+
/** Adds an outbound frame to the pre-attach buffer, dropping the oldest (and warning once) at the cap. */
|
|
259
|
+
bufferOutbound(callKey, channel, frame) {
|
|
260
|
+
channel.outboundBuffer.push(frame);
|
|
261
|
+
if (channel.outboundBuffer.length > this.maxOutboundBufferFrames) {
|
|
262
|
+
channel.outboundBuffer.shift();
|
|
263
|
+
if (!channel.outboundOverflowLogged) {
|
|
264
|
+
channel.outboundOverflowLogged = true;
|
|
265
|
+
LogStatus(`[Telephony][Vonage] outbound audio buffer full for call ${callKey} before the media socket connected; dropping oldest frames.`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/** Adds inbound audio to the pre-handler buffer, dropping the oldest (and warning once) past the byte cap. */
|
|
270
|
+
bufferEarlyAudio(callKey, channel, pcm) {
|
|
271
|
+
channel.earlyAudio.push(pcm);
|
|
272
|
+
channel.earlyAudioBytes += pcm.byteLength;
|
|
273
|
+
while (channel.earlyAudioBytes > this.maxEarlyInboundBytes && channel.earlyAudio.length > 1) {
|
|
274
|
+
const dropped = channel.earlyAudio.shift();
|
|
275
|
+
channel.earlyAudioBytes -= dropped?.byteLength ?? 0;
|
|
276
|
+
if (!channel.inboundOverflowLogged) {
|
|
277
|
+
channel.inboundOverflowLogged = true;
|
|
278
|
+
LogStatus(`[Telephony][Vonage] inbound audio buffer full for call ${callKey} before the bridge session was ready; dropping oldest audio.`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/** Sends the frames the agent produced before the socket existed, oldest first. */
|
|
283
|
+
flushOutbound(channel, socket) {
|
|
284
|
+
const buffered = channel.outboundBuffer.splice(0, channel.outboundBuffer.length);
|
|
285
|
+
for (const frame of buffered) {
|
|
286
|
+
socket.sendBinary(frame);
|
|
287
|
+
}
|
|
97
288
|
}
|
|
98
|
-
ensureChannel(
|
|
99
|
-
let channel = this.channels.get(
|
|
289
|
+
ensureChannel(callKey) {
|
|
290
|
+
let channel = this.channels.get(callKey);
|
|
100
291
|
if (!channel) {
|
|
101
|
-
channel = {
|
|
102
|
-
|
|
292
|
+
channel = {
|
|
293
|
+
audioHandlers: [],
|
|
294
|
+
eventHandlers: [],
|
|
295
|
+
outboundBuffer: [],
|
|
296
|
+
partial: new Uint8Array(0),
|
|
297
|
+
earlyAudio: [],
|
|
298
|
+
earlyAudioBytes: 0,
|
|
299
|
+
earlyEvents: [],
|
|
300
|
+
outboundOverflowLogged: false,
|
|
301
|
+
inboundOverflowLogged: false,
|
|
302
|
+
};
|
|
303
|
+
this.channels.set(callKey, channel);
|
|
103
304
|
}
|
|
104
305
|
return channel;
|
|
105
306
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vonageMediaRegistry.js","sourceRoot":"","sources":["../../src/telephony/vonageMediaRegistry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vonageMediaRegistry.js","sourceRoot":"","sources":["../../src/telephony/vonageMediaRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GA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AC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,GAAG,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Flattens a carrier webhook body into the string map the signature verifiers expect.
|
|
3
|
+
*
|
|
4
|
+
* Webhook bodies come from the public internet, so their field names are attacker-controlled. Assigning them
|
|
5
|
+
* with `out[key] = value` lets a field named `__proto__` reach the prototype (remote property injection).
|
|
6
|
+
* This module never assigns a request-supplied name: it filters the entries and builds the map with
|
|
7
|
+
* `Object.fromEntries`, which defines each field as an own data property (it never runs the `__proto__`
|
|
8
|
+
* setter). The prototype-reaching names are dropped as well, so they cannot even appear as own keys.
|
|
9
|
+
*
|
|
10
|
+
* @module @memberjunction/telephony-adapters
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Coerces an Express body (urlencoded or JSON object) into a `Record<string, string>`.
|
|
14
|
+
* String values are kept as-is; numbers and booleans are stringified (Vonage JSON events carry them);
|
|
15
|
+
* anything else (objects, arrays, null) is dropped, as are the forbidden keys.
|
|
16
|
+
*
|
|
17
|
+
* @param body The parsed request body.
|
|
18
|
+
* @returns A map holding only the safe scalar fields, each an own data property.
|
|
19
|
+
*/
|
|
20
|
+
export declare function CoerceWebhookParams(body: unknown): Record<string, string>;
|
|
21
|
+
//# sourceMappingURL=webhookParams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhookParams.d.ts","sourceRoot":"","sources":["../../src/telephony/webhookParams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYzE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Flattens a carrier webhook body into the string map the signature verifiers expect.
|
|
3
|
+
*
|
|
4
|
+
* Webhook bodies come from the public internet, so their field names are attacker-controlled. Assigning them
|
|
5
|
+
* with `out[key] = value` lets a field named `__proto__` reach the prototype (remote property injection).
|
|
6
|
+
* This module never assigns a request-supplied name: it filters the entries and builds the map with
|
|
7
|
+
* `Object.fromEntries`, which defines each field as an own data property (it never runs the `__proto__`
|
|
8
|
+
* setter). The prototype-reaching names are dropped as well, so they cannot even appear as own keys.
|
|
9
|
+
*
|
|
10
|
+
* @module @memberjunction/telephony-adapters
|
|
11
|
+
*/
|
|
12
|
+
/** Field names that reach an object's prototype machinery and are therefore never copied. */
|
|
13
|
+
const FORBIDDEN_KEYS = new Set(['__proto__', 'constructor', 'prototype']);
|
|
14
|
+
/**
|
|
15
|
+
* Coerces an Express body (urlencoded or JSON object) into a `Record<string, string>`.
|
|
16
|
+
* String values are kept as-is; numbers and booleans are stringified (Vonage JSON events carry them);
|
|
17
|
+
* anything else (objects, arrays, null) is dropped, as are the forbidden keys.
|
|
18
|
+
*
|
|
19
|
+
* @param body The parsed request body.
|
|
20
|
+
* @returns A map holding only the safe scalar fields, each an own data property.
|
|
21
|
+
*/
|
|
22
|
+
export function CoerceWebhookParams(body) {
|
|
23
|
+
if (!body || typeof body !== 'object') {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
const safeEntries = [];
|
|
27
|
+
for (const [key, value] of Object.entries(body)) {
|
|
28
|
+
const text = toParamString(value);
|
|
29
|
+
if (text !== undefined && !FORBIDDEN_KEYS.has(key)) {
|
|
30
|
+
safeEntries.push([key, text]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return Object.fromEntries(safeEntries);
|
|
34
|
+
}
|
|
35
|
+
/** The string form of a scalar webhook value, or `undefined` for anything that is not a scalar. */
|
|
36
|
+
function toParamString(value) {
|
|
37
|
+
if (typeof value === 'string') {
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
41
|
+
return String(value);
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=webhookParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhookParams.js","sourceRoot":"","sources":["../../src/telephony/webhookParams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,6FAA6F;AAC7F,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC;AAE/F;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAa;IAC7C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,EAAE,CAAC;IACd,CAAC;IACD,MAAM,WAAW,GAAuB,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAA+B,CAAC,EAAE,CAAC;QACzE,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACjD,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;QAClC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC;AAED,mGAAmG;AACnG,SAAS,aAAa,CAAC,KAAc;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1D,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,44 @@
|
|
|
1
1
|
import { UserInfo, DatabaseProviderBase } from '@memberjunction/core';
|
|
2
|
+
import type { OutboundPolicySettings, TransferTargetSettings } from './telephony/outboundCallPolicy.js';
|
|
3
|
+
import type { SipTrunkCarrierSettings } from './telephony/sipTrunkCarrier.js';
|
|
4
|
+
/**
|
|
5
|
+
* Settings that apply to every carrier. They are configured once under `telephony` and merged into each
|
|
6
|
+
* carrier's extension settings by the host (a carrier block may override them).
|
|
7
|
+
*/
|
|
8
|
+
export interface TelephonySharedSettings {
|
|
9
|
+
/**
|
|
10
|
+
* Email of the user INBOUND calls run as. Required for inbound calls: if unset, unknown, inactive, or the
|
|
11
|
+
* system user, the call is rejected (there is deliberately no fallback to a privileged user). Point it at a
|
|
12
|
+
* dedicated least-privilege account.
|
|
13
|
+
*/
|
|
14
|
+
inboundRunAsUserEmail?: string;
|
|
15
|
+
/** Maximum length of one phone call in seconds (default 1800). The session is stopped at the cap. */
|
|
16
|
+
maxCallSeconds?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Most phone calls (every carrier together, both directions) the server will carry at once (default 25).
|
|
19
|
+
* Keep this at or below the realtime model plan's concurrent-session limit: past the cap an inbound caller
|
|
20
|
+
* hears a polite "all agents are busy" and an outbound call is refused, instead of every call degrading.
|
|
21
|
+
*/
|
|
22
|
+
maxConcurrentCalls?: number;
|
|
23
|
+
/** Outbound destination policy and per-user rate limit applied to every `Place*Call` mutation. */
|
|
24
|
+
outbound?: OutboundPolicySettings;
|
|
25
|
+
/**
|
|
26
|
+
* The places the agent may transfer a live call to, by name. Empty or absent means the agent cannot transfer at
|
|
27
|
+
* all, even on a carrier that supports it: the agent never names a free-form number.
|
|
28
|
+
*/
|
|
29
|
+
transferTargets?: TransferTargetSettings[];
|
|
30
|
+
/**
|
|
31
|
+
* Estimated carrier cost rate per minute in reporting currency (e.g. 0.015 for 1.5 cents/min).
|
|
32
|
+
* Used to compute Interaction.CostEstimate at call end. Defaults to 0.015 if unset.
|
|
33
|
+
*/
|
|
34
|
+
costPerMinute?: number;
|
|
35
|
+
}
|
|
36
|
+
/** What to do when answering-machine detection says a machine (or fax) answered an outbound call. */
|
|
37
|
+
export type OnMachineAction = 'hangup' | 'continue';
|
|
2
38
|
/**
|
|
3
39
|
* Twilio Programmable Voice + Media Streams telephony binding configuration.
|
|
4
40
|
*/
|
|
5
|
-
export interface TwilioTelephonyConfig {
|
|
41
|
+
export interface TwilioTelephonyConfig extends TelephonySharedSettings {
|
|
6
42
|
/** Twilio Account SID (`AC…`). */
|
|
7
43
|
accountSid: string;
|
|
8
44
|
/** Account auth token — REST auth (when no API key pair) AND the HMAC key for X-Twilio-Signature verification. */
|
|
@@ -13,15 +49,25 @@ export interface TwilioTelephonyConfig {
|
|
|
13
49
|
apiKeySecret?: string;
|
|
14
50
|
/** The publicly reachable `wss://…/telephony/twilio/media` URL Twilio's <Connect><Stream> connects to. */
|
|
15
51
|
streamPublicUrl: string;
|
|
16
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Reserved; currently unused. The media websocket is authenticated by a per-call token minted by MJ (see
|
|
54
|
+
* `mediaSocketAuth.ts`), and webhooks by `X-Twilio-Signature`.
|
|
55
|
+
*/
|
|
17
56
|
webhookSigningSecret?: string;
|
|
18
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* URL Twilio posts outbound-call lifecycle events to. Defaults to `<public URL>/telephony/twilio/status`
|
|
59
|
+
* (the route that ends the session when a call is busy / unanswered / failed / completed).
|
|
60
|
+
*/
|
|
19
61
|
statusCallbackUrl?: string;
|
|
62
|
+
/** URL Twilio posts the async answering-machine verdict to. Defaults to `<public URL>/telephony/twilio/amd`. */
|
|
63
|
+
amdStatusCallbackUrl?: string;
|
|
64
|
+
/** What to do when a machine or fax answers an outbound call (default `'hangup'`). */
|
|
65
|
+
onMachine?: OnMachineAction;
|
|
20
66
|
}
|
|
21
67
|
/**
|
|
22
68
|
* Vonage Voice + WebSocket-media telephony binding configuration.
|
|
23
69
|
*/
|
|
24
|
-
export interface VonageTelephonyConfig {
|
|
70
|
+
export interface VonageTelephonyConfig extends TelephonySharedSettings {
|
|
25
71
|
/** Vonage Application ID (UUID) — the JWT-auth identity for the Voice API. */
|
|
26
72
|
applicationId?: string;
|
|
27
73
|
/** The application's RSA private key (PEM) used to sign Voice-API JWTs. */
|
|
@@ -34,13 +80,18 @@ export interface VonageTelephonyConfig {
|
|
|
34
80
|
mediaPublicUrl: string;
|
|
35
81
|
/** Vonage account signature secret — HMAC key for signed-request `sig` AND HS256 webhook-JWT verification. */
|
|
36
82
|
signatureSecret?: string;
|
|
37
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* Event-webhook URL Vonage posts call lifecycle events to. Defaults to `<public URL>/telephony/vonage/event`
|
|
85
|
+
* (the route that ends the session when a call is busy / unanswered / failed / completed).
|
|
86
|
+
*/
|
|
38
87
|
eventUrl?: string;
|
|
88
|
+
/** What to do when a machine answers an outbound call — Vonage's `machine_detection` (default `'hangup'`). */
|
|
89
|
+
onMachine?: OnMachineAction;
|
|
39
90
|
}
|
|
40
91
|
/**
|
|
41
92
|
* RingCentral SIP softphone telephony binding configuration.
|
|
42
93
|
*/
|
|
43
|
-
export interface RingCentralTelephonyConfig {
|
|
94
|
+
export interface RingCentralTelephonyConfig extends TelephonySharedSettings {
|
|
44
95
|
/** SIP domain (e.g. `sip.ringcentral.com`). */
|
|
45
96
|
sipDomain: string;
|
|
46
97
|
/** SIP outbound proxy (`host:port`, e.g. `sip10.ringcentral.com:5096`). */
|
|
@@ -56,6 +107,37 @@ export interface RingCentralTelephonyConfig {
|
|
|
56
107
|
/** Skip TLS cert validation (sandbox/test only — never in production). */
|
|
57
108
|
ignoreTlsCertErrors?: boolean;
|
|
58
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* LiveKit SIP binding: phone calls carried by a SIP trunk, landing in a LiveKit room. The carrier is whoever the trunk
|
|
112
|
+
* belongs to (Twilio Elastic SIP Trunking, Telnyx, …); MJ routes the call and runs the agent in the room.
|
|
113
|
+
*
|
|
114
|
+
* LiveKit credentials come from here or, when omitted, from `LIVEKIT_URL` / `LIVEKIT_API_KEY` / `LIVEKIT_API_SECRET`
|
|
115
|
+
* (the same ones the Meet room uses).
|
|
116
|
+
*/
|
|
117
|
+
export interface LiveKitSipSettings extends TelephonySharedSettings {
|
|
118
|
+
/** LiveKit server URL (`wss://…`). Defaults to `LIVEKIT_URL`. */
|
|
119
|
+
serverUrl?: string;
|
|
120
|
+
/** LiveKit API key. Defaults to `LIVEKIT_API_KEY`. */
|
|
121
|
+
apiKey?: string;
|
|
122
|
+
/** LiveKit API secret. Defaults to `LIVEKIT_API_SECRET`. */
|
|
123
|
+
apiSecret?: string;
|
|
124
|
+
/** Inbound calls land in a room whose name starts with this (default `call-`). Rooms that do not are not phone calls. */
|
|
125
|
+
roomPrefix?: string;
|
|
126
|
+
/** The numbers (E.164) this deployment answers. Each routes to the agent identity registered for that number. */
|
|
127
|
+
numbers?: string[];
|
|
128
|
+
/** The LiveKit inbound trunk id, when it was created by hand. Checked at startup; created for you when `autoProvision` is set. */
|
|
129
|
+
inboundTrunkId?: string;
|
|
130
|
+
/** The LiveKit OUTBOUND trunk used to dial out (an outbound call, a fallback leg, a transfer to a number). Dialing out is off without it. */
|
|
131
|
+
outboundTrunkId?: string;
|
|
132
|
+
/** The caller ID presented on a call dialed out through the outbound trunk. Defaults to the trunk's own number. */
|
|
133
|
+
outboundFromNumber?: string;
|
|
134
|
+
/** Create the inbound trunk and dispatch rule at startup when they do not exist (idempotent). Default false. */
|
|
135
|
+
autoProvision?: boolean;
|
|
136
|
+
/** Source addresses the inbound trunk accepts calls from (the carrier's SIP signalling addresses). Used when provisioning. */
|
|
137
|
+
allowedAddresses?: string[];
|
|
138
|
+
/** The carrier behind the trunk, for configuration checks only. */
|
|
139
|
+
carrier?: SipTrunkCarrierSettings;
|
|
140
|
+
}
|
|
59
141
|
/**
|
|
60
142
|
* Teams meetings binding configuration.
|
|
61
143
|
*/
|
|
@@ -78,11 +160,12 @@ export interface TeamsMeetingsConfig {
|
|
|
78
160
|
/**
|
|
79
161
|
* Full telephony section configuration shape.
|
|
80
162
|
*/
|
|
81
|
-
export interface TelephonyConfig {
|
|
163
|
+
export interface TelephonyConfig extends TelephonySharedSettings {
|
|
82
164
|
enabled: boolean;
|
|
83
165
|
twilio?: TwilioTelephonyConfig;
|
|
84
166
|
vonage?: VonageTelephonyConfig;
|
|
85
167
|
ringcentral?: RingCentralTelephonyConfig;
|
|
168
|
+
livekitSip?: LiveKitSipSettings;
|
|
86
169
|
teams?: TeamsMeetingsConfig;
|
|
87
170
|
}
|
|
88
171
|
/**
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACxG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACpC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qGAAqG;IACrG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kGAAkG;IAClG,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC;;;OAGG;IACH,eAAe,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC3C;;;OAGG;IACH,aAAa,CAA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oD;AACpD,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,YAAY,EAAE,GAAG,oBAAoB,GAAG,IAAI,CAE5F"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AAiNtE;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAyB;IACxD,IAAI,CAAC,WAAW,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,IAAI,WAAW,CAAC,UAAU,EAAE,CAAC;QACzB,OAAO,WAAW,CAAC,UAAU,CAAC;IAClC,CAAC;IACD,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,KAAK,WAAW,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;AAChH,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,kBAAkB,CAAC,WAAyB;IACxD,OAAO,kBAAkB,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAA0B;IAC3D,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,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