Voice Platform โ€” Integrations & Custom Tools

    The Branofy Voice platform supports setting up custom external tools, handling incoming DID phone number mappings, and receiving webhook event notifications.


    1. DID Routing (Direct Inward Dialing)

    Direct Inward Dialing allows incoming phone numbers to route calls directly to configured Voice Agents.

    How it works:

    1. SIP Registration: Register a phone number (e.g. from voicelink or a custom SIP provider) via POST /v1/dids.
    2. Call Ingestion: When a call is received, our Asterisk server captures the dialed number (DID), performs a lookup to retrieve the associated agent configuration, and joins the caller to the voice agent room.

    2. Webhook Event Notifications

    Workspaces can register webhooks to receive callbacks when specific events occur.

    Available Events:

    • call.ended: Dispatched immediately when a live call ends.

    Payload Schema (VoiceCallEndedWebhookDto)

    When a call ends, the registered URL receives a POST request with the following JSON structure:

    {
      "callId": "call_98765",
      "durationSeconds": 145,
      "ended": "2026-06-21T10:05:45Z",
      "endReason": "customer_hung_up",
      "joined": "2026-06-21T10:03:20Z",
      "transcript": [
        {
          "role": "agent",
          "text": "Hello, how can I help you today?"
        },
        {
          "role": "user",
          "text": "Yes, I wanted to confirm if my order shipped."
        },
        {
          "role": "agent",
          "text": "Yes, I see your order has been shipped and is out for delivery today."
        }
      ]
    }
    

    3. Custom Tools (Function Calling)

    Voice Agents can be equipped with custom tools to query database APIs or execute workflow actions mid-call.

    Tool Request Protocol

    When a voice agent decides to execute a tool, the platform sends an HTTP request to the tool's configured httpEndpoint with a JSON body:

    {
      "agentId": "agent_12345",
      "callId": "call_98765",
      "toolName": "check_balance",
      "parameters": {
        "accountNumber": "987654"
      }
    }
    

    Expected Tool Response Protocol

    Your API endpoint must return a JSON response quickly (ideally in < 500ms) to maintain conversational flow:

    {
      "result": "The current balance for account 987654 is INR 12,500.00."
    }
    

    The voice agent parses this response and speaks the result back to the user naturally.