Christopher Rivera

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Last man standing SMS #3555
    Christopher Rivera
    Participant

    You could try a different approach like checking the ethernet connection from another server to the SMS, then use an external service like amazon’s sms notification system if you want messages by way of SMS.

    in reply to: is there someone that lists the throughput of these #3711
    Christopher Rivera
    Participant

    I’ve seen a throughput of about 5-8 a minute. The throughput will vary, mostly with the signal strength.

    in reply to: Re: how to clear input and outbox sms? programmatically #3484
    Christopher Rivera
    Participant

    FYI, I use this method to do a few things.

    – Clear the outbox.

    – Clear the job queue when it gets late at night.

    – Get statistics for each of the servers and modems. I pull data for signal strength and a few other things. Pulling stats does require some cleansing of the code, and parsing.

    This could also be done for clearing the inbox as well, and I guess some other operations if you wanted to. The best way to go about figuring our what you need to do is to use LiveHTTPHeaders with Firefox and watch the data that goes back and forth between the client and server. Also note, I believe the order of the parameters sent is important when communicating with the server.

    in reply to: Re: how to clear input and outbox sms? programmatically #3483
    Christopher Rivera
    Participant

    Here is a copy of my code that I use. The main things to note are:

    where you see the function httpPost, that is curl function that sends data to the server using a POST method, and returns the response.

    where you see the function httpGett, that is curl function that sends data to the server using a GET method, and returns the response.

    // START OF CODE

    $user_id = ”;

    $fields = array();

    $fields = ‘index.html’; // the default page we want.

    $fields = ‘XXXXXXXX’; // define your username

    $fields = ‘XXXXXXXX’; // define your password

    // CURL: Login.

    // This simulates the login. ip is your ip address.

    $url = ‘http://’ . $ip . ‘/cgi-bin/postquery.cgi’;

    $response = httpPost($url, $fields);

    // We do this call to get the user_id.

    $userdata = httpGet(‘http://’ . $ip . ‘/index.html?0’);

    // The data in $userdata has the value we want.

    if ( preg_match(“/”([^.]+).html?(d+)”/”, $userdata, $m) )

    {

    // the first set of numbers that appear after the string ‘.html?’ is our user_id

    $user_id = $m[2];

    $str = httpGet(‘http://’ . $ip . ‘/smsSent.html?’ . $user_id);

    // nothing to do.

    if ( preg_match(‘/Outbox is Empty./’,$str) ) { exit(); }

    // we have data.

    if ( preg_match(‘/Page (d+) of (d+)/’,$str, $m) )

    {

    // Now we must post to the system with the commands to clear the outbox.

    $max_pg_no=$m[2];

    $url = ‘http://’ . $ip . ‘/cgi-bin/postquery.cgi’;

    $fields = array();

    $fields = ‘set cleanoutbox status enable samas’;

    $fields = ‘smsSent.html’;

    $fields = $user_id;

    $fields = $max_pg_no;

    $response = httpPost($url, $fields);

    }

    }

    // END OF CODE

    You can modify it to do some more stuff like verification of the clearing.

    in reply to: Re: how to clear input and outbox sms? programmatically #3481
    Christopher Rivera
    Participant

    I’ve been able to simulate the web user accessing this using a couple of GET and POST calls to the server. It’s not pretty but it does work.

    The main steps for this is:

    1. Do a POST request to /cgi-bin/postquery.cgi with your authentication information

    2. Do a GET request to the homepage of the box, and get the result of the page. You will need to parse this to get your session id.

    3. Using the session id, do a GET request to smsSent.html?session_id and get the result.

    4. If the result contains “Outbox is Empty”, end, else if it has “Page (d+) of (d+)”, do the following:

    5. Do a POST method, to /cgi-bin/postquery.cgi using the following params:

    – commandVal=”set cleanoutbox status enable samas”

    – fileName = ‘smsSent.html’

    – userid = ‘this is where your session id will go’

    – max_pg_no = the 2nd value from the Page X of Y, use the Y value.

    And that’s it.

    You can do run 3 to see if the page data now has “Outbox is Empty”

Viewing 5 posts - 1 through 5 (of 5 total)