Integration guide

Add a Call us button to any website.

A single <script> tag drops a floating call button onto your site. Visitors click it, land in a private CodeB meeting room, and the SIP bridge dials your team’s phone. No installs on either end. The visitor never sees your real phone number.

What it costs

Nothing per visitor. The widget is a static script you host yourself (no third-party CDN, no analytics). Each placed call uses one minute of whatever SIP trunk your CodeB SIP bridge is connected to — same as a normal outbound dial.

The minimum snippet

Paste this anywhere inside <body> — usually right before </body> so the script doesn’t block your page render:

<!-- CodeB Phone call-us button --> <script src="https://phone.codeb.io/embed.js" data-dial="n_xxxxxxxxxxxxxxxx" defer></script>

Replace n_xxxxxxxxxxxxxxxx with the alias of the phone you want clicks to dial. Aliases are defined in your CodeB deployment’s web.config under WebPhone:NumberAliases — ask your CodeB admin if you don’t know yours.

Why an alias, not the raw number?

The alias is an unguessable 16-character hex token (e.g. n_dbbe66524a5cd792). Bots scraping your page see the alias, not the actual phone number. To change which phone gets called, edit web.config on the CodeB server — you don’t need to touch the embedded snippet on your customer-facing page.

Customisation options

All attributes are optional except data-dial:

AttributeDefaultWhat it does
data-dial — required Destination alias (or raw E.164 / extension if you accept that risk). Resolves through your WebPhone:NumberAliases table.
data-label Call us Text displayed on the floating button.
data-position bottom-right Corner to place the button. One of bottom-right, bottom-left, top-right, top-left.
data-color #f5a524 Background colour of the button. Any valid CSS colour.
data-host script origin Host serving room.html. Override only if you self-host the CodeB frontend on a different domain than where this script lives.

Examples

Brand-coloured "Talk to sales" button, bottom-left:

<script src="https://phone.codeb.io/embed.js" data-dial="n_dbbe66524a5cd792" data-label="Talk to sales" data-position="bottom-left" data-color="#1f6feb" defer></script>

"Support hotline" with the support extension:

<script src="https://phone.codeb.io/embed.js" data-dial="n_069f8ae77accb13d" data-label="📞 Support hotline" defer></script>

Self-hosted CodeB at a custom domain:

<script src="https://meet.yourcompany.com/embed.js" data-dial="n_xxxxxxxxxxxxxxxx" data-host="https://meet.yourcompany.com" defer></script>

How it works

1

Visitor clicks the button

The widget mints a fresh, unguessable meeting-room name (something like callus-7k3p2m) and opens it in a new tab. Two visitors who click at the same time never end up in the same room as each other.

2

The browser joins the CodeB meeting room

Camera and microphone are requested. The visitor sees the standard CodeB meeting UI with their tile and a "waiting for the other party" message until the phone picks up.

3

The SIP bridge resolves the alias and dials

Your CodeB signaling server validates the dial request against the whitelist + fraud caps, looks the alias up in WebPhone:NumberAliases, and forwards it to the SIP bridge. The bridge dials through the configured trunk.

4

The phone rings, your team picks up

The answering phone joins the meeting room as an audio-only participant. The visitor and your team can talk — voice is end-to-end encrypted between the visitor’s browser and the CodeB SIP bridge.

Security & abuse considerations

The button is public, so anyone could click it. The CodeB SIP bridge enforces several gates against abuse:

If you want to rate-limit clicks before they reach the CodeB bridge (for example, behind a CAPTCHA on your site), you can intercept the click yourself by initialising the widget manually. Drop us a line if you need that variant.

Last updated for embed.js shipped with CodeB Phone 2026-05-25-3.