Outgoing Answered Webhooks
To receive the outgoing webhooks, you must complete the outgoing webhooks setup. After completing the outgoing webhooks setup, our TeleCMI platform will notify your web server POST method URL with JSON call detail record(CDR) when an outgoing call answered.
Implementation
TeleCMI webhooks implementation in different languages.
- Python
- Node.js
- PHP
- Java
from flask import Flask,requestapp = Flask(__name__)# Receive webhooks from TeleCMI platform when call receive or make@app.route("/webhook/cdr",methods=['POST'])def hello():# Received JSON CDR from TeleCMI Platformcdr = request.get_json()print(cdr)return "got it"if __name__ == "__main__":app.run(debug=True, port=5000)
To know more about testing webhooks for local development purposes, go to examples.
Sample CDR response
This is the sample JSON call detail record(CDR), where the TeleCMI platform will notify your web server POST method URL.
{"type": "cdr","appid": 1111113,"to": 9100000000,"cmiuuid": "760df326-7f03-4b5d-b573-278dec867f13","status": "answered","user": "103_1111113","time": 1570184401056,"direction": "outbound","answeredsec": 13,"click_to_call": "true","record": "true","filename": "157018440105699392452463833_1111113.mp3"}
The above sample JSON call detail record(CDR) consists of several properties. Each property has a description and take a look at it.
Properties
These are the list of properties and its description
Property | Type | Description |
---|---|---|
type | string | Type of notification from TeleCMI platform it may be cdr or event |
app_id | number | Your app id |
to | number | The number the call was made to |
cmiuuid | string | A unique identifier of this call |
status | string | Status of this call |
user | string | A unique Id of the user(agent) |
time | number | Timestamp of this call |
direction | string | The direction of this call it may be inbound or outbound |
answeredsec | number | The duration of the call answered in seconds |
click_to_call | string | This call is made through click to call api |
record | string | Call recording is enabled |
filename | string | The file name of the recorded conversation |