nguyenbahuong / smslib

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

GSM Network Auto-Registration disabled #526

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi support.
I have a Siemens MC75i USB modem. Here is the service initialization code: 
Comm2IP.Comm2IP com2IP = null;
Service smsService = null;
            try
            {

                _log.Info("Init sms service");

                com2IP = new Comm2IP.Comm2IP(new byte[] { 127, 0, 0, 1 },
                                                            Port,
                                                            ComPort,
                                                            BaudRate);

                new Thread(new ThreadStart(com2IP.Run)).Start();

                smsService = Service.getInstance();
                SmsReceiver receiver = new SmsReceiver(Storage, smsService);
                smsService.setInboundMessageNotification(receiver);
                smsService.setGatewayStatusNotification(new GatewayStatusNotification());

                //configure gateway
                IPModemGateway gateway = new IPModemGateway("modem.gsm", "127.0.0.1", Port, "Huawei", "E220");
                gateway.setIpProtocol(ModemGateway.IPProtocols.BINARY);
                gateway.setProtocol(AGateway.Protocols.PDU);
                gateway.setInbound(true);
                gateway.setOutbound(false); // process only incoming messages

                if (!String.IsNullOrEmpty(Pin))
                {
                    gateway.setSimPin(Pin);
                }

                smsService.addGateway(gateway);

                smsService.startService();
            }
            catch (Exception ex)
            {
                _log.Error("An exception has occured while running the service", ex);
            }
            finally
            {
                if (com2IP != null)
                {
                    com2IP.Stop();
                }

                smsService.stopService();
            }
        }

There is a "GSM Network Auto-Registration disabled" error all the time. I read 
a couple of issue reports from people with the same error, but those solutions 
didn't help me. I've tried different versions of the SMSLib, different 
manufacturer and model parameters of the gateway ctor, but i still don't have 
results. Could you please help me? I've attached the log file. 

Best regards

Denis.

Original issue reported on code.google.com by pamidore...@gmail.com on 28 Feb 2013 at 11:38

Attachments:

GoogleCodeExporter commented 9 years ago
Your modem probably needs some sort of initialization...

Try this:

Modify your local "ATHandler_Huawei.java" (i.e. this one: 
https://code.google.com/p/smslib/source/browse/smslib/trunk/src/java/org/smslib/
modem/athandler/ATHandler_Huawei.java), locate the init() method and remove 
everything BUT the first three lines. Recompile/rebuild and run with the 
"Huawei" manufacturer identifier.

Does it work any better?

Original comment by admin@smslib.org on 1 Mar 2013 at 9:57

GoogleCodeExporter commented 9 years ago

Original comment by admin@smslib.org on 1 Jan 2014 at 9:25

GoogleCodeExporter commented 9 years ago

Original comment by admin@smslib.org on 2 Jan 2014 at 12:04