Support forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
September 15, 2015
1:36 pm
Henk Helmantel
Admin
Forum Posts: 1573
Member Since:
May 28, 2013
sp_UserOfflineSmall Offline

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:

private void OnMessageToSend(string recordId, string toAddress, string fromAddress,
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

September 13, 2015
8:23 pm
douglas specht
Guest
Guests

Hello..
I have a provider that sends sms for me, and the call is via http as follows.
I downloaded the trial version and would like to know if it is possible to send and receive at diafaan making the call as follows.

http://www.painelsms.com.br/sms.php?i=66666&s=231099&funcao=enviar&mensagem=mensagem&destinatario=xxxxxxxxxx

Forum Timezone: Europe/Amsterdam
Most Users Ever Online: 1119
Currently Online:
Guest(s) 7
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Member Stats:
Guest Posters: 703
Members: 0
Moderators: 0
Admins: 1
Forum Stats:
Groups: 2
Forums: 3
Topics: 1195
Posts: 4079
Newest Members:
, Henk Helmantel
Administrators: Henk Helmantel: 1573