answer

View as Markdown

answer

  • answer(): Promise<Call>

Answers the incoming call.

Parameters

This method has no parameters.

Returns

Promise<Call>

Example

In this example, we answer an incoming call on the office topic.

1import { SignalWire } from "@signalwire/realtime-api";
2
3const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" })
4
5const voiceClient = client.voice;
6
7await voiceClient.listen({
8 topics: ["office"],
9 onCallReceived: (call) => {
10 call.answer();
11 console.log("Call received", call.id);
12 }
13});