Search in sources :

Example 1 with VotoCallLogDto

use of org.motechproject.mots.dto.VotoCallLogDto in project mots by motech-implementations.

the class IvrService method saveCallDetailRecord.

/**
 * Save IVR Call Detail Record.
 * @param callDetailRecord callDetailRecord to be saved
 * @param configName name of the IVR config
 */
public void saveCallDetailRecord(CallDetailRecord callDetailRecord, String configName) throws IvrException {
    IvrConfig ivrConfig = ivrConfigService.getConfig();
    setConfigFields(callDetailRecord, ivrConfig, configName);
    callDetailRecordRepository.save(callDetailRecord);
    CallStatus callStatus = callDetailRecord.getCallStatus();
    boolean callInterrupted = CallStatus.FINISHED_INCOMPLETE.equals(callStatus);
    if (CallStatus.FINISHED_COMPLETE.equals(callStatus) || callInterrupted) {
        VotoCallLogDto votoCallLogDto = getVotoCallLog(callDetailRecord);
        moduleProgressService.updateModuleProgress(votoCallLogDto, callInterrupted);
    }
}
Also used : VotoCallLogDto(org.motechproject.mots.dto.VotoCallLogDto) CallStatus(org.motechproject.mots.domain.enums.CallStatus) IvrConfig(org.motechproject.mots.domain.IvrConfig)

Aggregations

IvrConfig (org.motechproject.mots.domain.IvrConfig)1 CallStatus (org.motechproject.mots.domain.enums.CallStatus)1 VotoCallLogDto (org.motechproject.mots.dto.VotoCallLogDto)1