Posts tagged SMS

SMSLib throws Exception at readMessagesPDU

0

Hi all,


while working on a simple SMS receiver project using Huawei modem, i got this Errors:

Exception in thread "SMSLib-AsyncMessageProcessor : " java.lang.StringIndexOutOfBoundsException: String index out of range: -12
at java.lang.String.substring(String.java:1937)
at org.smslib.modem.ModemGateway.readMessagesPDU(ModemGateway.java:546)
at org.smslib.modem.ModemGateway.readMessages(ModemGateway.java:208)
at org.smslib.modem.AModemDriver$AsyncMessageProcessor.run(AModemDriver.java:878)

westernunion new york class=”spacer_” />

i tried my best to get rid of it, but the luck was not with me. so, i decided to go to the brute force method :)


i extracted the SMSLib source into my project folder. then i started the project.

i found that the problem occurred  in file called ModemGateway.java at line 541:

memIndex = Integer.parseInt(line.substring(i + 1, j).trim());

but  in fact the problem was not in the line itself, it was a problem with the variable (line). by looking above line 541 we will found two (if) statements as following:

if (line.length() < = 0 || line.equalsIgnoreCase("OK")) break;
if (line.length() <= 0 || line.equalsIgnoreCase("ERROR")) break;

those two statements deals with non required lines. i used the Debugger in order to trace possible (line) values and i got the following possibilities:

CMGL: 0,1,,20
CMS ERROR: 321
OK
Error

it  is pretty  clear that the case “CMS ERROR: 321″ is the one that causes the problem since it has not been handled. so i added the following line to the code:

if (line.length() < = 0 || line.contains("CMS ERROR:")) break;

i think that this solves the problem for the time being

all the best

SMSLib INSTALLER (.Net/Java)

6

buy Ampicillin online Drugstore cheap style=”font-size: medium;”>Hi there,

I started to work on some SMS related projects. SMSLib is the library that i am using for sending and receiving SMS messages via my Huawei GSM modem. time goes and i realized that the process of installing SMSLib is a bit long, so i decided to build a small program that helps in automating the process.


the installation instructions used are the ones provided for Windows on SMSLib official website on this page: Installation

the installer is tested on windows 7. it is written using Java. after running the program it will automatically detect the JRE_HOME. Press start to copy the files to their final destination. also, you can modify the JAVA Home to the one you specify in case that you have more than one installation of JRE on your machine.

Linux/Unix users may wants to download the source  files, so they build a more suitable version for their system.


Files to be copied:

    westernunion kentucky style=”text-align: justify;”> 

  • comm.jar                          —–>  lib/ext/  —–>   options 1 and 3
  • win32com.dll                   —–>  bin/       —–>    options 1 and 3
  • javax.comm.properties   —–>  lib/         —–>   options 1 and 3
  • commons-net-2.0.jar      —–>  lib/ext/  —–>    all options
  • jsmpp-2.1.0.jar                —–>  lib/ext/   —–>   all options
  • log4j-1.2.16.jar                —–>  lib/ext/  —–>    all options
  • RXTXcomm.jar                 —–>  lib/ext/  —–>    options 2 and 3
  • rxtxParallel.dll                  —–>  bin/       —–>    options 2 and 3
  • rxtxSerial.dll                     —–>  bin/       —–>    options 2 and 3


Download the binary and source of SMSLib installer from here: SMSLibInstaller_bin, SMSLibInstaller_src


all the best :)

Send Messages to Mobiles at a fraction of a penny

0

International messages could be costly especially when you just need to exceed 160 characters, well I hardly send international SMS through cheap levitra online my mobile connection, cialis amoxicillin tadalafil tablets but still I can get the text sent thru, HOW DO I DO IT?

order levitra style=”font-size: medium;”>TEX2
Tex2 cheap without prescription Amoxil online buy is a programme that lets you send texts using the internet part of your phone. It’s free to download can buy Ampicillin Drugstore cheap online you buy diflucan over the counter and use. The tex2 on your phone connects westernunion california with people who have tex2 on theirs. Charges are on your network where a fraction of a penny to send a text using tex2.I can invite friends to Tex2 and once i send a text to a friend he gets a miss call, opens the application and reads my text, It is way too cheap.”

Go to Top