CallDetailRecord¶
-
public class
CallDetailRecord
¶ The call detail record is the object persisted for every call from and to MOTECH by the IVR module. It represents the details of the call, and is stored in the database for auditing purposes.
Fields¶
Constructors¶
CallDetailRecord¶
-
public
CallDetailRecord
()¶ Creates a new CallDetailRecord and sets the motechTimestamp value to the current datetime.
CallDetailRecord¶
-
public
CallDetailRecord
(String configName, String providerTimestamp, String from, String to, CallDirection callDirection, String callStatus, String templateName, String motechCallId, String providerCallId, Map<String, String> providerExtraData, String callDuration, String messagePercentListened)¶ Creates a new CallDetailRecord and sets the motechTimestamp value to the current datetime.
Parameters: - configName – the name of the IVR configuration used for the call this record corresponds to
- providerTimestamp – the timestamp for this call from the IVR provider
- from – the initiator of this call
- to – the recipient of this call
- callDirection – the direction of this call
- callStatus – the status of this call
- templateName – the name of the template associated with this call
- motechCallId – the id for this call generated by MOTECH
- providerCallId – the id for this call generated by the IVR provider
- providerExtraData – the extra data coming from the provider
Methods¶
getCallDirection¶
-
public CallDirection
getCallDirection
()¶ Returns: the direction of this call
getCallStatus¶
getConfigName¶
getCurrentTimestamp¶
getFrom¶
getMessagePercentListened¶
getMotechCallId¶
getMotechTimestamp¶
getProviderCallId¶
getProviderExtraData¶
getProviderTimestamp¶
getTemplateName¶
getTo¶
setConfigName¶
setField¶
-
public void
setField
(String key, String val, Map<String, String> callStatusMapping)¶ When receiving call detail information from an IVR provider the specific call details must be mapped from what the provider sends back to MOTECH and a CallDetailRecord object. This method will find which field on the given callDetailRecord matches the given key and set service to the given value. If there is no matching CallDetailRecord field, then the key/value pair is added to the providerExtraData map field.
Parameters: - key – the name of the field to set
- val – the value to set
- callStatusMapping – the map which contains mapping for call status. It is used to change status value in the cdr log.