Skip to main content

Call Flows

Call Flows are sets of instructions that you provide to Teler in order to control what happens with a call. In other words, they allow you to programmatically handle calls.


What is a flow_url?

The flow_url is an HTTPS endpoint exposed by your backend, which Teler uses to fetch call flows. Teler will make a request to the flow_url for all incoming calls to your account.

A typical request from Teler to your flow_url has the following schema.

Method: POST

Content-Type: application/json

Request Body:

{
"call_id": {CALL_ID},
"account_id": {ACCOUNT_ID},
"from_number": {FROM_NUMBER},
"to_number": {TO_NUMBER},
"direction": {CALL_DIRECTION}
}

Supported Flows

Stream

Stream flows are used to start Media streams.

A Stream flow has the following parameters.

  • ws_url: The WebSocket URL where you want to receive the call media.
  • chunk_size: Length of the streamed audio chunks by Teler, in milliseconds. Must be a value between 20 and 2000, and a multiple of 20. Default is 400.

Sample Flow

{
"action": "Stream",
"ws_url": "wss://yourdomain.com/media-stream",
"chunk_size": 1000
}

Dial

Coming soon...