diff --git a/src/main/environment/common_test.properties b/src/main/environment/common_test.properties
index 5c5514bb..2fae65eb 100644
--- a/src/main/environment/common_test.properties
+++ b/src/main/environment/common_test.properties
@@ -13,6 +13,7 @@ spring.datasource.driver-class-name=com.mysql.jdbc.Driver
 secondary.datasource.username=<Enter your DB_REPORTING username>
 secondary.datasource.password=<Enter your DB_REPORTING password>
 secondary.datasource.url=<Enter DB_REPORTING URL here>
+secondary.datasource.driver-class-name=com.mysql.jdbc.Drive
 
 encDbUserName=zFlYsp9Z0s+lRvLM15A3g/Ba0w8VGs/1usuW7EsGF3k=
 encDbPass=JGGAGn5wTlrbTLUHY+5BzfBa0w8VGs/1usuW7EsGF3k=
diff --git a/src/main/java/com/iemr/common/controller/nhmdashboard/NHMDetailCallReportScheduler.java b/src/main/java/com/iemr/common/controller/nhmdashboard/NHMDetailCallReportScheduler.java
index 8a9d4aed..3451d56f 100644
--- a/src/main/java/com/iemr/common/controller/nhmdashboard/NHMDetailCallReportScheduler.java
+++ b/src/main/java/com/iemr/common/controller/nhmdashboard/NHMDetailCallReportScheduler.java
@@ -4,9 +4,13 @@
 import java.sql.Timestamp;
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Objects;
+import java.util.Set;
 
 import org.apache.xml.security.stax.config.ConfigurationProperties;
+import org.json.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,6 +21,7 @@
 
 import com.iemr.common.data.callhandling.BeneficiaryCall;
 import com.iemr.common.data.nhm_dashboard.DetailedCallReport;
+import com.iemr.common.repository.callhandling.IEMRCalltypeRepositoryImplCustom;
 import com.iemr.common.repository.nhm_dashboard.DetailedCallReportRepo;
 import com.iemr.common.repository.report.CallReportRepo;
 import com.iemr.common.utils.config.ConfigProperties;
@@ -31,12 +36,14 @@ public class NHMDetailCallReportScheduler {
 	@Autowired
 	private CallReportRepo callReportRepo;
 
+	@Autowired
+	private IEMRCalltypeRepositoryImplCustom iEMRCalltypeRepositoryImplCustom;
+
 	Logger logger = LoggerFactory.getLogger(this.getClass().getName());
 
 	@Value("${start-ctidatacheck-scheduler}")
 	private boolean startCtiDataCheckFlag;
 
-
 	@Scheduled(cron = "${cron-scheduler-ctidatacheck}")
 	public void detailedCallReport() {
 		if (startCtiDataCheckFlag) {
@@ -48,7 +55,7 @@ public void detailedCallReport() {
 				String[] dateArr = date.toString().split("T");
 				endDate = dateArr[0].concat(" 23:59:59");
 				fromDate = dateArr[0].concat(" 00:00:01");
-
+                
 				Timestamp fromTime = Timestamp.valueOf(fromDate);
 				Timestamp endTime = Timestamp.valueOf(endDate);
 				logger.info("Call detailed report check request - FromTime -" + fromTime + "Endtime - " + endTime);
@@ -57,19 +64,52 @@ public void detailedCallReport() {
 				for (DetailedCallReport detailedCallReport : findByCallStartTimeBetween) {
 					String phoneNo = detailedCallReport.getPHONE();
 					String sessionID = detailedCallReport.getSession_ID();
-					int existRecord = callReportRepo.getBenCallDetailsBySessionIDAndPhone(sessionID, phoneNo);
-					if (existRecord != 0) {
+					BeneficiaryCall existRecord = callReportRepo.getBenCallDetailsBySessionIDAndPhone(sessionID,phoneNo);
+					if (existRecord != null) {
 						logger.info("Record already present in t_bencall table with sessionID : " + sessionID
 								+ " phoneNo : " + phoneNo);
+						logger.info("Existing record from t_bencall: " + existRecord);
 						if (null != detailedCallReport.getOrientation_Type()
 								&& detailedCallReport.getOrientation_Type().equalsIgnoreCase("OUTBOUND")) {
-							callReportRepo.updateIsOutboundForCall(true, sessionID, phoneNo );
+							
+							if(existRecord.getCallTypeID() == null) {
+								logger.info("Called Service Id: " + existRecord.getCalledServiceID());
+							// Fetching callTypeId
+							Integer callTypeId = getCallTypeId(true, existRecord.getCalledServiceID(),
+									detailedCallReport);
+							
+							logger.info("CallTypeId after comparison: " + callTypeId);
+							if (callTypeId != null) {
+								callReportRepo.updateIsOutboundForCallWithCallType(true, sessionID, phoneNo,callTypeId);
+							} else {
+								callReportRepo.updateIsOutboundForCall(true, sessionID, phoneNo);
+							}
+							}
+							else {
+								callReportRepo.updateIsOutboundForCall(true, sessionID, phoneNo);
+							}
 						} else {
-							callReportRepo.updateIsOutboundForCall(false, sessionID, phoneNo );
+							if(existRecord.getCallTypeID() == null) {
+								
+								logger.info("Called Service Id: " + existRecord.getCalledServiceID());
+							// Fetching callTypeId
+							Integer callTypeId = getCallTypeId(false, existRecord.getCalledServiceID(),
+									detailedCallReport);
+
+							logger.info("CallTypeId after comparison: " + callTypeId);
+							if (callTypeId != null) {
+								callReportRepo.updateIsOutboundForCallWithCallType(false, sessionID, phoneNo, callTypeId);
+							} else {
+								callReportRepo.updateIsOutboundForCall(false, sessionID, phoneNo);
+							}
+							
+						}
+							else {
+								callReportRepo.updateIsOutboundForCall(false, sessionID, phoneNo);
+							}
 						}
 					} else {
-						logger.info("Record missed in t_bencall table with sessionID : " + sessionID + " phoneNo : "
-								+ phoneNo);
+						logger.info("Record missed in t_bencall table with sessionID : " + sessionID + " phoneNo : " + phoneNo);
 						BeneficiaryCall callDetail = getCallDetail(detailedCallReport);
 						callReportRepo.save(callDetail);
 					}
@@ -82,6 +122,36 @@ public void detailedCallReport() {
 
 	}
 
+	private Integer getCallTypeId(Boolean isOutbound, Integer calledServiceId, DetailedCallReport detailedCallReport) {
+		Set<Objects[]> callTypesArray = new HashSet<Objects[]>();
+
+		if (detailedCallReport.getAgent_Disposition_Category() != null
+				&& detailedCallReport.getAgent_Disposition() != null) {
+			if (isOutbound == true) {
+				callTypesArray = iEMRCalltypeRepositoryImplCustom.getOutboundCallTypes(calledServiceId, true);
+			} else {
+				callTypesArray = iEMRCalltypeRepositoryImplCustom.getInboundCallTypes(calledServiceId, true);
+			}
+
+			for (Object[] object : callTypesArray) {
+				String callGroupType = (String) object[3];
+				String callType = (String) object[0];
+				String detailedCallGroupType = detailedCallReport.getAgent_Disposition_Category().replace("_", " ");
+				String detailedCallType = detailedCallReport.getAgent_Disposition().replace("_", " ");
+				logger.info("Detailed Call - CallGroupType: " + detailedCallGroupType);
+				logger.info("Detailed Call - CallType: " + detailedCallType);
+				
+				if (callGroupType.equalsIgnoreCase(detailedCallGroupType)
+						&& callType.equalsIgnoreCase(detailedCallType)) {
+					return (Integer) object[1];
+				}
+			}
+		}
+
+		return null;
+
+	}
+
 	private BeneficiaryCall getCallDetail(DetailedCallReport detailedCallReport) {
 		BeneficiaryCall beneficiaryCall = new BeneficiaryCall();
 		beneficiaryCall.setCallID(detailedCallReport.getSession_ID());
@@ -104,7 +174,8 @@ private BeneficiaryCall getCallDetail(DetailedCallReport detailedCallReport) {
 		beneficiaryCall.setCreatedBy("Admin");
 
 		beneficiaryCall.setCallDuration(String.valueOf(detailedCallReport.getCall_Duration()));
-
+		
+		
 		return beneficiaryCall;
 
 	}
diff --git a/src/main/java/com/iemr/common/repository/report/CallReportRepo.java b/src/main/java/com/iemr/common/repository/report/CallReportRepo.java
index 3104427e..2e1e4dba 100644
--- a/src/main/java/com/iemr/common/repository/report/CallReportRepo.java
+++ b/src/main/java/com/iemr/common/repository/report/CallReportRepo.java
@@ -44,13 +44,18 @@ public interface CallReportRepo extends CrudRepository<BeneficiaryCall, Integer>
 			+ "and report.createdDate >= :startDate and report.createdDate <= :endDate ")
 	public List<BeneficiaryCall> getAllBenCallIDetails(@Param("startDate") Timestamp startDate, @Param("endDate") Timestamp endDate);//start date and end date as param for x days.
 
-	@Query("SELECT COUNT(*) FROM BeneficiaryCall call WHERE call.callID = :sessionID and call.phoneNo = :phoneNo")
-	public int getBenCallDetailsBySessionIDAndPhone(@Param("sessionID") String sessionID,@Param("phoneNo") String phoneNo);
+	@Query("SELECT call FROM BeneficiaryCall call WHERE call.callID = :sessionID and call.phoneNo = :phoneNo")
+	public BeneficiaryCall getBenCallDetailsBySessionIDAndPhone(@Param("sessionID") String sessionID,@Param("phoneNo") String phoneNo);
 	
 	@Transactional
 	@Modifying
 	@Query("update BeneficiaryCall set isOutbound= :isOutbound where callID = :callID and phoneNo= :phoneNo")
 	public int updateIsOutboundForCall(@Param("isOutbound") boolean isOutbound, @Param("callID") String callID, @Param("phoneNo") String phoneNo );
+	
+	@Transactional
+	@Modifying
+	@Query("update BeneficiaryCall set isOutbound= :isOutbound, callTypeID= :callTypeID where callID = :callID and phoneNo= :phoneNo")
+	public int updateIsOutboundForCallWithCallType(@Param("isOutbound") boolean isOutbound, @Param("callID") String callID, @Param("phoneNo") String phoneNo, @Param("callTypeID") Integer callTypeID );
 }
 
 
