From f29856fb114054bec79a29511efd6bc2f597d1f2 Mon Sep 17 00:00:00 2001 From: Sanjiva Weerawarana Date: Sat, 16 Nov 2019 08:53:04 +0530 Subject: [PATCH] Added log for SMS sending (distributor) and also corrected test driver notification call --- distributor/src/distributor/messenger.bal | 1 + testdriver/src/testdriver/sendresults.bal | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/distributor/src/distributor/messenger.bal b/distributor/src/distributor/messenger.bal index 0d3c802..b0e43e1 100644 --- a/distributor/src/distributor/messenger.bal +++ b/distributor/src/distributor/messenger.bal @@ -53,6 +53,7 @@ function sendSMS(string message, string resultId) { log:printInfo("Sending SMS for " + resultId); } foreach string targetMobile in currentMobileSubscribers { + log:printInfo("Sending SMS for " + resultId + " to " + targetMobile); var response = twilioClient->sendSms(sourceMobile, targetMobile, message); if response is error { log:printError("Message sending failed for \'" + targetMobile + "\' due to error:" + diff --git a/testdriver/src/testdriver/sendresults.bal b/testdriver/src/testdriver/sendresults.bal index 2a45904..0045a76 100644 --- a/testdriver/src/testdriver/sendresults.bal +++ b/testdriver/src/testdriver/sendresults.bal @@ -302,16 +302,16 @@ function sendResult (http:Client hc, string electionCode, string resType, string http:Response hr; // sent alert - string params = "?level=" + result.level; + string params = "/?level=" + result.level; if result.ed_name is string { params += "&ed_name=" + check encoding:encodeUriComponent(result.ed_name, "UTF-8"); if result.pd_name is string { params += "&pd_name=" + check encoding:encodeUriComponent(result.pd_name, "UTF-8"); } } - hr = check hc->post ("/result/notification/" + electionCode + "/" + resType + "/" + resCode + "/?level=" + result.level, {}); + hr = check hc->post ("/result/notification/" + electionCode + "/" + resType + "/" + resCode + params, {}); if hr.statusCode != http:STATUS_ACCEPTED { - io:println("Error while posting result notification to: /result/notification/" + electionCode + "/" + resType + "/" + resCode); + io:println("Error while posting result notification to: /result/notification/" + electionCode + "/" + resType + "/" + resCode + params); io:println("\tstatus=", hr.statusCode, ", contentType=", hr.getContentType(), " payload=", hr.getTextPayload()); return error ("Unable to post notification for " + resCode); }