@profullstack/group-call 0.4.0 → 0.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/dist/index.d.ts +5 -1
- package/dist/index.js +7 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -256,7 +256,11 @@ export declare class GroupCall {
|
|
|
256
256
|
}): Promise<{
|
|
257
257
|
leg: string;
|
|
258
258
|
} | null>;
|
|
259
|
-
/**
|
|
259
|
+
/**
|
|
260
|
+
* A dialled phone was picked up: press 1 to join, so voicemail never does.
|
|
261
|
+
* Telnyx itself replays the prompt (three tries) and ignores any other key,
|
|
262
|
+
* so an ended gather without a 1 is a no.
|
|
263
|
+
*/
|
|
260
264
|
private offer;
|
|
261
265
|
/** Hand a well-formed code to the app, and act on what it says the code is. */
|
|
262
266
|
private routeCode;
|
package/dist/index.js
CHANGED
|
@@ -395,15 +395,17 @@ export class GroupCall {
|
|
|
395
395
|
this.options.onEvent?.(` ringing a phone into a room.`);
|
|
396
396
|
return { leg };
|
|
397
397
|
}
|
|
398
|
-
/**
|
|
399
|
-
|
|
398
|
+
/**
|
|
399
|
+
* A dialled phone was picked up: press 1 to join, so voicemail never does.
|
|
400
|
+
* Telnyx itself replays the prompt (three tries) and ignores any other key,
|
|
401
|
+
* so an ended gather without a 1 is a no.
|
|
402
|
+
*/
|
|
403
|
+
async offer(leg, dialled) {
|
|
400
404
|
this.dialled.delete(leg);
|
|
401
405
|
const prompt = dialled.prompt ?? "This is group call, calling you into a room.";
|
|
402
|
-
await this.gather(leg, `${
|
|
406
|
+
await this.gather(leg, `${prompt} Press 1 to join.`, { validDigits: "1", maximumDigits: 1, timeoutMillis: 6000 }, async (digits) => {
|
|
403
407
|
if (digits === "1")
|
|
404
408
|
return this.join(leg, dialled.code, dialled.welcome);
|
|
405
|
-
if (tries < 2)
|
|
406
|
-
return this.offer(leg, dialled, tries + 1);
|
|
407
409
|
await this.command(leg, "speak", { payload: "Okay, not joining. Goodbye.", ...this.voiceBody(leg) });
|
|
408
410
|
await this.command(leg, "hangup", {});
|
|
409
411
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@profullstack/group-call",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "A group call on a phone number: dial in, key a room code, talk with everyone else who did, people and AI agents alike. Telnyx Call Control state machine extracted from nixamp's party line; the engine behind nixamp live joins and group.call.pit.world.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|