Skip to main content

AI Streaming

Each API request in TeleCMI platform includes App id and secret. Get your App id and secret in TeleCMI dashboard. After getting the app id and secret, make a POST request to the below base URL to enable or disable streaming.

Base URL

Send your POST method request with valid parameters, to the following base URL.

https://rest.telecmi.com/v2/setting/stream

Required Parameters

These are the required POST method parameters with description

Parameter NameTypeDescription
*appidnumberYour app ID
*secretstringYour app secret
*enablebooleanSet to true to enable streaming or false to disable it.
*ws_urlstringThe WebSocket URL where the audio stream will be sent.
*listen_modestringDetermines which part of the call audio is captured and stored
  • Caller: The voice of the person who initiated the call will be recorded and stored.
  • Both: the voices from both the caller and the callee will be recorded and stored.
Note
All the above parameters are mandatory.

Sample JSON Request

Below is the following sample JSON POST method request

{
"appid": 2221121,
"secret": "122xxxx-xxxx-xxxx-xxxx-xxxxa25",
"enable": true,
"ws_url": "ws://example.tcp.ngrok.url",
"listen_mode": "caller"
}

Sample Response

If the provided information is valid, your web server will get a sample response from TeleCMI Platform as given below

{
"code": 200,
"msg": "Stream Enabled"
}

HTTP status codes

TeleCMI API platform represents the following status code to identity the errors.

Status codeStatus typeDescription
200OKStream Enabled,Stream Disabled
404ErrorAuthentication failed
500ErrorInvalid Listener Mode