Skip to main content

Incoming Answered CDR

To receive the incoming answered cdr, you must complete the webhooks setup. After completing the webhooks setup, our TeleCMI platform will notify your web server POST or GET method URL with JSON Call Detail Record(CDR) when an incoming call answered.

Sample CDR response

This is the sample JSON Call Detail Record(CDR), where the TeleCMI platform will notify your web server POST or GET method URL.

{
virtual_number: 440000000000,
custom: '{"key":"value"}',
appid: 2222223,
type: 'cdr',
direction: 'inbound',
cmiuuid: '16132200-57fa-47b5-888d-4ab5b7e631ee',
user: '204_2222223',
status: 'answered',
to: 440000000001,
from: 440000000002,
time: 1634720920615,
answeredsec: 11,
team: 'Sales_2222223',
hangup_reason: 'recv_bye',
record: true,
filename: '1634720915260737218351_2222223.mp3',
conversation_uuid: '16132200-57fa-47b5-888d-4ab5b7e631ee',
ivr_name: 'salesivr'
}

The above sample JSON Call Detail Record(CDR) consists of several properties. Each property has a description, so take a look at it.

Properties

This is the list of properties and their descriptions.

PropertyTypeDescription
virtual_numbernumberThe caller ID of the inbound call.
customstringYour custom parameters.
appidnumberYour app id.
typestringType of notification from TeleCMI platform it may be cdr or event.
directionstringThe direction of this call is inbound.
cmiuuidstringA unique identifier for this call.
userstringA unique ID of the user.
statusstringThe status of this answered call.
tonumberThe user phone number.
fromnumberThe call was made from this number.
timenumberA timestamp indicates the time the call was answered.
answeredsecnumberThe duration of the call was answered in seconds.
teamstringName of the team where the call was answered.
hangup_reasonstring
  • sent_bye = The call ended by the user.
  • recv_bye = The call ended by the caller.
  • recv_cancel = The call ended due to user unanswer.
  • sent_reject = The call rejected by the user.
recordbooleanIf the record is enabled, it shows the status as true.
filenamestringThe file name of the recorded conversation.
conversation_uuidstringA unique identifier for this overall conversation.
ivr_namestringThe name of the last IVR stage touched by the customer during their call interaction.

Implementation

TeleCMI webhooks implementation in different languages.

from flask import Flask,request
app = 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 Platform
cdr = 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.