1. Quickstart
CallerAPI Documentation
  • Quickstart
  • Use cases
    • For carriers (MNOs/MVNOs)
    • CPaaS platforms
    • Cloud communications providers
    • SIP trunking providers
    • PBX/Cloud PBX
    • UCaaS vendors
  • Account
    • Balance and email
      GET
  • Spam protection
    • Voice firewall
      • Get started
      • Quickstart
        • What you get
        • Before you start
        • Test with a recording
        • Connect your switch
        • Switch notes
        • Twilio and Telnyx
        • Send text instead of audio
      • Verdicts
        • Read a verdict
        • What to do with a verdict
        • Block a caller
        • Events and webhooks
      • Honeypot
        • Hand a call over
        • Audio, events, and limits
      • Reference
        • Endpoints
        • Errors
        • Limits and thresholds
        • Production checklist
      • REST
        • What this deployment can do
        • List the verdict categories
        • List the honeypot personas
        • Score a transcript or a recording
        • List your recent sessions
        • Get one session with verdict and intel
        • Twilio voice URL for a screened number
        • Preview the Twilio TwiML
        • Telnyx voice URL for a screened number
        • Twilio voice URL for a honeypot number
        • Telnyx voice URL for a honeypot number
      • WebSocket
        • Live scam filter stream
        • Honeypot stream
    • Daily spam reports
      • Webhook
        • Subscribe to daily reports
        • Unsubscribe from daily reports
        • List webhook subscriptions
        • Manual dispatch of reports
        • Test webhook
      • REST
        • Fetch daily spam reports
    • 15 days spam CSV snapshot
      GET
    • Spam score + HLR
      GET
  • Mobile SDK
    • Get started
    • Quickstart
      • What you get
      • Get your keys
      • Android
      • iOS
      • Flutter
      • React Native
      • Check it works
    • Call screening
      • What each platform can do
      • Android call screening
      • iOS prerequisites
      • iOS add the extension
      • iOS test on device
    • Reference
      • Methods
      • Errors
      • Limits and billing
      • Troubleshooting
  • Data partners
    • Partner tems & docs
    • Upload spam reports
    • Upload contacts
  • Fraud prevention
    • Ported date
    • Porting history
    • Online presence
    • KYC user identity
  • Schemas
    • Spam protection
      • Spam score request
      • Business info
      • Carrier info
      • Complaint (without number)
      • Daily spam reports request
      • Complaint (with phone)
  1. Quickstart

Switch notes

How to get the caller's audio out of each switch and onto the socket. The protocol itself is on Connect your switch.

FreeSWITCH with mod_audio_fork#

mod_audio_fork opens a WebSocket, sends one text frame with the metadata you give it, then streams 16-bit PCM. Pass our start message as the metadata.
uuid_audio_fork <uuid> start wss://api.callerapi.com/api/voice/filter/stream?key=YOUR_KEY mono 8k {"type":"start","call_id":"<uuid>","from":"+15559990000","to":"+15551234567","sample_rate":8000,"encoding":"pcm16","params":{"webhook":"https://example.com/hook","language":"en"}}
1.
Run it on the caller's leg, with mono, so only the caller's speech is sent.
2.
Check the argument order against your module version. Older builds take the metadata in a different position.
3.
Use the webhook parameter to act on events. The fork does not expose socket messages to the dialplan.
4.
Stop the fork when the call ends, or let the socket close with the channel. Both end the session.

Asterisk#

Asterisk sends external media by RTP or by AudioSocket. Neither is a WebSocket. Run a small bridge next to Asterisk:
1.
Use ARI externalMedia or the AudioSocket dialplan application on the caller's channel.
2.
Receive the RTP or AudioSocket stream in the bridge.
3.
Decode to 16-bit PCM, or pass G.711 mu-law through as mulaw.
4.
Speak the protocol to wss://api.callerapi.com.
The script on Test with a recording is a working client. Replace the WAV reader with your RTP or AudioSocket reader.

Kamailio and other SIP proxies#

Kamailio handles signaling only. Fork the media with RTPEngine or your media server into a bridge as described for Asterisk. Send the From or P-Asserted-Identity number and the SIP Call-ID to the bridge so it can fill from and call_id.

SBCs and media servers#

Any component that can open a WebSocket, send one JSON text frame, and then send binary frames can connect. Most SBC vendors expose this as "media forking" or "SIPREC to WebSocket". Set the encoding to mulaw when the SBC forks G.711 as is.

Twilio and Telnyx#

You do not open a socket. You point the number at CallerAPI. See Twilio and Telnyx.

The CallerAPI SIP firewall#

If your domain is already on the CallerAPI SIP firewall, you do not need a socket to reach the honeypot. One setting hands spam calls to a persona. See Hand a call over.
Modified at 2026-09-18 16:56:47
Previous
Connect your switch
Next
Twilio and Telnyx
Built with