Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vobiz.ai/llms.txt

Use this file to discover all available pages before exploring further.

Stream call events to your CRM during a live conversation using LiveKit function tools and HMAC-signed webhooks.

View on GitHub

Clone and run the full working example

Getting started

git clone https://github.com/vobiz-ai/Livekit-Vobiz-Webhook-Integration-Example.git
cd Livekit-Vobiz-Webhook-Integration-Example
pip install -r requirements.txt
python agent.py dev

Overview

The agent loads call metadata from your CRM before the call connects, then dispatches signed webhook events throughout the call lifecycle. During the conversation, the agent has access to four function tools that send non-blocking HTTP POSTs to your backend without interrupting the audio stream.

Agent function tools

ToolDescription
record_intentLog a custom intent note to the CRM mid-call
lookup_crmFetch customer data by phone number
update_crm_noteAppend a note to the active customer record
transfer_callTransfer the caller to a human agent via SIP REFER

Webhook events

EventWhen it fires
call.startedImmediately when the agent joins the room
call.endedWhen the call disconnects
intent.recordedWhen the agent calls record_intent
crm.updatedWhen the agent calls update_crm_note
All webhook payloads are signed with HMAC SHA-256 using your WEBHOOK_SECRET.

Key code

@llm.function_tool(description="Log a custom intent note to the CRM mid-call")
async def record_intent(context: llm.FunctionContext, intent: str):
    """Asynchronous webhook POST executed during audio streaming"""
    async with aiohttp.ClientSession() as session:
        await session.post(
            f"{CRM_URL}/webhooks/intent",
            json={"intent": intent, "call_id": call_id},
            headers={"X-Signature": compute_hmac(payload)}
        )

Environment variables

.env
LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=APIxxxxxxxxxxxxx
LIVEKIT_API_SECRET=secretxxxxxxxxxx
CRM_URL=https://your-crm.example.com
WEBHOOK_SECRET=your-hmac-secret
OPENAI_API_KEY=sk-...