Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

College project - any ideas how to do this?

Options
  • 20-01-2003 9:34pm
    #1
    Registered Users Posts: 23,212 ✭✭✭✭


    Hi All,

    I am working on a project that is a MySql database with PHP and apache. It stores, among other things, mobile phone numbers.

    When a user runs a query for mobile numbers (via a web browser), I want to send a text message to each mobile in turn (the result of the query). I was thinking of having a mobile connected to the serial port of the local PC (i.e. on the user's PC, not the server) and send the text message via the modem on the mobile.

    The question is, how do you reckon I should go about this? I was debating a Java applet, but can Java running on a client PC access the serial port?

    I would imagine server side PHP could not access the serial port on a client PC, could it? (now THAT would be impressive!)

    Finally, I was thinking of having a windows binary sitting on the server (it's a Solaris server) and the user clicks a link which downloads the binary, passes the mobile numbers as command line parameters and runs it directly from there.

    Any more glamorous ways of doing things?

    Thanks,

    TD.


Comments

  • Registered Users Posts: 1,481 ✭✭✭satchmo


    A lecturer of mine in Trinity (Dave Gargan) did a native dll that you can use very simply in java for serial port access: Jserial.dll, use it with SerialPort.java. I doubt you could use it with a regular applet, but Java applications can, and maybe signed applets - you'll have to work that out yourself.

    How you intend to access and operate a mobile via the serial port is another matter though...


  • Registered Users Posts: 3,279 ✭✭✭regi


    Many places offer SMSC services. I'm not entirely sure about this, but I think some of them will send an SMS if you POST them an HTTP request, with the revelant data in it (like phone number, message etc). Try asking on the wireless forum too!


  • Registered Users Posts: 23,212 ✭✭✭✭Tom Dunne


    Originally posted by Jazz
    How you intend to access and operate a mobile via the serial port is another matter though...

    It's very straight forward - using the AT commands. Most modern mobiles have standard modems built in, you use these commands to instruct the modem to send a text for you - that's the easy part!


  • Registered Users Posts: 2,010 ✭✭✭Dr_Teeth


    Using an SMSC is the only valid way to go from a architectural viewpoint - if you force a user to connect a phone into their PC before they can use a server-side system whats the benefit?

    At the very least for demoing purposes you can pretend you have an SMSC connection by hooking a phone up to the backend of the server and talking to it directly from your PHP backend (if there are libraries available - if not you'll have to go through some other module done in perl or c or something).

    Teeth.


  • Registered Users Posts: 23,212 ✭✭✭✭Tom Dunne


    Believe it or not, it is in fact practical to ask a user to connect the mobile to their PC when using this "feature".

    A bit of background might help - this is a really a college/work project (I am in college part-time, I work full time). The project is for a small call center to be used when they need to call in the on-call people. Currently, they ring each person on their mobile individually, usually approx 20 people. This is only done when the brown stuff hits the fan, quite infrequently, when the place is down hard.

    It would follow that connecting a mobile to the user's PC is not that inconvenient, considering the alternative - ringing each person individually. The users of the application would also be relatively technical, so they would have no problem plugging in a mobile to the serial port.


  • Advertisement
  • Registered Users Posts: 1,994 ✭✭✭lynchie


    This crowd offer http access for sending SMS messages. I have written both a servlet and PHP code for doing it. Its quite easy to send them once you know the format of the post request.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    I´ve worked for a company developing similiar products in the past. Their solution, as was that of other companies, was to have a mobile device attached to the server. For your purposes (and budget) I would go with the HTTP POST request solutions suggested here.

    Just as a matter of interest - what kind of phone were you thinking of using?


  • Registered Users Posts: 173 ✭✭happydude13


    If you have an O2 account then you can set up a group on their site -- http://www.o2.ie -- with all the numbers in it and all it takes is one message when the time comes. Alternatively there are *nix scripts available which can send messages via O2 again. Once you have an account with them. This could even be automated into a background script, so it only takes a click on a webpage.

    smswap in switzerland provide bulk stuff as do clickatell in SA but that wouldn't really suit this problem.


  • Registered Users Posts: 23,212 ✭✭✭✭Tom Dunne


    Originally posted by Evil Phil

    Just as a matter of interest - what kind of phone were you thinking of using?

    A Nokia - I have documentation somewhere on how to send a text message via the likes of Hyperterminal using AT commands.

    The mobile attached to the server might not be an option as the signal is too bad in the computer room (I had thought about that). Besides, mobiles are forbidden in the computer room. They allegedly interfere with the gear in there.


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    As has been suggested you should probably go for the Third Party SMS over HTTP approach. Connecting a phone is frankly not worth the effort (although, if you insist I suggest you avoid direct AT commands with Nokia's as they can be a little flaky and use their PC Connectivity SDK ).

    There are various SMS suppliers out there, all will require you buy at least €10 worth on a CC, though. Connecting to them is easy enough with PHP, using a raw POST like so:
    [PHP]
    $MyPostData = "foo1=bar1&foo2=bar2&foo3=bar3";
    $fp = fsockopen ("www.foobar.com", 80, $errno, $errstr, 30) or die("Upps!!!");
    fputs ($fp, "POST /foo.asp HTTP/1.0\n");
    fputs ($fp, "Content-Type: application/x-www-form-urlencoded\n");
    fputs ($fp, "Content-Length: ".strlen($MyPostData)."\n");
    fputs ($fp, "\n$MyPostData\n\n");
    while (!feof($fp)) echo fgets ($fp, 128);
    fclose ($fp);
    [/PHP]
    Anyhow, hope this helps.


  • Advertisement
  • Closed Accounts Posts: 7,563 ✭✭✭leeroybrown


    O2 have some form of Unix/Linux command line script that you can use to send your 500 free messages from the shell prompt.

    I've never used it, and a friend said he had problems with it, but it might be worth trying.


Advertisement