Adam Goldrick

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Batch file to send SMS #3420
    Adam Goldrick
    Participant

    Answered my own question..

    /* Notification Script to send send out an SMS.

    Two variables have to be defined:

    – smsReceiver: The mobile number of the receiver, including the +61, eg: +61440123456

    – smsBody: The actual message to be sent out

    Created by: Adam Goldrick,

    Created on: 11 October 2011

    */

    //variables defined here

    var smsReceiver = [AMMobileNumber];

    var smsBody = “”The Service ” + [Title] + ” is ” + [ServiceQualityLabel] + “. Time of event: ” + [ServerTime] + “.””;

    var smsUrl = “http://192.168.2.1:81/sendmsg?user=admin&passwd=admin&cat=1&to=” + smsReceiver + “&text=” + smsBody;

    var dataToSend = “”;

    // Send the soap envelope

    xmlhttp = new ActiveXObject(“Microsoft.XMLHTTP”);

    xmlhttp.open(“GET”, smsUrl, false);

    xmlhttp.setRequestHeader(“Content-Type”, “text/html; charset=utf-8”);

    xmlhttp.setRequestHeader(“Content-Length”, dataToSend.length);

    xmlhttp.send(dataToSend);

Viewing 1 post (of 1 total)