For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
ReferenceGuidesClick-to-Call
ReferenceGuidesClick-to-Call
  • Core
    • Overview
  • SignalWire Client
    • Overview
    • Notifications
    • Client
    • Utility functions
  • Video
    • Overview
    • LocalOverlay
    • RoomSession
    • RoomSessionDevice
    • RoomSessionPlayback
    • RoomSessionRecording
    • RoomSessionScreenShare
    • RoomSessionStream
    • RoomDevice
    • RoomScreenShare
  • Chat
    • Overview
    • Client
    • ChatMember
    • ChatMemberEntity
    • ChatMessage
    • ChatMessageEntity
  • PubSub
    • Overview
    • Client
    • PubSubMessage
  • WebRTC
    • Overview
LogoLogoSignalWire Docs
Log inSign up
Support
SignalWire Client

Notifications

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

The SignalWire Client

Next
Built with

If you’ve initialized the SignalWire Client with a subscriber token, you can opt into receiving notifications whenever that subscriber address is called using WebSockets.

The WebSocket notifications are delivered over the WebSocket connection while your application is active, and you have called the online() method to opt into receiving them.

To receive incoming call notifications over WebSocket, call client.online() with an incomingCallHandlers object:

1client.online({
2 incomingCallHandlers: {
3 websocket: (callInvite) => {
4 const callerName = callInvite.invite.details?.caller_id_name;
5 const callerNumber = callInvite.invite.details?.caller_id_number;
6
7 // to accept:
8 const roomSession = await callInvite.invite.accept(params);
9
10 // to reject:
11 callInvite.invite.reject();
12 },
13 },
14});

When an incoming call arrives, the websocket handler receives a callInvite object containing:

  • callInvite.invite.details - call and caller information IncomingInvite
  • callInvite.invite.accept() - accepts the call and returns a CallSession
  • callInvite.invite.reject() - rejects the call