SIP trunking (bring your PBX)
Goal: connect an existing PBX (3CX, Asterisk, FreePBX, Yeastar, an SBC…) to Kolwire with SIP credentials, so its calls go out over our carriers and your numbers ring the PBX. Recording, transcription and AI are optional per connection.
Price: sip.inbound.minute / sip.outbound.minute (public price list: GET /v1/pricing/catalog, or the dashboard's /pricing page). No monthly fee per connection.
1. Create a connection
import { Kolwire } from "@kolwire/sdk";
const vi = new Kolwire();
const conn = await vi.sipConnections.create({
name: "Office 3CX",
max_channels: 8, // concurrent calls, both directions
default_caller_id: "+97237654321", // used when the PBX sends a number you don't own
allowed_countries: ["IL"], // outbound destinations (fraud guard)
});
console.log(conn.sip); // { username, password (shown once), realm, server, port: 5060, tls_port: 5061 }curl -X POST https://api.kolwire.com/v1/sip-connections \
-H "Authorization: Bearer $KOLWIRE_API_KEY" -H "Content-Type: application/json" \
-d '{"name":"Office 3CX","max_channels":8,"allowed_countries":["IL"]}'The password is returned only once. Rotate it with POST /v1/sip-connections/{id}/credentials.
2. Configure the PBX trunk
| PBX field | Value |
|---|---|
| Registrar / proxy | sip.server from the response |
| Port / transport | 5060 UDP or TCP, 5061 TLS |
| Auth username / password | sip.username / sip.password |
| Realm / domain | sip.realm |
| Register | yes |
| Outbound number format | E.164 (+972…) or national (03…, 05…): national numbers are parsed with your workspace region |
| Codecs | G.711 A-law / µ-law |
Outbound caller ID: if the PBX sends a number your workspace owns (or a verified caller ID), it is kept; otherwise the connection's default_caller_id, else your first number.
3. Route numbers to the PBX
await vi.numbers.update("pn_123", { voice_config: { mode: "sip_connection", connection_id: conn.id } });Inbound calls to that number ring the registered PBX. A connection can't be deleted while numbers point at it.
Limits and errors the PBX sees
| SIP response | Why |
|---|---|
403 Forbidden | connection disabled, outbound_enabled: false, destination outside allowed_countries, or blocked by compliance rules (DNC, calling hours) |
486 Busy Here | max_channels reached |
480 Temporarily Unavailable | inbound number routed to a disabled connection |
Add AI to trunk calls
Set recording_enabled / transcription_enabled on the connection (PATCH /v1/sip-connections/{id}) and trunk calls get recordings, transcripts and post-call summaries like any other call (billed with the usual recording.minute, transcription.minute and intelligence.call).
Registration status
GET /v1/sip-connections/{id} returns registration: status (registered, unregistered, expired, never), the PBX's contact, user_agent, ip and expires_at. The dashboard's SIP trunking page shows the same.
IP-authenticated trunks (no registration)
For PBXs and SBCs with a fixed public IP:
await vi.sipConnections.create({
name: "HQ SBC",
auth_type: "ip",
allowed_ips: ["212.150.33.7"], // public addresses or small ranges (IPv4 /24 or smaller, IPv6 /56 or smaller)
allowed_countries: ["IL"], // required for IP trunks (toll-fraud guard)
tech_prefix: "7788", // optional: the PBX dials 7788 before every number
inbound_host: "212.150.33.7", inbound_port: 5060, inbound_transport: "udp",
});- Calls from those addresses are accepted without a password and placed for that connection. Every address can belong to only one connection (409
ip_in_use). - Inbound calls to numbers routed to the connection are sent to
inbound_host:inbound_portwith the called number in the user part (sip:+972…@host). - Prefer TCP or TLS from the PBX: with UDP a spoofed source address can't receive replies, but it can still trigger a call.
allowed_countries,max_channelsandtech_prefixlimit the damage.