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

SMS via Application

  • 15-09-2014 3:10pm
    #1
    Registered Users Posts: 1,987 ✭✭✭


    I'm wondering if there are any examples or existing functionality within Java or PHP to retrieve SMS messages, I have a class for PHP to send via a GSM modem attached to the server working ok.

    I'm looking to send and receive via a 3g usb dongle, anyone every come across anything in PHP or Java that will handle both sending and receiving?

    Or better still do any of the 3g usb dongles in Ireland have an API you can access?
    Tagged:


Comments

  • Registered Users Posts: 7,157 ✭✭✭srsly78


    I don't think there is a standardised way of doing this, all the various manufacturers will have a different API.

    http://stackoverflow.com/questions/9211535/connecting-to-usb-3g-modem-and-sending-sms-with-php


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


    Depends on what protocol the modem uses, but the CMG AT commands are if not universal, they're incredibly commonplace.

    Essentially, you would open a socket to the modem and pump these commands down, getting a response in return, first by getting a list of messages/indexes on the SIM and then pulling down one by index. It's actually very similar to retrieving mail via POP3.

    This resource covers the syntax fairly well, from what I can see.


  • Registered Users Posts: 1,987 ✭✭✭Ziycon


    Thanks folks, I'll have a go at the above mentioned. :)


  • Closed Accounts Posts: 5,029 ✭✭✭um7y1h83ge06nx


    I might be missing the point here but you could use a third parties APIs. I have used Esendex before in a Java application. Very easy.


  • Registered Users Posts: 1,987 ✭✭✭Ziycon


    I might be missing the point here but you could use a third parties APIs. I have used Esendex before in a Java application. Very easy.
    Thanks for that, I've used Esendex and Vodafone's API's before and are very easy to use but the application has to run on a closed network so no external access to 3rd party APIs.


  • Advertisement
  • Registered Users Posts: 7,157 ✭✭✭srsly78


    Err you can just install the 3rd party library on your server, what is the problem?


  • Registered Users Posts: 1,987 ✭✭✭Ziycon


    srsly78 wrote: »
    Err you can just install the 3rd party library on your server, what is the problem?
    For example the likes of Esendex require you to connect to their servers to send the SMS even if you use the API locally, as I've said the network is closed so there is no access outside the network so the Esendex API calls wont work.


  • Registered Users Posts: 7,157 ✭✭✭srsly78


    Well there are probably other libraries out there that can be installed and used locally.

    To roll your own you just need a serial port library as detailed in the first link. Then just find out what AT commands to issue to the specific dongle that you use.


  • Registered Users Posts: 1,987 ✭✭✭Ziycon


    srsly78 wrote: »
    Well there are probably other libraries out there that can be installed and used locally.
    There is, which I'm already looking into as per the first two response's to the original question. Just a problem of finding the right one to fit the solution.


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


    srsly78 wrote: »
    To roll your own you just need a serial port library as detailed in the first link. Then just find out what AT commands to issue to the specific dongle that you use.
    Indeed. I did this years ago and it's not complicated - it really is no more complicated than pulling down email using POP3 - if I remember correctly it was a serial port connection, down which I just plugged those AT commands and got the expected responses. Implementing a 3rd party API would ironically involve much the same, if not more, effort.


  • Advertisement
  • Registered Users Posts: 1,987 ✭✭✭Ziycon


    Got what I needed working, sending and receiving using PHP via a COM port.

    Now I'm wondering if its possible to connect to a usb without having to use a USB to serial convertor with PHP?


  • Technology & Internet Moderators Posts: 28,789 Mod ✭✭✭✭oscarBravo


    With some USB devices I've used in the past, they present as something like /dev/ttyUSB0 which you can use like any other serial port.


Advertisement