Hi,
I connected nokia 2700 classic[1] with Ubuntu 12.10. When the phone is
connected a device file is made as /dev/ttyAMC0 to which I made a symbolic
link as /dev/ttyS32 . I used RXTX 2.1-7r2 [2] and put RXTXcomm.jar in
jdk/jre/lib/ext and
librxtxSerial.so in jdk/jre/lib/amd64 as mentioned in the README of RXTX
2.1-7r2.
I also followed the instructions in this[3] tutorial to see if my phone is
recognized as a modem and it was detected as a modem on /dev/ttyS32 as
expected.
The following is the code I wrote but it doesn't seem to work
import org.smslib.Service;
import org.smslib.gateway.modem.Modem;
import org.smslib.message.OutboundMessage;
public class SMSManager {
private Service service;
public SMSManager(){
this.service = Service.getInstance();
}
public boolean doSms(String number, String message){
Modem modemGateway = new Modem("modem", "/dev/ttyS32", "19200",
"0000", "0000", "+9477000003", null);
if(!service.start())
System.out.println("Cannot start service");
if(!service.registerGateway(modemGateway))
System.out.println("Cannot register Gateway");
OutboundMessage outboundMessage = new OutboundMessage(number,
message);
return service.send(outboundMessage);
}
public static void main(String[] args) {
SMSManager smsManager = new SMSManager();
boolean status = smsManager.doSms("+94778021537","test test");
if(status)
System.out.println("Message Sent Successfully");
else
System.out.println("Message sending Failed");
}
}
I am from Sri Lanka (country code +94) and I have Dialog GSM as my service
provider whos Message Service Center number is +9477000003 [4] . I am not
sure what's wrong with my code since the gateway fails to register. I get
the following output
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
Cannot register Gateway
Message sending Failed
Can someone please be kind enough to give me a little help with this? Any
help is highly appreciated.
[1] http://www.gsmarena.com/nokia_2700_classic-2657.php
[2] http://rxtx.qbang.org/wiki/index.php/Download
[3]
http://tareqalam.wordpress.com/2008/07/11/connect-your-nokia-phone-with-linux-without-pc-suite/
[4] http://www.dialog.lk/personal/mobile/features-and-vas/messaging/sms/
Thanks,
PrasadJ
--
You received this message because you are subscribed to the Google Groups
"SMSLib Discussion Group" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/smslib/d090a891-02f4-4565-aab1-ced3e2190e93%40googlegroups.com?hl=en.