Receiving and sending sms via gsm modem

How can I receive SMS via a GSM modem so that I can use this SMS for further processing and sending a reply SMS. I have no concrete idea on how to achieve this ....... I prefer to use the Java language for this project, and I use Linux.

+4
source share
7 answers

You can see SMSLib :

SMSLib is a library of programmers for sending and receiving SMS messages via a GSM modem or mobile phone. SMSLib also supports several bulk SMS operators.

+5
source

To send SMS using a 3G modem, you need to use the appropriate AT commands. First you need to set the modem to text mode:

 AT+CMGF=1 

Then you send your message:

 AT+CMGS=<number><CR> <message><CTRL-Z> 

Where <CR> is the carriage return (ASCII 13), and <message> is the message you want to send, <CTRL-Z> is ASCII 26, and <number> is the number to which you want to send your message.

To read received messages, you do this:

 AT+CMGL=<stat><CR> 

Where <stat> is one of: "ALL" , "REC UNREAD" , "REC READ" (with quotation marks), which means all messages, unread messages and messages to read, respectively.

To do this in Java, you need to use the Java Communication API. Here is a quick example: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html

+3
source

Hi, I use the RXTX library, the code is here! .. and its work is great for me, I was looking for a lot of things to get the correct method, finally got the key from sms! ..: D

  String mValue = "AT\r";// strating to communicate with port starts here! mOutputToPort.write(mValue.getBytes()); mOutputToPort.flush(); Thread.sleep(500); mInputFromPort.read(mBytesIn); value = new String(mBytesIn); System.out.println("Response from Serial Device: "+value); mValue = "AT+cmgf=1\r"; mOutputToPort.write(mValue.getBytes()); mOutputToPort.flush(); mValue="at+cmgs=\" Mobile number\"\r"; System.out.print(mValue); mOutputToPort.write(mValue.getBytes()); mOutputToPort.flush(); mValue="at+cmgs="\032";//calling ctrl+z System.out.print(mValue); mOutputToPort.write(mValue.getBytes()); mOutputToPort.flush(); mOutputToPort.close(); mInputFromPort.close(); 
+3
source

Check out SMSJ : a fully functional library that allows you to send and receive SMS using a GSM modem or several popular web services.

+2
source

Take a look at the Java SMSLib API .

From the website: "SMSLib is a library of programmers for sending and receiving SMS messages via a GSM modem or mobile phone. SMSLib also supports several mass SMS operators."

+1
source

You are looking at your modem manual. Some devices support telnet connections, and you can send AT commands through the command line.

If this is your case, you need to find out (sometimes specific to each device) and encode an application that uses telnet to communicate with your modem. The Apache Commons Net project may be helpful.

Some AT command guides:

Alternatively, you can try using one of the libraries suggested by others.

0
source

U can use many methods ...

  • SMS Enabler
  • SMS Lib for java
  • Ozeki sms gateway

To get a better and easier SMS solution, SMSenabler instantly saves your SMS messages to a file or database, and you can restore them. The free version supports up to 12 characters and if you want to send sms, you can use [enter link here] [Ozeki] Ozeki sms server gateway

0
source

Source: https://habr.com/ru/post/1397775/


All Articles