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
--------------------------------------------------------------------------------------
using smslib 3.5.1 with SUN JavaComm v2 (Win32)
Modem: roundsolutions TER-GX400S
--
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.