Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/environment/common_example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ grievanceAllocationRetryConfiguration=3
logging.path=logs/
logging.file.name=logs/common-api.log

video-call-url=https://vc.piramalswasthya.org/
video-call-url=https://vc.piramalswasthya.org/?
jibri.output.path=/srv/jibri/recordings
video.recording.path=/srv/recordings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ public String sendSMS(
}
logger.debug("sendSMS sending response " + response);
logger.info("sendSMS sending response");
return response.toString();
String respStr = response.toString();
respStr = respStr.replace("\\u003d", "=")
.replace("\\u003c", "<")
.replace("\\u003e", ">")
.replace("\\u0026", "&");
return respStr;

}

}
26 changes: 12 additions & 14 deletions src/main/java/com/iemr/common/service/sms/SMSServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ public String getSMSTemplates(SMSRequest smsRequest) throws Exception {

@Override
public String updateSMSTemplate(UpdateSMSRequest smsRequest) throws Exception {
SMSTemplate smsTemplate = null;
SMSTemplate request = smsMapper.updateRequestToSMSTemplate(smsRequest);
int updateCount = smsTemplateRepository.updateSMSTemplate(request.getSmsTemplateID(), request.getDeleted());
if (updateCount > 0) {
smsTemplate = smsTemplateRepository.findBySmsTemplateID(request.getSmsTemplateID());
} else {
throw new Exception("Failed to update the result");
}
return OutputMapper.gsonWithoutExposeRestriction().toJson(smsMapper.smsTemplateToResponse(smsTemplate));
SMSTemplate smsTemplate = null;
SMSTemplate request = smsMapper.updateRequestToSMSTemplate(smsRequest);
int updateCount = smsTemplateRepository.updateSMSTemplate(request.getSmsTemplateID(), request.getDeleted());
if (updateCount > 0) {
smsTemplate = smsTemplateRepository.findBySmsTemplateID(request.getSmsTemplateID());
} else {
throw new Exception("Failed to update the result");
}
return OutputMapper.gsonWithoutExposeRestriction().toJson(smsMapper.smsTemplateToResponse(smsTemplate));
}

@Override
Expand Down Expand Up @@ -347,18 +347,17 @@ public SMSNotification prepareVideoCallSMS(SMSRequest request, VideoCallParamete
sms.setPhoneNo(request.getFacilityPhoneNo());
}
}

sms.setSms(smsToSend);
return smsNotification.save(sms);
return smsNotification.save(sms);
}


public String getVideoCallData(String methodName, VideoCallParameters videoCall) throws Exception {
String variableValue = "";
switch (methodName.toLowerCase()) {
case "videoconsultationlink":
variableValue = videoCall.getMeetingLink() != null ? videoCall.getMeetingLink() : "";
break;
variableValue = videoCall.getMeetingLink() != null ? videoCall.getMeetingLink() : "";
break;
case "consultationdate":
if (videoCall.getDateOfCall() != null) {
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Expand All @@ -377,7 +376,6 @@ public String getVideoCallData(String methodName, VideoCallParameters videoCall)
variableValue = result != null ? result.toString() : "";
break;
}

return variableValue.trim();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,23 @@ public class VideoCallServiceImpl implements VideoCallService {
@Autowired
private VideoCallMapper videoCallMapper;

@Value("${video-call-url}")
private String meetingLink;

private boolean isLinkSent = false;
private String consultationStatus = "Not Initiated";

@Value("${video-call-url}")
private String jitsiLink;

public VideoCallServiceImpl() {
// this.jitsiLink = ConfigProperties.getPropertyByName("video-call-url");
// logger.info("Jitsi Link fetched: " + this.jitsiLink);
}

@Override
public String generateMeetingLink() {
meetingLink=jitsiLink+RandomStringUtils.randomAlphanumeric(8);
logger.info("Jitsi Link: " + jitsiLink);
meetingLink=jitsiLink+"m="+RandomStringUtils.randomAlphanumeric(8);
logger.info("Meeting link: " + meetingLink);
return meetingLink;
}
Expand All @@ -72,7 +75,10 @@ public String sendMeetingLink(VideoCallRequest request) throws Exception {
response.setResponse(responseData.toJson());

return OutputMapper.gsonWithoutExposeRestriction()
.toJson(response);
.toJson(response) .replace("\\u003d", "=")
.replace("\\u003c", "<")
.replace("\\u003e", ">")
.replace("\\u0026", "&");
}

@Override
Expand Down
Loading