Blog

Call Webhooks and Live Call Routing From Your System

What call webhooks are, how every call's details reach your system the moment it ends, and how your system can decide live where an incoming call goes.

Quick summary
  • Call webhooks mean your phone system sends your own systems the details of every call the moment it ends: numbers, direction, duration, who answered, queue and the call journey.
  • In Klamna the event is call.ended, delivered as a signed request to any URL you choose.
  • The reverse also exists: a "dynamic destination", where the PBX asks your system during ringing where the call should go.
  • If your system does not answer in time, the call goes to a fallback and is never lost.

Most companies treat their phone system as an island: calls happen, reports live inside the PBX, and the rest of the business never hears about them. Call webhooks change that: when a call ends, your system receives its full details, so you can log it internally, update the customer file, calculate commission or trigger a follow-up.

This guide also covers the other direction: letting your system decide where an incoming call goes as it arrives. Both are part of Klamna's API and webhooks and work with the cloud PBX and call center.

What are call webhooks?

Instead of your system repeatedly asking "any new calls?", Klamna tells it when something happens. You register a URL, choose the events you care about, and each event sends a request with the data.

The key call event is call.ended. It carries:

  • Caller and dialled numbers, and direction (inbound, outbound, internal).
  • Start and end time, ringing time and talk time.
  • The outcome: answered, not answered, busy, dropped.
  • Who answered (extension or agent) and the queue it passed through.
  • The call journey: IVR choices and any transfers.
  • The recording link where your settings and permissions allow.

An illustrative example of the shape of the data (the exact field names are in the API documentation):

{ "event": "call.ended", "direction": "inbound", "from": "9665XXXXXXXX", "answered_by": "201", "queue": "sales", "duration": 184 }

What to do with call webhooks

  • Log calls in your internal system (real-estate system, clinic system, ERP) without manual entry.
  • Follow up missed calls: create a call-back task for the responsible rep.
  • Performance and commission: call counts and durations per rep flow into payroll or incentives.
  • Order updates: a confirmation call ended, so the order status changes.
  • Management reporting in your own BI tools.

If you use HubSpot, Salesforce, Zoho, Odoo or vTiger you do not need webhooks: ready connectors push calls to the CRM. Webhooks are for your own systems.

Security and retries

  • Signed requests: Klamna signs every request with a secret and your system verifies it before accepting the data.
  • Retries: if your system is down, the request is retried later. Handle duplicates by checking the call ID before saving.
  • Answer fast: acknowledge immediately and do heavy processing afterwards.
  • Scoped keys: API keys have limited permissions you can revoke at any time, and core data stays on servers in the Kingdom.

Live call routing from your system: dynamic destinations

Webhooks tell you after the call. A dynamic destination lets your system decide while it rings. In the call flow (after the 9200 number or an IVR option, for example) you add an "ask my system" step. The PBX sends your URL the caller and dialled numbers, and your system answers: send it to this extension, this queue or this IVR.

  • Key accounts to their account manager instead of the general queue.
  • Open ticket → support, skipping the menu.
  • Overdue invoice → collections.
  • Unknown number → sales.
  • By branch or city stored in your system.

For routing to the customer's owner inside Klamna itself, the sales team CRM has owner routing built in, with no code.

What if your system does not answer in time?

Callers do not wait for your server. Each dynamic step has a short timeout and a fallback destination: if your system is slow or returns something unclear, the call continues to the fallback (a general queue or IVR). An outage on your side never stops your calls. Keep the decision endpoint light: a simple lookup by mobile number.

How to start

  1. Create an API key, register the webhook URL and select call.ended.
  2. Verify the signature in your system and test with a real call.
  3. For dynamic routing, prepare the decision URL and add the step to the call flow with a fallback.
  4. Watch the logs during the first week.

If you want the AI agent itself to act inside your system (booking, lookups), see API actions and connecting AI to your own systems.

Frequently asked questions

Do call webhooks include unanswered calls?

Yes, call.ended fires for every finished call, with its outcome.

Is the recording link included?

Where your settings and recording permissions allow; the recording itself stays securely stored in the platform.

What if my system is down when the webhook fires?

The request is retried later. Ignore duplicates using the call ID.

Does a dynamic destination delay the call?

The decision happens within a short timeout you set; if your system is late, the call goes to the fallback.

Do I need webhooks if I use HubSpot or Zoho?

No, the ready connectors sync calls. Webhooks are for custom systems without a connector.

Want every call to reach your system and calls routed by your customer data? Talk to us and our well-equipped team will set it up with you, or sign up now, build your own package and see the price before you pay.