Support forum
8:45 pm
Henk, Thank you! works perfectly. If stable through tests, we are switching to Diafaan!
7:54 pm
I have uploaded the whole script to our website. If you follow the five steps below it should work without compile errors.
1. Add the line System.Web.dll to the ReferenceList property in the Advanced tab
2. Download this zipped file and extract the script.
3. Change the httpHost value in the script from @"http://www.host.com/test.php" to the host and page name you want to use. You can also change the query value if you want to change the http GET values.
4. Replace the whole script in the Scripting Connector with the new script.
5. Click on Compile to check if everything is entered correctly.
Regards,
Henk
6:10 pm
Curious if this worked for you. I replaced code as described, however script will not compile. I apologize, I do not write C so potentially obvious errors are not so obvious to me. When this snippet is added it apparently affects the rest of the code. Are there any examples of working code? Thanks.
11:58 am
Hi,
The Web Connector does not have the option to send the response from the website back as an SMS message, however it is possible to do this with the Scripting Connector. Just create a Scripting Connector with C# as the scripting language and replace the function "OnMessageReceived" with the function below. Of course you must change the httpHost variable to your own web page and perhaps make some other changes depending on your specific requirements.
Code:
First add the line:
System.Web.dll
To the ReferenceList property in the Advanced tab
using System.Net;
using System.Web;
...
private void OnMessageReceived(string fromAddress, string toAddress, string message, string messageType,
string messageId, string smsc, string pdu, string gateway,
DateTime sendTime, DateTime receiveTime)
{
string httpHost = @"http://www.host.com/page.php";
string query = "from="+HttpUtility.UrlEncode(fromAddress)+
"&message="+HttpUtility.UrlEncode(message);
try {
HttpWebRequest httpWebRequest = (HttpWebRequest) WebRequest.Create(httpHost + "?" + query);
using (HttpWebResponse httpWebResponse = (HttpWebResponse) httpWebRequest.GetResponse()) {
string responseText = new StreamReader(httpWebResponse.GetResponseStream()).ReadToEnd();
PostSendMessage(fromAddress, "", responseText.Trim(), "", "", "", "");
}
}
catch (Exception e) {
PostEventLog("Message could not be forwarded to: "+httpHost, e.Message, EventLog.Error);
}
}
Most Users Ever Online: 529
Currently Online:
1 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Member Stats:
Guest Posters: 680
Members: 0
Moderators: 0
Admins: 1
Forum Stats:
Groups: 2
Forums: 3
Topics: 1155
Posts: 3945
Newest Members:
, Henk HelmantelAdministrators: Henk Helmantel: 1510