Web (React) Guide
Web (React) Guide
This guide walks you through building a voice calling application in the browser using React.
Step 1: Create a React Project
Step 2: Install the SDK
Step 3: Connect to the SBC
Create a component that connects to your jambonz SBC:
Run npm run dev and click Connect. You should see the status change to registered.
Step 4: Make an Outbound Call
Add a call button to your component:
Step 5: Handle Incoming Calls
Listen for incoming calls and show an answer/decline UI:
Step 6: Add Call Controls
Add mute, hold, and DTMF:
Step 7: Using React Hooks (Alternative)
Instead of managing state manually, use the built-in hooks:
Run the Full Example App
The repo includes a complete softphone example built with React + Vite + Tailwind CSS — with a polished dark theme UI, DTMF pad, incoming call handling, and console logs.
Open http://localhost:5173 in your browser.
What the example includes
The example app has clean separation between SDK logic and UI:
src/useJambonz.ts— all SDK interactions (connect, call, mute, hold, transfer, incoming calls). Read this file to learn the SDK.src/App.tsx— wires SDK state to UI componentssrc/components/— reusable UI: ConnectionForm, DialerView, ActiveCallView, IncomingCallView, DtmfPad, LogPanel
How to use it
- Enter your jambonz SBC WebSocket URL (e.g.
wss://sbc.example.com:8443) - Enter your SIP username and password
- Click Connect — status dot turns green when registered
- Enter a number or SIP URI and click Call
- Use the in-call controls: mute, hold, DTMF pad, hang up
- Incoming calls show an answer/decline screen
- Expand Console Logs at the bottom to see SDK events
Source: github.com/jambonz/webrtc-sdk/tree/main/examples/web