@origonai/web-sdk 0.1.2 → 0.1.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/README.md +6 -0
- package/dist/index.d.ts +5 -0
- package/dist/origon-web-sdk.js +603 -565
- package/dist/origon-web-sdk.js.map +1 -1
- package/docs/backend-integration.md +17 -30
- package/docs/contract.md +21 -0
- package/docs/voice.md +12 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -175,6 +175,7 @@ client.initialize({
|
|
|
175
175
|
|
|
176
176
|
const { sessionId } = await client.startSession({ channel: 'voice' })
|
|
177
177
|
await client.setMute(sessionId, 'uplink') // 'uplink' | 'downlink' | 'both' | 'none'
|
|
178
|
+
await client.sendDtmf(sessionId, '5') // one of 0-9, *, #, A-D
|
|
178
179
|
|
|
179
180
|
const off = client.subscribeAudioStats(sessionId, ({ outboundLevel, inboundLevel }) => {
|
|
180
181
|
// VU meters at ~5 Hz
|
|
@@ -192,6 +193,11 @@ Voice requires:
|
|
|
192
193
|
|
|
193
194
|
The browser opens a single WebTransport to `<media-server>/web`, sends a B2BUA `Connect` over the control sub-stream, and pumps 20 ms Opus frames as `ObjectDatagram`s with `group_id = floor(Date.now()/1000) - serverEpochUnix`. Reconnect is Tier-3 only (`Resume` verb) with `[100, 250, 500, 1000]` ms backoff.
|
|
194
195
|
|
|
196
|
+
`sendDtmf` resolves when Media acknowledges publication to the active CX flow.
|
|
197
|
+
It rejects while the voice transport is reconnecting and is never queued or
|
|
198
|
+
replayed after `Resume`. The SDK does not play a local tone or expose a peer
|
|
199
|
+
DTMF callback.
|
|
200
|
+
|
|
195
201
|
## Joining a provisioned session
|
|
196
202
|
|
|
197
203
|
`startSession` originates a session by calling `POST /session/start` itself.
|
package/dist/index.d.ts
CHANGED
|
@@ -150,6 +150,9 @@ export declare type DisconnectReason = {
|
|
|
150
150
|
detail: string;
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
+
/** Complete programmatic DTMF alphabet; lowercase is intentionally invalid. */
|
|
154
|
+
export declare type DtmfDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '*' | '#' | 'A' | 'B' | 'C' | 'D';
|
|
155
|
+
|
|
153
156
|
export declare function getSessionManager(): SessionManager;
|
|
154
157
|
|
|
155
158
|
/**
|
|
@@ -457,6 +460,8 @@ export declare class SessionManager {
|
|
|
457
460
|
notifyTyping(sessionId: string, metadata?: TypingMetadata): void;
|
|
458
461
|
stopTyping(sessionId: string): void;
|
|
459
462
|
setMute(sessionId: string, scope: MuteScope): Promise<void>;
|
|
463
|
+
/** Send one DTMF symbol to the active CX flow for a voice session. */
|
|
464
|
+
sendDtmf(sessionId: string, digit: DtmfDigit): Promise<void>;
|
|
460
465
|
/** Enable microphone coaching on a receive-only voice join. */
|
|
461
466
|
enableCapture(sessionId: string): Promise<void>;
|
|
462
467
|
/** Return a coaching voice join to Listen and release its microphone. */
|