Examples
The repository demos are maintained as executable TypeScript programs. This page keeps only short patterns and links to those source files, avoiding copied programs that can drift.
Answer a call
softphone.on("invite", async (inviteMessage) => {
const callSession = await softphone.answer(inviteMessage);
callSession.once("disposed", () => softphone.revoke());
});
await softphone.register();
Place a call
await softphone.register();
const callSession = await softphone.call("16505550100");
callSession.once("answered", () => console.log("Answered"));
callSession.once("busy", () => console.log("Busy or unreachable"));
Join a meeting with DTMF
await callSession.sendDTMFs(`${accessCode}#`);
callSession.sendDTMF("#");
View demos/join-rcv-meeting.ts
Make calls sequentially
Wait for each session's disposed event before placing the next call.
View demos/multiple-calls-sequentially.ts
Run multiple instances
Give each instance distinct debug prefixes. Only the most recent registration receives inbound calls when credentials are shared.
For conference orchestration, see the separate conference integration demo.