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:
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:
| Attribute | Default | What 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:
"Support hotline" with the support extension:
Self-hosted CodeB at a custom domain:
How it works
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.
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.
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.
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:
- Strict number whitelist: the bridge only dials numbers explicitly enumerated by the operator. The alias resolves to a whitelisted number or the call is refused.
- Per-call fraud caps: hard limits on concurrent outbound calls, max call duration, calls-per-day per requester IP, calls-per-day per room.
- Geographic prefix restriction: deployable as European-only or any subset of country codes.
- Per-call duration limit: calls that run past the configured maximum are hung up automatically.
- Activity log: every dial — placed, rejected, completed — is recorded in the on-prem dial log.
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.