Skip to main content

Connect to RustPBX

Clients establish a connection with RustPBX via WebSocket, and different call types are distinguished by path.

Path

Select different WebSocket paths based on audio transmission method:

  • /call: Audio stream transmitted via WebSocket
  • /call/sip: Establish calls using SIP protocol, RTP transmits audio.
  • /call/webrtc: Establish calls directly using SDP Offer.

Parameters

Parameter description:

  • id: Used to set the Session ID for the call, defaults to server-generated UUID.
    • In answering scenarios, it needs to be set to the dialogId in the webhook request (see Answer/Reject).
  • dump: Whether to print commands and events, defaults to printing. Directory and file are the same as recording files, file ends with events.jsonl.
  • pingInterval: WebSocket Ping interval, in seconds.
  • serverSideTrack: Set the server-side Track ID, defaults to serverSideTrack (mainly includes TTS and Play Track IDs).

Example

'ws://localhost:8080/call/sip?id=session123&dump=true'
  • SIP call
  • Set sessionId to session123
  • Dump commands and events