Support forum
Hello Douglas,
The light edition of Diafaan SMS Server can only send messages to the HTTP API of Clickatell. In the basic- and full edition of Diafaan SMS Server you can use a Scripting Gateway to add support for HTTP API's of other SMS services but this requires scripting in C# or Visual Basic.NET and some programming experience.
In the Scripting Pack on the download page of our website, you can find a script for the Scripting Gateway called 'SimpleHTTPGateway.cs'. This script can be used as a basis for a customized script. You only have to change the 'OnMessageToSend' function in the script to make it suitable for the HTTP API you use. For your example the 'OnMessageToSend' function can be changed to the following (untested) code:
string message, string messageType)
{
String URI = "http://www.painelsms.com.br/sms.php?i=66666&s=231099&funcao=enviar";
try {
// Add message text to the URI
URI += "&mensagem=" + System.Web.HttpUtility.UrlEncode(message);
// Add recipient number to the URI
URI += "&destinario=" + System.Web.HttpUtility.UrlEncode(toAddress);
// Send the web request URI to the web server with a GET request
System.Net.WebRequest req = System.Net.WebRequest.Create(URI);
System.Net.WebResponse resp = req.GetResponse();
System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
string response = sr.ReadToEnd().Trim(); //
PostSendResult(recordId, "", StatusCode.Sent, "", "", "", false);
}
catch (Exception e) {
PostSendResult(recordId, "", StatusCode.SendError, "Error: " + e.Message, "", "", false);
}
}
Regards, Henk
1 Guest(s)
Add Reply
Add Topic
Offline
Quote