Astephon inside your CRM

Click any phone number to call, see who is calling before you answer, and save every call to the right customer — in your own web app or in any CRM through the browser extension.

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.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

API reference

Astephon.init(options)

OptionDefaultWhat 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.
defaultEnabledtrueWith '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).
switchtrueShow 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 }.
clickToCalltrueDial tel:/sip:/callto: links on the page.
launchertrueShow the round phone button. Use false to open the phone from your own button with Astephon.toggle().
position'bottom-right'Or 'bottom-left'.
openfalseOpen the phone right away.
openOnIncomingtrueOpen the phone when a call comes in.
openOnCalltrueOpen the phone when you dial.

Methods

MethodWhat 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

EventData
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.
callEvery change of a call (full call state).
error{ message } — e.g. no account, number not found.
enabled · disabledThe agent turned Astephon on or off.
configured{ accounts, accountId } — the account from init was applied.
open · closeThe 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.

Download the extension (22 KB)

Install

  1. Unzip astephon-extension.zip into a folder you keep (e.g. Documents\Astephon extension).
  2. Open chrome://extensions (Edge: edge://extensions) and turn on Developer mode.
  3. Click Load unpacked and choose that folder.
  4. 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.