java - Sending SMS with SMSLib and Web Services -


i have made rest web service send smss using hsdpa usb modem. using smslib in java send smss. every time web service invoked, create gateway start service, send message, stop service , remove gateway. takes 20 seconds each message. found starting service takes lot of time. part of code use send smss

        service.getinstance().addgateway(gateway);         service.getinstance().startservice();          outboundmessage msg = new outboundmessage(phonenumber, message);          if (service.getinstance().sendmessage(msg)) {                       result = "message sent successfully!!";         } else {             result = "could not send message.";         }         service.getinstance().stopservice();         service.getinstance().removegateway(gateway);//remove gateway 

is there way can start service once if not started , use send message when ever web service invoked?

why dont group messages , send in 1 go?

service.getinstance().sendmessages(messagelist, gateway.getgatewayid());  

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

python 3.5 - Pyqtgraph string in x tick -