google-code-export / smslib

Automatically exported from code.google.com/p/smslib
1 stars 0 forks source link

Problem while sending SMSs and reading delivery reports #393

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello, 

  I am trying to send SMSs and reading delivery reports. It is working fine for smoe times. after 2-3 hour application is not able to send SMSs and following exception is coming while sending SMSs. 

Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
 getPortIdentifier entered ; Daya ..
 getPortIdentifier: calling getMethod()  entered : Daya ..
 getPortIdentifier: calling CommPortIdentifier()  entered : Daya ..getPortIdentifier
 getPortIdentifier: called CommPortIdentifier()  entered : Daya ..
INFO - GTW: modem1: PortId is set : Daya 
INFO - GTW: modem1: SerialPort is set : Daya 
INFO - GTW: modem1: In port is set : Daya 
INFO - GTW: modem1: Out port is set : Daya 
INFO - GTW: modem1: set Port Reader : Daya 
DEBUG - Initialized.
DEBUG - GTW: modem1: Port Connected .. Daya ..
DEBUG - Initialized.
DEBUG - GTW: modem1: KeepAlive .. Daya ..
DEBUG - Initialized.
DEBUG - GTW: modem1: CNMIEmulatorProcessor .. Daya ..
DEBUG - ** disabled **
DEBUG - GTW: modem1: ModemReader thread started.
DEBUG - GTW: modem1: Modem Reader .. Daya ..
DEBUG - GTW: modem1: AsyncNotifier thread started.
DEBUG - GTW: modem1: AsyncNotifier .. Daya ..
DEBUG - GTW: modem1: AsyncMessageProcessor thread started.
DEBUG - GTW: modem1: AsyncMessageProcessor .. Daya ..
DEBUG - GTW: modem1: clearBuffer() called.
DEBUG - GTW: modem1: clearBuffer.. Daya ..
DEBUG - GTW: modem1: SEND :(27)
DEBUG - GTW: modem1: SEND :+++
DEBUG - GTW: modem1: SEND :ATZ(cr)
DEBUG - GTW: modem1: clearBuffer() called.
DEBUG - GTW: modem1: reset .. Daya ..
DEBUG - GTW: modem1: SEND :ATZ(cr)
DEBUG - GTW: modem1: sync .. Daya ..
DEBUG - GTW: modem1: SEND :ATE0(cr)
DEBUG - GTW: modem1: clearBuffer() called.
DEBUG - GTW: modem1: echoOff .. Daya ..
DEBUG - GTW: modem1: SEND :AT+CPIN?(cr)
DEBUG - GTW: modem1: BUFFER: +CME ERROR: 515
DEBUG - GTW: modem1: RECV :+CME ERROR: 515(cr)
WARN - GTW: modem1: Erroneous CPIN response, proceeding with defaults.
DEBUG - GTW: modem1: SEND :ATE0(cr)
DEBUG - GTW: modem1: clearBuffer() called.
DEBUG - GTW: modem1: SEND :AT+CLIP=1(cr)
DEBUG - GTW: modem1: BUFFER: +CME ERROR: 515
DEBUG - GTW: modem1: RECV :+CME ERROR: 515(cr)
DEBUG - GTW: modem1: SEND :AT+COPS=0(cr)
DEBUG - GTW: modem1: BUFFER: +CME ERROR: 515
DEBUG - GTW: modem1: RECV :+CME ERROR: 515(cr)
DEBUG - GTW: modem1: SEND :ATE0(cr)
DEBUG - GTW: modem1: clearBuffer() called.
DEBUG - GTW: modem1: SEND :AT+CREG?(cr)
DEBUG - GTW: modem1: BUFFER: +CME ERROR: 515
DEBUG - GTW: modem1: RECV :+CME ERROR: 515(cr)
DEBUG - GTW: modem1: SEND :AT+CMEE=1(cr)
DEBUG - GTW: modem1: BUFFER: +CME ERROR: 515
DEBUG - GTW: modem1: RECV :+CME ERROR: 515(cr)
DEBUG - GTW: modem1: SEND :AT+CPMS=?(cr)
DEBUG - GTW: modem1: BUFFER: +CME ERROR: 515
DEBUG - GTW: modem1: RECV :+CME ERROR: 515(cr)
WARN - GTW: modem1: CPMS detection failed, proceeding with default storage 'SM'.
INFO - GTW: modem1: MEM: Storage Locations Found: SM
DEBUG - GTW: modem1: SEND :AT+CNMI=?(cr)
DEBUG - GTW: modem1: BUFFER: +CME ERROR: 515
DEBUG - GTW: modem1: RECV :+CME ERROR: 515(cr)
WARN - GTW: modem1: Retrying the detection of CNMI, modem busy?
DEBUG - GTW: modem1: SEND :AT+CNMI=?(cr)
DEBUG - GTW: modem1: BUFFER: +CME ERROR: 515
DEBUG - GTW: modem1: RECV :+CME ERROR: 515(cr)
WARN - GTW: modem1: Retrying the detection of CNMI, modem busy?
DEBUG - GTW: modem1: SEND :AT+CNMI=?(cr)
DEBUG - GTW: modem1: BUFFER: +CME ERROR: 515
DEBUG - GTW: modem1: RECV :+CME ERROR: 515(cr)
WARN - GTW: modem1: Retrying the detection of CNMI, modem busy?
WARN - GTW: modem1: CNMI detection failed, proceeding with defaults.
WARN - GTW: modem1: Callback indications were *not* set succesfully!
DEBUG - GTW: modem1: SEND :AT+CMGF=0(cr)
DEBUG - GTW: modem1: BUFFER: +CME ERROR: 515
DEBUG - GTW: modem1: RECV :+CME ERROR: 515(cr)
DEBUG - Stopped.
DEBUG - Stopped.
DEBUG - GTW: modem1: AsyncNotifier thread ended.
DEBUG - GTW: modem1: AsyncMessageProcessor thread ended.
DEBUG - GTW: modem1: ModemReader thread ended.
DEBUG - Stopped.
INFO - GTW: modem1: Closing: /dev/ttyUSB0 @115200
DEBUG - Stopped.
DEBUG - Stopped.
INFO - GTW: modem1: Stopping gateway...
java.lang.NullPointerException
    at org.smslib.modem.SerialModemDriver.disconnectPort(SerialModemDriver.java:115)
    at org.smslib.modem.AModemDriver.disconnect(AModemDriver.java:292)
    at org.smslib.modem.ModemGateway.stopGateway(ModemGateway.java:197)
    at org.smslib.Service.stopService(Service.java:338)
    at org.smslib.Service.startService(Service.java:217)
    at examples.modem.SendMessage.doIt(SendMessage.java:34)
    at examples.modem.SendMessage.main(SendMessage.java:77)
DEBUG - NotifyQueueManager end...
DEBUG - NotifyQueueManager running...
DEBUG - NotifyQueueManager end...
DEBUG - NotifyQueueManager running...

And This is coming alwayas until I do not remove modem from Computer and attach 
again for sending SMSs.

Please provide some solution to this problem. 

Code for reading delivery report is: and object of this class is set in the 
Service by setInboundMessageNotification(new ReadSmsProcess())
The above exception does not come if I use application to Send SMS only not 
reading delivery report.

//This class is used to read SMS and delete it.
public class ReadSmsProcess implements IInboundMessageNotification {

    public ReadSmsProcess()
    {

    }

    public void process(String gatewayId, MessageTypes msgType, InboundMessage p_msg)
    {

        try 
        {
            if (msgType == MessageTypes.INBOUND) 
            {
                log(">>> New Inbound message detected from Gateway: " + gatewayId);

            }
            else if (msgType == MessageTypes.STATUSREPORT) 
            {

                StatusReportMessage statusMsg = null;
                statusMsg = (StatusReportMessage)p_msg;

                try
                {
                    f_iRefNumber = Integer.parseInt(statusMsg.getRefNo());
                }
                catch(NumberFormatException e)
                {

                    printStackTrace(e);
                }
                f_sRecipentNum = statusMsg.getRecipient();

                if(statusMsg.getStatus() == DeliveryStatuses.DELIVERED)
                {

                }

            }

        } 
        catch (Exception e) 
        {

            printStackTrace(e);
        } 

    }
    }

Original issue reported on code.google.com by daya.c...@gmail.com on 27 Sep 2010 at 9:31

GoogleCodeExporter commented 9 years ago
http://smslib.org/forum/topic/problem-while-sending-smss-and-reading-delivery-re
ports

Original comment by T.Delenikas on 27 Sep 2010 at 5:50