Configure HTTP webhooks on Vobiz SIP trunks to receive real-time call events globally - call admitted, rejected, or ended with duration, cost, and quality metrics.
Vobiz supports real-time HTTP webhook notifications on SIP trunk calls. Configure a webhook URL on any trunk to receive callbacks for two events: when a call is initiated (admitted or rejected) and when a call ends (with full details including duration, cost, and quality metrics).
Configure in the ConsoleWebhook URL and method are configured per trunk in the Vobiz Console → SIP → Outbound Trunks. You can also set them when creating or updating a trunk via the API.
Fired for every outbound call attempt during call admission, whether the call is allowed or rejected. Use this event for real-time call monitoring and rejection alerting.Fires when:
Fired when a call ends. Includes the full call record - duration, billable seconds, ring time, cost, currency, and voice quality metrics (MOS score and jitter).
Field
Type
Description
Duration
integer
Total call duration in seconds (ring + talk time).
Billsec
integer
Billable seconds - time the call was actually connected.
RingTime
integer
Time in seconds the call rang before being answered.
Cost
float
Call cost deducted from account balance.
Currency
string
Currency of the cost (e.g. INR).
MOS
float
Mean Opinion Score - voice quality (1.0–5.0, higher is better).
Because webhooks are delivered to a publicly reachable URL, verify each request before trusting it. Compute an HMAC-SHA256 over the raw request body using your trunk’s signing secret and compare it in constant time against the signature header on the request. Use X-Vobiz-Request-ID to de-duplicate retries and tie the CallInitiated and Hangup events for the same call together.
import hmac, hashlibfrom flask import request, abortSIGNING_SECRET = "your-trunk-signing-secret"def verify(raw_body: bytes, signature: str) -> bool: expected = hmac.new(SIGNING_SECRET.encode(), raw_body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, signature or "")@app.post("/vobiz/trunk-webhook")def handle(): raw = request.get_data() # raw bytes, before JSON parsing sig = request.headers.get("X-Vobiz-Signature", "") if not verify(raw, sig): abort(401) event = request.get_json() # event["Event"] is "CallInitiated" or "Hangup" return "", 200
Confirm the signature header and secret. The exact signature header name and the per-trunk signing secret are configured in the Console; confirm both against your account before enforcing verification. The snippets above show the HMAC-SHA256 pattern - keep the comparison constant-time and always hash the raw body, not the re-serialized JSON.
All webhooks are sent asynchronously. Webhook requests never delay the SIP call flow - call admission and CDR processing proceed independently of webhook delivery.
Webhooks are one-way notifications. The response from your endpoint does not influence call routing, billing, or any platform behavior. You cannot accept or reject calls via a webhook response.