Results 1 to 2 of 2
  1. #1
    adson5 is offline Member
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0

    Default Sending multiple SMS using SMSlib

    Hello,
    I have broblem with sending multiple sms using GSM modem, and SMSlib. When I tried to send messages only first recipent got it. Then when I want send another during the same process to next recipient I get this error:

    Java Code:
    Exception in thread "main" org.smslib.GatewayException: Comm library exception: java.lang.RuntimeException: javax.comm.PortInUseException: Port currently owned by org.smslib
    	at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java:102)
    	at org.smslib.modem.AModemDriver.connect(AModemDriver.java:114)
    	at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:189)
    	at org.smslib.Service$1Starter.run(Service.java:276)
    here is code from my main class

    Java Code:
    public class TestSMS {
    
        private static String port = "COM3"; //Modem Port.
        private static int bitRate = 115200; //this is also optional. leave as it is.
        private static String modemName = ""; //this is optional.
        private static String modemPin = "0000"; //Pin code if any have assigned to the modem.
        private static String SMSC = "+9477000003"; //Message Center Number ex. Mobitel
    
        
        public static void main(String[] args) throws Exception {
            GsmModem gsmModem = new GsmModem();
            GsmModem.configModem(port, bitRate, modemName, modemPin, SMSC);
            String numbersTab [] = {"<+phonenumber1>","<+phonenumber2>"};
            
            int i=0;
            while( i<numbersTab.length){
                System.out.println(numbersTab.length+" pentla "+i);
            gsmModem.Sender(numbersTab [i], "Hello there!"); // (tp, msg)
            i++;
            }
    
        }
    }
    Thanks in advance.

  2. #2
    adson5 is offline Member
    Join Date
    Sep 2013
    Posts
    2
    Rep Power
    0

    Default Re: Sending multiple SMS using SMSlib

    Quote Originally Posted by adson5 View Post
    Hello,
    I have broblem with sending multiple sms using GSM modem, and SMSlib. When I tried to send messages only first recipent got it. Then when I want send another during the same process to next recipient I get this error:

    Java Code:
    Exception in thread "main" org.smslib.GatewayException: Comm library exception: java.lang.RuntimeException: javax.comm.PortInUseException: Port currently owned by org.smslib
    	at org.smslib.modem.SerialModemDriver.connectPort(SerialModemDriver.java:102)
    	at org.smslib.modem.AModemDriver.connect(AModemDriver.java:114)
    	at org.smslib.modem.ModemGateway.startGateway(ModemGateway.java:189)
    	at org.smslib.Service$1Starter.run(Service.java:276)
    here is code from my main class

    Java Code:
    public class TestSMS {
    
        private static String port = "COM3"; //Modem Port.
        private static int bitRate = 115200; //this is also optional. leave as it is.
        private static String modemName = ""; //this is optional.
        private static String modemPin = "0000"; //Pin code if any have assigned to the modem.
        private static String SMSC = "+9477000003"; //Message Center Number ex. Mobitel
    
        
        public static void main(String[] args) throws Exception {
            GsmModem gsmModem = new GsmModem();
            GsmModem.configModem(port, bitRate, modemName, modemPin, SMSC);
            String numbersTab [] = {"<+phonenumber1>","<+phonenumber2>"};
            
            int i=0;
            while( i<numbersTab.length){
                System.out.println(numbersTab.length+" pentla "+i);
            gsmModem.Sender(numbersTab [i], "Hello there!"); // (tp, msg)
            i++;
            }
    
        }
    }
    Thanks in advance.
    If anyone want to send multiple SMS here is easiest way:
    harshadura-blogx: Simply send SMS using Java with GSM Modem or HSDPA Dongle!
    plus you must modify class by adding this:
    SMSLib_Groups - smslib - SMSLib Group Management - Developer's library for sending/receiving SMS messages. - Google Project Hosting

Similar Threads

  1. Sending multiple files to client
    By po105 in forum New To Java
    Replies: 24
    Last Post: 10-08-2012, 12:42 AM
  2. Sending SMS using smslib
    By j_arif123 in forum Advanced Java
    Replies: 5
    Last Post: 05-02-2012, 09:33 AM
  3. Replies: 0
    Last Post: 11-07-2011, 09:48 AM
  4. Help with sending multiple commands to NETiom
    By makidoja in forum New To Java
    Replies: 2
    Last Post: 07-29-2011, 09:08 AM
  5. configure smslib in Eclipse
    By javanese in forum Eclipse
    Replies: 1
    Last Post: 03-01-2009, 04:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •