Hello Mr. Delenikas,

this way looks very stable for me :-).


I added the -D switch to the Setting.java  class to change the polling
frequencey
Setting.java:
....

217:        if (System.getProperty("smslib.cnmiemulatorinterval") !=
null) this.CNMI_EMULATOR_INTERVAL =
Integer.parseInt(System.getProperty("smslib.cnmiemulatorinterval"));


Thank you very much .

Olaf


On 28 Feb., 12:17, "T.Delenikas" <[email protected]> wrote:
> Nice! You seem to know your way around smslib :)
>
> Let me know if this works ok in order to include it in the repo as well.
>
> Thanks.
>
>
>
>
>
>
>
> On Tuesday, February 28, 2012 12:57:22 PM UTC+2, Olaf Koppe wrote:
>
> > Hello Mr. Delenikas,
> > thank you for your quick response/advice.
>
> > I wrote a new ATHandler for the modem and overwrite the
> > setIndications() method.
> > So the AModemDriver enables the CnmiEmulationProcessor when
> > setIndications return false.
>
> > The CnmiEmulationProcessor  do the polling for me.
>
> > I append the source for the AtHandler_Telit.java
>
> > Thank you for your hint and advice.
>
> > Best regards.
> > Olaf
>
> > AtHandler_Telit.java :
> > ##################
> > package org.smslib.modem.athandler;
>
> > import java.io.IOException;
>
> > import org.smslib.GatewayException;
> > import org.smslib.Service;
> > import org.smslib.TimeoutException;
> > import org.smslib.helper.Logger;
> > import org.smslib.modem.ModemGateway;
>
> > public class ATHandler_Telit extends ATHandler
> > {
>
> >     public ATHandler_Telit(ModemGateway myGateway)
> >     {
> >         super(myGateway);
> >         Logger.getInstance().logInfo("ATHandler_Telit constructor.",
> > null, getGateway().getGatewayId());
> >         //setting for for testing
> >         Service.getInstance().getSettings().DISABLE_CMTI = true;
> >         Service.getInstance().getSettings().SERIAL_POLLING = true;
> >         //better use -Dsmslib.nocmti=true -Dsmslib.serial.polling=true
> >     }
>
> >     @Override
> >     public boolean setIndications() throws TimeoutException,
> > GatewayException, IOException, InterruptedException {
> >         try {
> >             //disable New Message Indications To Terminal Equipment
> >             getModemDriver().write("AT+CNMI=0,0,0,0,0\r");
> >             getModemDriver().getResponse();
> >         } catch (Exception e) {
> >             Logger.getInstance().logWarn("Error disabling message
> > indication", null, getGateway().getGatewayId());
> >         }
>
> >         Logger.getInstance().logInfo("ATHandler_Telit: CNMI detection
> > disabled.", null, getGateway().getGatewayId());
> >         return false;
> >     }
> > }
>
> > On 28 Feb., 08:31, "T.Delenikas" <[email protected]> wrote:
> > > Hi,
>
> > > I am not sure if this is a modem issue, but I've never seen the CMGL
> > output
> > > interrupted by CNMI notifications.
> > > In any case, SMSLib will not handle this situation well... The best
> > thing
> > > you could do is to override the CNMI command and completely disable the
> > > notifications and periodically poll for new messages (i.e. call the
> > > readMessages() method).
>
> > > This may require source code mod. Do you want to try this way?
>
> > > On Monday, February 27, 2012 4:46:44 PM UTC+2, Olaf Koppe wrote:
>
> > > > Hi , I have the following problem.
>
> > > > When the lib is starting the modem is initialised
> > > > with the CNMI cmd:
>
> > > > 13:09:48,118 DEBUG [smslib] GTW: 10.1.7.76: SEND :AT+CNMI=?(cr)
> > > > 13:09:48,118 INFO  [STDOUT] org.smslib.helper.Logger DEBUG GTW:
> > > > 10.1.7.76: SEND :AT+CNMI=?(cr)
>
> > > > 13:09:48,320 DEBUG [smslib] GTW: 10.1.7.76: BUFFER: +CNMI:
> > (0-3),(0-3),
> > > > (0,2),(0-2),(0,1)
> > > > OK
>
> > > > 13:09:48,321 INFO  [STDOUT] org.smslib.helper.Logger DEBUG GTW:
> > > > 10.1.7.76: BUFFER: +CNMI: (0-3),(0-3),(0,2),(0-2),(0,1)
> > > > OK
>
> > > > 13:09:48,321 DEBUG [smslib] GTW: 10.1.7.76: RECV :+CNMI: (0-3),(0-3),
> > > > (0,2),(0-2),(0,1)(cr)OK(cr)
> > > > 13:09:48,321 INFO  [STDOUT] org.smslib.helper.Logger DEBUG GTW:
> > > > 10.1.7.76: RECV :+CNMI: (0-3),(0-3),(0,2),(0-2),(0,1)(cr)OK(cr)
>
> > > > 13:09:48,321 DEBUG [smslib] CNMI: Found best match: 3
> > > > 13:09:48,322 INFO  [STDOUT] org.smslib.helper.Logger DEBUG CNMI: Found
> > > > best match: 3
>
> > > > 13:09:48,322 DEBUG [smslib] CNMI: Found best match: 1
> > > > 13:09:48,322 INFO  [STDOUT] org.smslib.helper.Logger DEBUG CNMI: Found
> > > > best match: 1
>
> > > > 13:09:48,322 DEBUG [smslib] CNMI: Found best match: 0
> > > > 13:09:48,322 INFO  [STDOUT] org.smslib.helper.Logger DEBUG CNMI: Found
> > > > best match: 0
>
> > > > 13:09:48,322 DEBUG [smslib] CNMI: Found best match: 2
> > > > 13:09:48,322 INFO  [STDOUT] org.smslib.helper.Logger DEBUG CNMI: Found
> > > > best match: 2
>
> > > > 13:09:48,322 DEBUG [smslib] CNMI: Found best match: 0
> > > > 13:09:48,322 INFO  [STDOUT] org.smslib.helper.Logger DEBUG CNMI: Found
> > > > best match: 0
>
> > > > 13:09:48,322 DEBUG [smslib] GTW: 10.1.7.76: SEND :AT
> > > > +CNMI=3,1,0,2,0(cr)
> > > > 13:09:48,322 INFO  [STDOUT] org.smslib.helper.Logger DEBUG GTW:
> > > > 10.1.7.76: SEND :AT+CNMI=3,1,0,2,0(cr)
>
> > > > 13:09:48,524 DEBUG [smslib] GTW: 10.1.7.76: BUFFER: OK
>
> > > > When the modem received sms  it get the list with cmgl=4 cmd ( pdu
> > > > format), but if new messages arrives in the meantime I get  the String
> > > > in the answer +CMTI: "SM",3
>
> > > > This make trouble when parsing the list  with smslib in class
> > > > ModemGateway because
> > > > a String like this  [+CMGL: 2,1,"",92] is expected.
>
> > > >  readMessagesPDU(Collection<InboundMessage> msgList, MessageClasses
> > > > messageClass, int myLimit)
> > > > ...
> > > >     i = line.indexOf(':');
> > > >     j = line.indexOf(',');
> > > >     memIndex = Integer.parseInt(line.substring(i + 1, j).trim());
>
> > > > What is the best way to solve this ?
>
> > > > Best regards.
> > > > Olaf
>
> > > > log:
>
> > > > 2012-02-27 13:10:25,645 INFO  [STDOUT] (SMSLib-AsyncMessageProcessor :
> > > > 10.1.7.76) org.smslib.helper.Logger DEBUG GTW: 10.1.7.76: SEND :AT
> > > > +CMGL=4(cr)
>
> > > >  2012-02-27 13:10:25,844 INFO  [STDOUT] (SMSLib-
> > > > AsyncMessageProcessor : 10.1.7.76) org.smslib.helper.Logger DEBUG GTW:
> > > > 10.1.7.76: BUFFER: +CMTI: "SM",3
>
> > > > 2012-02-27 13:10:25,845 INFO  [STDOUT] (SMSLib-AsyncMessageProcessor :
> > > > 10.1.7.76) org.smslib.helper.Logger DEBUG GTW: 10.1.7.76: Storing
> > > > AsyncEvent: Event: INBOUNDMESSAGE / Response: +CMTI: "SM",3
>
> > > > 2012-02-27 13:10:25,845 INFO  [STDOUT] (SMSLib-AsyncMessageProcessor :
> > > > 10.1.7.76) org.smslib.helper.Logger DEBUG GTW: 10.1.7.76: BUFFER:
> > +CMS
> > > > ERROR: 321
>
> > > > 2012-02-27 13:10:25,846 INFO  [STDOUT] (SMSLib-AsyncMessageProcessor :
> > > > 10.1.7.76) org.smslib.helper.Logger DEBUG GTW: 10.1.7.76: RECV :+CMS
> > > > ERROR: 321(cr)
>
> > > > 2012-02-27 13:10:25,846 INFO  [STDOUT] (SMSLib-AsyncMessageProcessor :
> > > > 10.1.7.76) response:[+CMS ERROR: 321
> > > > ]
>
> > > > 2012-02-27 13:10:25,846 INFO  [STDOUT] (SMSLib-AsyncMessageProcessor :
> > > > 10.1.7.76) line:[+CMS ERROR: 321]
>
> > > > 2012-02-27 13:10:25,846 INFO  [STDOUT] (SMSLib-AsyncMessageProcessor :
> > > > 10.1.7.76) org.smslib.helper.Logger DEBUG GTW: 10.1.7.76: SEND :AT
> > > > +CPMS="SM"(cr)
>
> > > > 2012-02-27 13:06:50,931 INFO  [STDOUT] (QueueManager [10.1.7.76])
> > > > org.smslib.helper.Logger DEBUG Running...
>
> > > > 2012-02-27 13:06:54,034 INFO  [STDOUT] (SMSLib-AsyncMessageProcessor :
> > > > 10.1.7.76) org.smslib.helper.Logger DEBUG GTW: 10.1.7.76: BUFFER:
> > > > +CMGL: 1,0,"",92
>
> > 07911356131313F3000B911326921248F800F12120429110154053D6A2749A7C3A75A0A9B55573C162201008046A28A8596851079A5A713098ECD86C0589201008046A289A4F629559D4816230184E18AB4D93CD190C469CC922D3297546431A67321C0D
>
> > > > +CMGL: 2,1,"",92
>
> > 07911356131313F3000B911316627141F500F12120429100824053D6A2749A7C3A75A0A9B55573C162201008046A28A8596851079A5A713098ECD86C0589201008046A289A4F629559D4816230184E18AB4D93CD190C469CC922D3297546431A67321C0D
>
> > > > +CMGL: 3,1,"",92
>
> > 07911356131313F3000B911316624119F800F12120429100044053D6A2749A7C3A75A0A9B55573C162201008046A28A8596851079A5A713098ECD86C0589201008046A289A4F629559D4816230184E189B4D93CD190C469CC922D3297546431A67321C0D
>
> > > > +CMGL: 4,0,"",92
>
> > 07911356131313F3000B911326924213F200F12120429100744053D6A2749A7C3A75A0A9B55573C162201008046A28A8596851079A5A713098ECD86C0589201008046A289A4F629559D4816230184E18AB4D93CD190C469CC922D3297546431A67321C0D
>
> > > > +CMGL: 5,0,"",92
>
> > 07911356131313F3000B911316925070F600F12120429100354053D6A2749A7C3A75A0A9B55573C162201008046A28A8596851079A5A713098ECD8
>
> > > > +CMTI: "SM",13
> > > > +CMTI: "SM",14
> > > > +CMTI: "SM",15
> > > > +CMTI: "SM",16
> > > > +CMTI: "SM",17
> > > > +CMTI: "SM",18
>
> > 6C0589201008046A289A4F629559D4816230184E18AB4D93CD190C469CC922D3297546431A67321C0D
>
> > > > +CMGL: 6,0,"",92
>
> > 07911356131313F3000B911316923481F700F12120429110314053D6A2749A7C3A75A0A9B55573C162201008046A28A8596851079A5A713098ECD86C0589201008046A289A4F629559D4816230184E189B4D93CD190C469CC922D3297546431A67321C0D
>
> > > > +CMGL: 7,0,"",92
>
> > 07911356131313F3000B911316922469F800F12120429110714053D6A2749A7C3A75A0A9B55573C162201008046A28A8596851079A5A713098ECD86C0589201008046A289A4F629559D4816230184E189B4D93CD190C469CC922D3297546431A67321C0D
>
> > > > +CMGL: 8,0,"",92
>
> > 07911356131313F3000B911316922479F000F12120429110634053D6A2749A7C3A75A0A9B55573C162201008046A28A8596851079A5A713098ECD86C0589201008046A289A4F629559D4816230184E18AB4D93CD190C469CC922D3297546431A67321C0D
>
> > > > +CMGL: 9,0,"",92
>
> > 07911356131313F3000B911316922409F300F12120429110344053D6A2749A7C3A75A0A9B55573C162201008046A28A8596851079A5A713098ECD86C0589201008046A289A4F629559D4816230184E189B4D93CD190C469CC922D3297546431A67321C0D
>
> > > > +CMGL: 10,0,"",92
>
> > 07911356131313F3000B911326921295F300F12120429110454053D6A2749A7C3A75A0A9B55573C162201008046A28A8596851079A5A713098ECD86C0589201008046A289A4F629559D4816230184E18AB4D93CD190C469CC922D3297546431A67321C0D
>
> > > > OK
>
> ...
>
> Erfahren Sie mehr »

-- 
You received this message because you are subscribed to the Google Groups 
"SMSLib Discussion Group" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/smslib?hl=en.

Reply via email to