Thanks! I was missing the 'using HttpServer;'... How silly of me not to see it earlier..
Now I am well on my way to a nice and working solution. Thanks a lot for your help!
The warning comes from the JSON library and can be ignored.
The two errors indicate that the wrong HTTPServer.dll library is loaded or that the 'using HttpServer;' line in the script is missing. You can try to specify the exact location of the HTTPServer.dll library by changing the line:
// AddReference HttpServer.dll
// AddReference C:\Program Files\Diafaan SMS Server\HttpServer.dll
The version of the .NET framework that you have installed should not matter, Diafaan SMS Server works with all versions of the .NET framework higher than 2.0. But if you use 3rd party or your own .NET library DLLs, you have to make sure that they are compile for .NET framework 2.0. The ClickSend script is a few years old but still up to date.
Thanks for the tip. I am having some difficulties though...
I am currently trying to just test the httpserver in my script but the compile button complains about a few things:
- The type or namespace name 'RequestEventArgs' could not be found
- The type or namespace name 'IHttpRequest' could not be found
- Warning: The predfined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll'
I have tried googling for what assemblies to include but without much luck. I fear these are obsolete and may not work with my current .NET version (.NET Core 3.1)... I also noticed that the ClickSend script was last edited in 2016, is there a later version?
The best way to handle these delivery reports from your SMS service provider is to add a web server to the Scripting Gateway, make sure to expose the HTTP port to the internet and post the URI of the Scripting Gateway to your SMS service.
The HTTP Gateway in Diafaan SMS Server uses this method for some of the SMS services. The HTTP Gateway is basically a Scripting Gateway with a number of built-in script and you can use one of these scripts as the basis for your own script in either the HTTP Gateway or the Scripting Gateway. The 'ClickSend' script in the HTTP Gateway uses both JSON and a web server to receive delivery reports, you can use the following steps to view this script and change it so that it works with your SMS service:
- Create a new HTTP Gateway, select 'ClickSend' as the SMS service and save it.
- Set the 'ShowAdvancedOptions' property in the advanced settings to 'Yes' and save the settings.
There is now a new option 'Edit 'ClickSend' script' in the Clicksend settings of the HTTP Gateway. You can click on this option to view and change the script.
We are setting up a new Diafaan SMS Server (latest version) with a lesser known provider, meaning we are using a scripting gateway. Along with the scripting gateway we are using a SQL connector to a Microsoft SQL Database Server.
We have the sending up and working fine by having implemented the OnMessagePacket() Method. The problem is the way our provider "sends" the delivery reports for our messages. Instead of having a separate API endpoint for checking statuses, they have us send THEM an endpoint to an API (for example REST) which we probably have to create on our end, to which they will POST all the delivery reports.
Our API will then handle these POST requests in some way (arriving in JSON format). My initial thought was that the API would manually change the statuscodes and status message and delivery times of the messages in the Diafaan MessageLog table, which would work, but that does not seem to have an effect on the statuses shown in the Diafaan Admin Console... This is not the worst thing in the world, as we have other programs checking the MessageLog table directly anyway, but for visually and manually checking statuses, it would be really handy to have the Diafaan admin console show the correct statuses.
Is there anyway to use the Diafaan API to update the message statuses, from outside Diafaan itself? Or do you have any other suggestion on how we should implement this.
Here is a simplified diagram of the dataflow of our setup: https://ibb.co/Ltpn6tP
Most Users Ever Online: 494
Currently Browsing this Page:
Guest Posters: 575
Newest Members:, Henk Helmantel
Administrators: Henk Helmantel: 1188