Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

sms gateway(queue sms)

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I currently doing a java program on SMS Gateway where we can send and receive SMS using the GSM modem. We could send SMS from the website that is control by our admin. Once our admin send the broadcast question to registered users. We also set a specific format to our receive sms. Then the registered users can reply back answer to us. Then if the reply is in the correct or wrong format, we will send an auto reply. Now, my problem is the gateway sometimes jammed because it have to handle both receiving and sending sms at the same time.

I planned to use queue method(Linked List) to queue up the sms.I plan to queue the sending sms first before the gateway process the receiving sms.

I currently stuck with this.I tried using the following code:

Queue<SMSMessage> smsQueue = new LinkedList<SMSMessage>();
......
......
public void run() {
while(true) {
// peek at the head of the queue, but don't grab it
Object pull = smsQueue.peek();
SMSMessage enqueued = null;
// grab the head of the queue
if (pull!=null) {
enqueued = smsQueue.poll();
System.out.println("Enqueued successful");

//send the message here
String num = enqueued.getPhoneNo();
String msg = enqueued.getMessage();


Please help me... thanks alot..
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question to multiple forums: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread, where you have an answer already.
 
Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic