0

i'm trying to create a web application that sends and receive SMS. I've already contacted a local SMS gateway and the connection is working.

I'm using Jsmpp as the library and i'm able to send and receive SMS through a sample application i build using Java SE.

Now i need to migrate this feature to web application. Sending SMS should be ok. But how can i add a listener to listen to the SMSC through my web application ? I'm using Spring and j2ee.

The SMSC doesnt expose a web api and dont have the ability to send sms to a api i expose. The only way they allow is the communicate through the SMPP protocol.

Thanks In Advance.

Chathruaka Waas
  • 341
  • 1
  • 5
  • 23

2 Answers2

0

did you try the program in the link - http://www.java-samples.com/showtutorial.php?tutorialid=22?

If you are looking for any Bulk SMS Solution, You can use APIs provided by vendors such as https://www.textlocal.in/ or any other vendor whichever is feasible.

If you are looking to setup a gateway for yourself, you can check a solution like http://www.ozekisms.com/

Earlier there were Network Vendor provided Gateway which you can freely use, now there are no such gateway you can use freely.

More links, https://www.quora.com/How-can-I-send-a-SMS-with-a-Java-code http://www.airtel.in/aes/Global+Business/Global+Voice/Enterprise+Voice+Solutions/Mobility+Solutions/Enterprise+VAS/Bulk+SMS+Solutions

  • Hi Narendran, Thanks for the reply. I actually have an agreement with a local sms gateway. The problem is they only support smpp protocol. They dont have a way to call a url exposed by our application when they receive a sms. I'll looking for a way to listen to the smsc from a web application. – Chathruaka Waas Jul 29 '16 at 06:20
0

After lots of trial and error i managed to find a solution for the question.

The way i implemented it was to run a standalone java application as a Linux service that would listen to the SMSC. I used the sample project SMSRouter (https://smsrouter.org/) as the basis. Apache camel smpp component was used in this sample project to handle sms sending and receiving.

I then created queues inside Jboss application server for inbox and outbox to store incoming and outgoing sms messages.

Once a SMS is received by SMSRouter it will use JMS to add the SMS message to the inbox queue inside Jboss which will trigger a Message Driven bean that would keep listening to the inbox queue.

When the Web Application needs to send a SMS it will add a JMS message to the outbox queue which will then trigger the SMSRouter which is listening to the outbox queue. SMSRouter will use Apache Camel to send the SMS to the SMSC.

Chathruaka Waas
  • 341
  • 1
  • 5
  • 23