Tutorial: 06. End the call

06. End the call

Ending call event

onCallEnds

When the call ends, thsi event retrieves the dialog time and the calkey

/**
 * @description Dialog time and calkey when the call is finished.
 * @event onCallEnds 
 * @param {JSON} callData {dialogTime:int, callKey:String}
 * @example {dialogTime:125, callKey:"0000-1"}
 * @tutorial OnCallEnd
 */
function onCallEnds(message) {
    console.log("onCallEnds", message);
    document.getElementById("endCalldialogTxt").value = message.dialogTime;
    document.getElementById("endCallKeyTxt").value = message.callKey;
    printToConsole("Call completed with " + message.dialogTime + " seconds of dialog time.");
}