Set it up in a minute
Fill in your phone system, choose who turns Astephon on, and paste the code into your CRM (once, in the main layout — every page and every agent gets it).
Agents who use another phone
Many CRMs have some agents on Astephon and others on another softphone or VoIP service. Astephon handles both:
- Astephon on — the phone is in the corner of the CRM, it rings for incoming calls, and phone links in the CRM call with Astephon.
- Astephon off — nothing is loaded and nothing rings. Phone links go to the agent's default phone app (their other softphone) exactly as before. Only a small Astephon off switch stays in the corner (hide it with
switch: false). - Agents switch with the power button in the phone, or the Astephon off switch. The choice is remembered per agent (per
user) in their browser. - One click-to-call for everyone: use
Astephon.call(number)in your CRM's call buttons. With Astephon on it calls in Astephon; with Astephon off it opens the agent's default phone app — or your own function (onDisabledCall, e.g. another provider's API).
Astephon.init({
user: currentUser.id, // remembers the choice per agent (and handles shared computers)
enabled: currentUser.phone === 'astephon' ? true : currentUser.phone === 'other' ? false : 'agent',
onDisabledCall: (number) => otherVoip.call(number), // optional: what "call" does when Astephon is off
})
Astephon.on('enabled', () => saveUserSetting('astephon', true)) // optional: keep it in your CRM
Astephon.on('disabled', () => saveUserSetting('astephon', false))
Shared computers: pass user. When another CRM user opens the CRM on the same browser, the previous agent's account, call history and chats are removed from the phone, so calls never ring for the wrong person.
More examples
Works with any web app — React, Vue, Next.js, plain HTML — hosted anywhere (Vercel, Netlify, your own server). Paste this before </body>:
<script src="https://www.astephon.cc/embed.js"></script>
<script>
Astephon.init({
account: {
domain: 'pbx.example.com', // SIP domain
wss: 'wss://pbx.example.com:8089/ws', // your PBX's WebSocket (WebRTC) address
username: '101', // the agent's extension
password: 'extension-password',
displayName: 'Jane Smith',
},
})
</script>
That's it: a phone button appears in the bottom-right corner, and every tel:, sip: and callto: link in your app dials in Astephon.
You can leave out account: each agent then adds their SIP account once inside the phone. Passing it from your app (for the logged-in agent) means nobody has to set anything up.
Call from your own buttons
<a href="tel:+442079460958">+44 20 7946 0958</a> <!-- dials automatically -->
<button onclick="Astephon.call('+442079460958')">Call</button>
Save calls to the customer (call logging)
Astephon.on('ended', async (call) => {
// call = { id, direction, number, name, status, reason, startedAt, answeredAt, endedAt, durationSec, recording? }
await fetch('/api/calls', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ ...call, recording: undefined }),
})
if (call.recording) {
// the audio file (Blob) when the call was recorded
const form = new FormData()
form.append('file', call.recording, `${call.id}.webm`)
await fetch(`/api/calls/${call.id}/recording`, { method: 'POST', body: form })
}
})
Show the customer when they call (screen pop)
Astephon.on('incoming', (call) => {
// call = { id, number, name }
router.push(`/customers/search?phone=${encodeURIComponent(call.number)}`)
})
Requirements
- Your PBX must accept WebRTC (SIP over secure WebSocket,
wss://) — e.g. Asterisk/FreePBX with WebRTC enabled on the extension, FreeSWITCH, Kamailio. Ask your provider for the WSS address. - HTTPS: browsers only allow the microphone on secure pages (and on
localhostwhile developing). - Content-Security-Policy: if your app sends one, allow
script-src https://www.astephon.ccandframe-src https://www.astephon.cc. - The browser asks each agent once for microphone access for your site.
API reference
Astephon.init(options)
| Option | Default | What it does |
|---|---|---|
account | — | SIP account: domain, wss, username, password, optional authUsername, displayName, label, stunServer, dtmfMode ('rfc2833' | 'info'), voicemailNumber. |
enabled | 'agent' | 'agent': each agent turns Astephon on/off (remembered). true: always on. false: off — nothing loads, phone links go to the default phone app. |
defaultEnabled | true | With 'agent': whether a new agent starts with Astephon on. |
user | — | Your CRM's user id: on/off per agent, and a clean phone when another user logs in on the same browser. |
pbx | — | { domain, wss }: your PBX, pre-filled when an agent adds their account (they only type extension and password). |
switch | true | Show the small Astephon off switch while it is off. |
onDisabledCall | — | (number, uri) => …: what call() does while Astephon is off (default: the computer's phone app). |
settings | — | Phone settings, e.g. { language: 'sq', theme: 'dark', dnd: false, recordAll: true, autoAnswer: false }. |
clickToCall | true | Dial tel:/sip:/callto: links on the page. |
launcher | true | Show the round phone button. Use false to open the phone from your own button with Astephon.toggle(). |
position | 'bottom-right' | Or 'bottom-left'. |
open | false | Open the phone right away. |
openOnIncoming | true | Open the phone when a call comes in. |
openOnCall | true | Open the phone when you dial. |
Methods
| Method | What it does |
|---|---|
call(number) | Dial a number, extension, tel: or sip: URI — with Astephon if on, otherwise with the default phone app. |
enable() · disable() · isEnabled() | Turn Astephon on or off for this agent (e.g. from your CRM's user menu). |
answer() · reject() · hangup() | For the ringing / current call (or pass a call id). |
mute(on) · hold(on) · dtmf(digits) · transfer(number) | Control the current call. |
configure(account) | Add or update the SIP account (same fields as init). |
settings(patch) | Change phone settings. |
open() · close() · toggle() · isOpen() | Show or hide the phone. |
on(event, fn) · off(event, fn) | Listen to events (below). |
enableNotifications() | Call from a click: shows incoming calls as notifications while your app is in the background. |
destroy() | Remove the phone from the page. |
Events
| Event | Data |
|---|---|
ready | { version, accounts, status } — the phone is loaded. |
status | { id, state, reason } — state: registering, registered, failed, … |
incoming | { id, number, name } — a call is ringing. |
answered | { id, number, name, direction } — a call was connected. |
ended | { id, direction, number, name, status, reason, startedAt, answeredAt, endedAt, durationSec, recording? } — status: answered, missed, rejected, busy, cancelled, failed, forwarded, elsewhere. Times are milliseconds since 1970. |
call | Every change of a call (full call state). |
error | { message } — e.g. no account, number not found. |
enabled · disabled | The agent turned Astephon on or off. |
configured | { accounts, accountId } — the account from init was applied. |
open · close | The phone panel was shown or hidden. |
Security: only pass SIP passwords to agents who are logged in to your app, and serve your app over HTTPS. The phone keeps its settings in that agent's browser, separately for each site it is embedded in.
Browser extension for any CRM
For CRMs you can't change (HubSpot, Salesforce, Zoho, Pipedrive, Bitrix24 …) or to call from any web page. Chrome and Edge.
- The phone opens in the browser's side panel — next to your CRM, not in another window.
- Phone links dial in Astephon. Select any phone number and press Call, or right-click → Call with Astephon.
- Incoming calls show a notification.
Download the extension (22 KB)
Install
- Unzip
astephon-extension.zipinto a folder you keep (e.g.Documents\Astephon extension). - Open
chrome://extensions(Edge:edge://extensions) and turn on Developer mode. - Click Load unpacked and choose that folder.
- The welcome page opens: click Allow microphone. Then click the Astephon icon in the toolbar and add your SIP account.
Keep the side panel open to receive calls. Publishing the extension in the Chrome Web Store / Edge Add-ons makes it a one-click install for your team.