SIP vs WebRTC vs a Discord bot: how to call a phone

Every "call a phone from my computer" project picks one of three routes: a SIP client, a WebRTC bridge, or a finished bot with a SIP stack inside. All three produce a ringing phone, and they fail in completely different ways.

The three routes in plain words

SIP client (softphone). A desktop app registers directly with your provider, dials and handles the audio. Honest and simple, but it lives on one machine and belongs to one person.

WebRTC bridge. A web page captures your microphone over WebRTC, a server terminates that stream and re-originates the call towards the phone network through a gateway or second SIP leg. It looks elegant because there is nothing to install.

Bot with an embedded SIP stack. A headless service runs a real SIP endpoint, joins your voice channel as a participant and bridges the two media streams. In CallBot that is PJSUA2 (PJSIP) in a Docker container: nothing runs on your laptop, nothing depends on a browser tab.

Side-by-side comparison

CriterionSIP softphoneWebRTC bridgeBot with SIP stack
Audio qualityGood; depends on the local networkFair; two media conversions and browser jitter bufferingGood; one Opus to G.711 or G.722 hop per direction
Working behind NATUsually fine; the app handles itHardest part; needs ICE, STUN and often a TURN relayServer-side, one steady registration
Recording and logsManual, per call, per machineRetrofit: mixing browser streams never built for itBuilt in: direction, number, duration, recording
Number of participantsOne person per deviceOne browser session, awkward for a groupWhole voice channel; mute and mono mode keep order
Setup complexityLowest: install and type credentialsHighest: page, signalling, gateway, TURN, certificatesLow: add the bot, add SIP credentials, dial
Cost of ownershipProvider minutes plus a machine kept awakeProvider minutes plus gateway and relay infrastructureProvider minutes plus one hosted instance
What breaks most oftenThe laptop sleeps, or the firewall blocks mediaPermissions, TURN capacity, one-way audioProvider limits: concurrency caps, blocked destinations, expired credentials

Why the WebRTC bridge is a compromise

WebRTC is excellent at what it was designed for: browser to browser through NAT. The moment a call must reach the public telephone network, that elegance becomes plumbing.

  • Extra conversions. Microphone to Opus, Opus to the gateway, gateway to G.711, then the carrier: every hop adds latency and one more place for audio to vanish.
  • The tab problem. A page must stay open, awake and unsuspended, yet browsers deliberately slow background tabs, fatal for a call meant to last twenty minutes.
  • NAT and ICE. The browser works hard to find a path, and the server still needs a relay or a public media port. Both fail quietly.
  • Recording is a retrofit. Capturing both directions cleanly means mixing streams that were never meant to be mixed.

WebRTC is not wrong; it is a bridge, not infrastructure.

Why a full SIP stack holds up in production

A SIP stack is what the telephone network expects to talk to. PJSUA2 treats registration, dialog state, codec negotiation, RTP, DTMF and hangup as protocol work rather than logic you invent and debug. Headless in a container, the endpoint stays registered whatever anybody's laptop is doing.

Transcoding becomes a known quantity too: Discord's Opus on one side, the trunk's G.711 or G.722 on the other, at one point in the chain. That is the difference between a system you can reason about and a chain where any link may be the culprit.

Choosing for the long run

The subscription is the smallest line in the budget. The real cost is the hours keeping the path alive: a softphone needs a machine that never sleeps, a WebRTC bridge needs a gateway, a relay and someone who understands ICE, a bot needs only a SIP account.

Pick the route whose failure you could debug at two in the morning. For a community server that dials real numbers regularly, that is the route where SIP is first-class and no browser stands in the middle of every call.

Recording and history are not an afterthought. CallBot logs every call with direction, number, duration and recording, with search and filters. Recording starts on Basic, multichannel on Pro; the panel is at panel.callbot.fun.
Keep your own SIP provider and let a headless SIP client join your voice channel.
Try CallBot