Support forum

Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

Updating MessageLog entries with Delivery Reports
sp_NewPost Add Reply sp_NewTopic Add Topic
February 23, 2024
10:33 am
Andre du Preez

Thank you Henk

That explains it perfectly.

Kind regards

February 23, 2024
10:13 am
Henk Helmantel
Forum Posts: 1502
Member Since:
May 28, 2013
sp_UserOfflineSmall Offline

Hello Andre,

The Scripting Connector does not support the PostSendResultUpdate function, this function is only supported in the Scripting Gateway.

You can add the functionality of the HTTP server to the same Scripting Gateway that is sending the message via HTTP and use the PostSendResultUpdate from this script instead of the script in the Scripting Connector.

Regards, Henk

February 23, 2024
8:59 am
Andre du Preez

This is what my Script looks like now:

private string HandleDeliveryReport(Dictionary queryList)
string response = "OK";
string messageId = HttpUtility.UrlDecode(GetQueryValue(queryList, "messageId"));
string status = HttpUtility.UrlDecode(GetQueryValue(queryList, "status"));
string timeStamp = HttpUtility.UrlDecode(GetQueryValue(queryList, "nonce-date"));
DateTime deliveredTime = DateTime.Now;

deliveredTime = DateTime.ParseExact(timeStamp, "yyyyMMddHHmmss", null);
string logMessage = "messageId = " + messageId + ", status = " + status + ", timestamp = " + deliveredTime.ToString("yyyy-MM-dd HH:mm:ss");
PostEventLog("Delivery Report: " + logMessage, "", EventLog.Information);
PostSendResultUpdate(messageId, StatusCode.Received, status, "", "", deliveredTime);
catch (Exception e)
PostEventLog(e.Message, e.ToString(), EventLog.Error);

return response;

February 23, 2024
8:57 am
Andre du Preez

Hello Henk

I have implemented a scripting gateway that submits SMS to a service provider via HTTP and then records the MessageID that the service provider supplies in the SQL Database. The messages are immediately moved to the MessageLog table when the service provider accepts them.

I then created a scripting connector that instantiates an HTTP server. The service provider then sends delivery reports by posting them to the URL of my server. I can see the delivery reports coming in and I can extract the MessageID, the Status and the Timestamp. These delivery reports can take hours to arrive, so I don't want to wait for them after the SMS has been submitted but would prefer to update the status as and when they arrive.

I assumed that the PostSendResultUpdate Function should do the job to update the record in the MessageLog, but that's where I seem to be missing the boat. My scripting connector records the POST request in the event log, but the Status Update never reaches the record in the database.

How do I update records in the MessageLog table when handling delivery reports?

Kind Regards

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 529

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Member Stats:

Guest Posters: 677

Members: 0

Moderators: 0

Admins: 1

Forum Stats:

Groups: 2

Forums: 3

Topics: 1149

Posts: 3928

Newest Members:

, Henk Helmantel

Administrators: Henk Helmantel: 1502