WebRTC browser calling

Browser Calling SDK

Let your team place outbound calls to any phone number from your CRM, dashboard or support tool, straight from the browser. Mint a short-lived token on your server, then add a drop-in dialer with one script tag or build your own UI with the hosted JavaScript SDK.

The short answer

The Edesy browser calling SDK places outbound phone calls from a web page over WebRTC. Your server exchanges your API key for a short-lived token at webrtc.edesy.in/api/v1/token, and the page connects with the hosted SDK (webrtc.edesy.in/sdk/edesy-voice.js) or the drop-in dialer script. Calls cost Rs 1.50 per minute, 1-minute minimum, excluding GST.

Browser calling at a glance

ItemDetail
Token endpointPOST https://webrtc.edesy.in/api/v1/token, from your server only
Auth headerx-api-key: YOUR_API_KEY
Token body{ "identity": "agent-42" }, 1 to 64 characters
Drop-in dialer<script src="https://webrtc.edesy.in/sdk/edesy-dialer.js" data-token-url="...">
JavaScript SDK<script src="https://webrtc.edesy.in/sdk/edesy-voice.js">
Call controlscall, hangup, mute, hold, send DTMF digits
Eventsready, error, incoming; ringing, answered, ended, failed, mute, hold, dtmf
NAT traversalICE servers returned with every token
PriceRs 1.50/min, 1-minute minimum, excl. 18% GST
BillingPrepaid INR wallet, Razorpay top-ups, GST invoices

How browser calling works

Three pieces: your server, the browser and the phone network.

  1. Step 1 of 5: Get your API key

    Sign in at webrtc.edesy.in and copy your API key from the Developers page. Store it as a server environment variable, never in browser code.

  2. Step 2 of 5: Mint a token on your server

    After your own user is signed in, call POST https://webrtc.edesy.in/api/v1/token with the x-api-key header and an identity for that user. The response holds short-lived credentials, the caller ID and ICE servers.

  3. Step 3 of 5: Connect in the browser

    Pass the token JSON to connect(), or give connect() the URL of your token endpoint and let the SDK fetch it. The device fires ready once it is registered.

  4. Step 4 of 5: Place the call

    Call device.call("919876543210"). The call fires ringing, answered and ended events, and you can mute, hold, send digits or hang up.

  5. Step 5 of 5: Mint again when it expires

    Each token carries an expiresIn value. Fetch a new one when it runs out or the device reports an error.

1. Mint a token on your server

Server to server only. Return the JSON to your page unchanged.

curl -X POST https://webrtc.edesy.in/api/v1/token \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"identity": "agent-42"}'

2. Call from the browser with the hosted SDK

Load edesy-voice.js, then call EdesyVoice.connect() with the token JSON or your token URL. Subscribe to events with .on().

<script src="https://webrtc.edesy.in/sdk/edesy-voice.js"></script>
<script>
(async () => {
const device = await EdesyVoice.connect("https://your-backend.example.com/edesy-token");
device.on("ready", () => console.log("registered"));

const call = device.call("919876543210");
call.on("ringing", () => {});
call.on("answered", () => {});
call.on("ended", () => {});

// call.toggleMute(); call.toggleHold(); call.sendDigit("1"); call.hangup();
})();
</script>

Or: drop-in dialer, no code

Paste one tag into any page or CRM custom-HTML block. It fetches the token from your URL and shows a ready-made dialer.

<script src="https://webrtc.edesy.in/sdk/edesy-dialer.js"
        data-token-url="https://your-backend.example.com/edesy-token"></script>

What the SDK gives you

The methods and events in the Edesy voice SDK (version 0.1.0).

connect() and device.call()

connect(config or tokenUrl) returns a Device. device.call(number) returns a Call. device.disconnect() unregisters.

Call events

Each Call emits ringing, answered, ended and failed, plus mute, hold and dtmf when those controls change.

Mute, hold and DTMF

toggleMute(), toggleHold() and sendDigit() on the live call, so agents can navigate an IVR or pause a conversation.

Outbound calling only

The SDK is for outbound calls. The Device raises an incoming event when a call is sent to it, but version 0.1.0 has no answer method, so you can only see and decline it. Answer inbound calls in the browser with the contact center agent desktop.

ICE servers with every token

Each token response includes ICE servers, and the SDK applies them to every call to help it connect from behind office and home NATs.

Your key stays on your server

The browser only ever sees short-lived credentials for one identity, minted after your own app has signed the user in.

Click-to-call website widget

For visitors, not agents: a call button on your site that rings your team and then calls the visitor back.

Callback, then bridge

The visitor enters their phone number. Edesy calls your team first and, when someone answers, calls the visitor and bridges the two.

Look and text

Position (any corner), primary colour, greeting message, button text and an offline message.

Business hours

Start and end time, open days and a timezone (Asia/Kolkata by default). Outside hours the widget shows your offline message.

Allowed domains, Indian numbers

Limit which websites can load the widget, including their subdomains. Visitor numbers must be Indian (+91).

Daily and concurrent limits

Cap calls in progress at once and calls per day, so a busy page cannot flood your team or your wallet.

Funnel analytics

Impressions, clicks and calls for each widget, with the page URL and referrer on every call. Embed with the snippet from your dashboard; ask us for the widget call rate.

Frequently Asked Questions

Put a dialer in your app today

Copy your API key, mint a token on your server and place your first browser call.