Hi Kenny,
Thanks for your reply and timely help. I tried as you said. But it didnt worked as expected. Please find the config files, log and also the midlet attached Please let me know if I had done anything wrong. Thanks, Sameer On Fri, 07 May 2010 15:29:34 +0530 wrote >Hi, All you need is to specify the UDH with the destination port number. For example UDH value 060504270F22B8 would would come to ur midlet as source port: 8888 and destination port 9999. So your midlet listening on 9999 would pick it. 270F is the desination port number. What port are you sending to? You can convert decimal port number to hex here http://www.easycalculation.com/decimal-converter.php Hope this helps. -- Kenny 2010/5/6 Nikos Balkanas You are so right....But then again I don't have to, because i don't have the problem. But you do. So, good luck with it... :-) Nikos ----- Original Message ----- From: SameerBhagwat To: nbalka...@gmail.com Cc: users@kannel.org Sent: Thursday, May 06, 2010 7:42 AM Subject: Re: Re: Re: Problem in sending message to a specific port Hi I didnt ask any one to do it for me. I just wanted to get my doubts clarified. Seems you too don't know what to do. Regards, Sameer On Wed, 05 May 2010 17:52:17 +0530 wrote Hi, I have provided with all the direction that you need. I believe that you can search it for yourself. Don't ask us to do it for you. BR, Nikos ----- Original Message ----- From: SameerBhagwat To: nbalka...@gmail.com Cc: users@kannel.org Sent: Wednesday, May 05, 2010 2:59 PM Subject: Re: Re: Problem in sending message to a specific port Hi I guess it is an issue with UDH please check the logs and the config file. The Send SMS url have been modified and also there is no result Thanks, Sameer On Tue, 04 May 2010 18:19:00 +0530 wrote Hi, Java questions are irrelevant to this group. Please check with a java group. To send SMS to a different port than the default, you need to use a modified udh in your sendsms url. Google for it. BR, Nikos ----- Original Message ----- From: SameerBhagwat To: users@kannel.org Sent: Tuesday, May 04, 2010 3:14 PM Subject: Problem in sending message to a specific port Hi Can any one suggest me how to send message to a specific port. I saw the link http://nmlaxaman.blogspot.com/2009/02/kannel-send-sms-to-specific-port.html and modified the config file. But I am not able to receive the SMS to the port. Tested with J2ME application. Thanks, Sameer
import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import javax.wireless.messaging.*; import java.util.*; import java.io.*; import javax.microedition.io.*; public class SMSMIDlet extends MIDlet implements CommandListener, MessageListener { public Display display; public Form form = new Form("SMS Reader"); public Command exit = new Command("Exit", Command.EXIT, 1); MessageConnection messageConnection; //Reader reader; //public PIMManager pimManager; boolean done; //MessageReceiverListener messageListener; public void startApp() { try { form.append("Listening for SMS, please dont exit"); form.append(""); form.addCommand(exit); Display.getDisplay(this).setCurrent(form); form.setCommandListener(this); // String address = this.midlet.getAppProperty("MobileNumber"); // StringBuffer sb = new StringBuffer(); //sb.append("sms://").append(address).append(':').append("0"); // sb.append("sms://").append(address); // address = sb.toString(); messageConnection = (MessageConnection)Connector.open("sms://00919159927969:500"); TextMessage sendMessage = (TextMessage)messageConnection.newMessage(MessageConnection.TEXT_MESSAGE); sendMessage.setAddress("sms://00919159927969:500"); sendMessage.setPayloadText("Hi welcome"); messageConnection.send(sendMessage); messageConnection.close(); messageConnection = (MessageConnection) Connector.open("sms://:9999"); while(true) { Message message = messageConnection.receive(); if (message != null) { //String str = "" + message.getPayloadText(); //if (str != null && str.length() > 0) { form.append("Message Received"); break; } } } done = false; messageConnection.close(); } catch (Throwable e) { form.append(e.getMessage()); System.out.println("Throwable at StartApp"); e.printStackTrace(); } } public void commandAction(Command cmd, Displayable d) { destroyApp(true); } public void notifyIncomingMessage(MessageConnection conn) { try { Message message = conn.receive(); if (message != null && message instanceof TextMessage) { String str = ((TextMessage)message).getPayloadText(); if (str != null && str.length() > 0) { form.append(str); } } } catch (Throwable e) { System.out.println("Throwable at Notify incoming message"); e.printStackTrace(); } } public void pauseApp() { try { } catch (Throwable e) { System.out.println("Throwable at pauseapp"); e.printStackTrace(); } } public void destroyApp(boolean uc) { notifyDestroyed(); } }
bearerbox.conf
Description: Binary data
smskannel.conf
Description: Binary data
2010-05-07 16:22:55 [7543] [0] INFO: Added logfile `/etc/kannel/check_sendsms_smsc.log' with level `0'. 2010-05-07 16:22:55 [7543] [0] INFO: SSL not supported, no SSL initialization done. 2010-05-07 16:22:55 [7543] [0] INFO: HTTP: Opening server at port 13000. 2010-05-07 16:22:55 [7543] [0] DEBUG: Started thread 1 (gwlib/fdset.c:poller) 2010-05-07 16:22:55 [7543] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) maps to pid 7543. 2010-05-07 16:22:55 [7543] [0] DEBUG: Started thread 2 (gwlib/http.c:server_thread) 2010-05-07 16:22:55 [7543] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) maps to pid 7543. 2010-05-07 16:22:55 [7543] [0] DEBUG: Started thread 3 (gw/bb_http.c:httpadmin_run) 2010-05-07 16:22:55 [7543] [0] DEBUG: starting smsbox connection module 2010-05-07 16:22:55 [7543] [0] INFO: BOXC: 'smsbox-max-pending' not set, using default (100). 2010-05-07 16:22:55 [7543] [0] DEBUG: Started thread 4 (gw/bb_boxc.c:sms_to_smsboxes) 2010-05-07 16:22:55 [7543] [4] DEBUG: Thread 4 (gw/bb_boxc.c:sms_to_smsboxes) maps to pid 7543. 2010-05-07 16:22:55 [7543] [5] DEBUG: Thread 5 (gw/bb_boxc.c:smsboxc_run) maps to pid 7543. 2010-05-07 16:22:55 [7543] [3] DEBUG: Thread 3 (gw/bb_http.c:httpadmin_run) maps to pid 7543. 2010-05-07 16:22:55 [7543] [0] DEBUG: Started thread 5 (gw/bb_boxc.c:smsboxc_run) 2010-05-07 16:22:55 [7543] [0] INFO: Set SMS resend frequency to 60 seconds. 2010-05-07 16:22:55 [7543] [0] INFO: SMS resend retry set to unlimited. 2010-05-07 16:22:55 [7543] [0] DEBUG: smsbox MO concatenated message handling enabled 2010-05-07 16:22:55 [7543] [0] INFO: DLR rerouting for smsc id <9159927969> disabled. 2010-05-07 16:22:55 [7543] [0] INFO: AT2[9159927969]: configuration shows modemtype <ericsson_t68> 2010-05-07 16:22:55 [7543] [0] DEBUG: AT2[9159927969]: Reading modem definitions from <bearerbox.conf> 2010-05-07 16:22:55 [7543] [0] DEBUG: Loading include file `/usr/local/include/kannel/modems.conf' (on line 103 of file bearerbox.conf). 2010-05-07 16:22:55 [7543] [0] DEBUG: AT2[9159927969]: Found <11> modems in config 2010-05-07 16:22:55 [7543] [0] INFO: AT2[9159927969]: read modem definition for <Ericsson T68> 2010-05-07 16:22:55 [7543] [0] DEBUG: Started thread 6 (gw/smsc/smsc_at.c:at2_device_thread) 2010-05-07 16:22:55 [7543] [6] DEBUG: Thread 6 (gw/smsc/smsc_at.c:at2_device_thread) maps to pid 7543. 2010-05-07 16:22:55 [7543] [6] INFO: AT2[9159927969]: trying to use speed <9600> from modem definition 2010-05-07 16:22:55 [7543] [6] INFO: AT2[9159927969]: opening device 2010-05-07 16:22:55 [7543] [0] DEBUG: Started thread 7 (gw/bb_smscconn.c:sms_router) 2010-05-07 16:22:55 [7543] [0] INFO: ---------------------------------------- 2010-05-07 16:22:55 [7543] [0] INFO: Kannel bearerbox II version 1.4.3 starting 2010-05-07 16:22:55 [7543] [0] INFO: MAIN: Start-up done, entering mainloop 2010-05-07 16:22:55 [7543] [0] DEBUG: AT2[9159927969]: start called 2010-05-07 16:22:55 [7543] [7] DEBUG: Thread 7 (gw/bb_smscconn.c:sms_router) maps to pid 7543. 2010-05-07 16:22:55 [7543] [6] DEBUG: AT2[9159927969]: device opened. Telnet mode = 0 2010-05-07 16:22:55 [7543] [6] DEBUG: AT2[9159927969]: device opened 2010-05-07 16:22:55 [7543] [6] INFO: AT2[9159927969]: speed set to 9600 2010-05-07 16:22:55 [7543] [6] DEBUG: AT2[9159927969]: --> ^M 2010-05-07 16:22:57 [7543] [6] DEBUG: AT2[9159927969]: --> AT^M 2010-05-07 16:22:57 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:22:57 [7543] [6] INFO: AT2[9159927969]: Closing device 2010-05-07 16:22:57 [7543] [6] INFO: AT2[9159927969]: speed is 9600 2010-05-07 16:22:57 [7543] [6] INFO: AT2[9159927969]: opening device 2010-05-07 16:22:57 [7543] [6] DEBUG: AT2[9159927969]: device opened. Telnet mode = 0 2010-05-07 16:22:57 [7543] [6] DEBUG: AT2[9159927969]: device opened 2010-05-07 16:22:57 [7543] [6] INFO: AT2[9159927969]: Logging in 2010-05-07 16:22:57 [7543] [6] INFO: AT2[9159927969]: init device 2010-05-07 16:22:57 [7543] [6] INFO: AT2[9159927969]: speed set to 9600 2010-05-07 16:22:57 [7543] [6] DEBUG: AT2[9159927969]: --> ATZ^M 2010-05-07 16:22:57 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:22:57 [7543] [6] DEBUG: AT2[9159927969]: --> AT^M 2010-05-07 16:22:57 [7543] [6] DEBUG: AT2[9159927969]: <-- AT 2010-05-07 16:22:57 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:22:57 [7543] [6] DEBUG: AT2[9159927969]: --> AT&F^M 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: <-- AT&F 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: --> ATE0^M 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: <-- ATE0 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: --> AT+IFC=2,2^M 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: --> AT+CPIN?^M 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: <-- +CPIN: READY 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: --> AT+CMGF=0^M 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: --> AT+CSMS=?^M 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: <-- +CSMS: (0) 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: --> AT+CNMI=2,3,0,1,0;+CMEE=2^M 2010-05-07 16:22:58 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:22:58 [7543] [6] INFO: AT2[9159927969]: AT SMSC successfully opened. 2010-05-07 16:23:00 [7543] [6] DEBUG: AT2[9159927969]: --> AT+CPMS?^M 2010-05-07 16:23:00 [7543] [6] DEBUG: AT2[9159927969]: <-- +CPMS: "SM",0,20,"SM",0,20,"ME",0,200 2010-05-07 16:23:00 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:23:02 [7543] [5] INFO: Client connected from <127.0.0.1> 2010-05-07 16:23:02 [7543] [5] DEBUG: Started thread 8 (gw/bb_boxc.c:function) 2010-05-07 16:23:02 [7543] [8] DEBUG: Thread 8 (gw/bb_boxc.c:function) maps to pid 7543. 2010-05-07 16:23:02 [7543] [8] DEBUG: Started thread 9 (gw/bb_boxc.c:boxc_sender) 2010-05-07 16:23:02 [7543] [9] DEBUG: Thread 9 (gw/bb_boxc.c:boxc_sender) maps to pid 7543. 2010-05-07 16:23:23 [7543] [6] DEBUG: AT2[9159927969]: <-- +CMTI: "ME",1 2010-05-07 16:23:23 [7543] [6] DEBUG: AT2[9159927969]: +CMTI incoming SMS indication: +CMTI: "ME",1 2010-05-07 16:23:24 [7543] [6] INFO: AT2[9159927969]: CMTI received, but no message-storage is set in confiuration.setting now to <ME> 2010-05-07 16:23:24 [7543] [6] INFO: System error 2: No such file or directory 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: --> AT+CPMS="ME"^M 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: <-- +CPMS: 1,200,0,20,1,200 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: --> AT+CMGR=1^M 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: <-- +CMGR: 0,,35 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: <-- 0791198904100161440C911959664639400000015070615123221206050401F40000C834E85E668FDFED32 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: received message from SMSC: +919840011016 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: Numeric sender (international) <+919566649304> 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: User data length read as (18) 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: Udh decoding done len=11 udhi=1 udhlen=6 udh='รด' 2010-05-07 16:23:24 [7543] [9] DEBUG: send_msg: sending msg to box: <127.0.0.1> 2010-05-07 16:23:24 [7543] [9] DEBUG: boxc_sender: sent message to <127.0.0.1> 2010-05-07 16:23:24 [7543] [8] DEBUG: boxc_receiver: got ack 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: --> AT+CMGD=1^M 2010-05-07 16:23:24 [7543] [8] DEBUG: boxc_receiver: sms received 2010-05-07 16:23:24 [7543] [8] DEBUG: send_msg: sending msg to box: <127.0.0.1> 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: TP-Validity-Period: 24.0 hours 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: --> AT+CMGS=64^M 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: <-- > 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: send command status: 1 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: --> 0011000C911959664639400000A739A3D1080683C16030180C0683C16032994C068BC162351A8E8683C16030180C0683C16030190C0663C560AC4D2F3B1A8D1A0A 2010-05-07 16:23:24 [7543] [6] DEBUG: AT2[9159927969]: --> ^Z 2010-05-07 16:23:29 [7543] [6] DEBUG: AT2[9159927969]: <-- > 2010-05-07 16:23:29 [7543] [6] DEBUG: AT2[9159927969]: <-- +CMGS: 0 2010-05-07 16:23:29 [7543] [6] DEBUG: AT2[9159927969]: <-- OK 2010-05-07 16:23:29 [7543] [6] DEBUG: AT2[9159927969]: send command status: 0 2010-05-07 16:23:32 [7543] [8] DEBUG: boxc_receiver: heartbeat with load value 0 received 2010-05-07 16:24:01 [7543] [6] DEBUG: AT2[9159927969]: --> AT+CPMS?^M 2010-05-07 16:24:01 [7543] [6] ERROR: AT2[9159927969]: Couldnot write to device. 2010-05-07 16:24:01 [7543] [6] ERROR: System error 5: Input/output error 2010-05-07 16:24:05 [7543] [6] DEBUG: failed to send mem select command to modem -1 2010-05-07 16:24:05 [7543] [6] DEBUG: AT2[9159927969]: memory check error 2010-05-07 16:24:05 [7543] [6] INFO: AT2[9159927969]: Closing device 2010-05-07 16:24:05 [7543] [6] ERROR: AT2[9159927969]: Couldn't connect (retrying in 10 seconds). 2010-05-07 16:24:15 [7543] [6] INFO: AT2[9159927969]: opening device 2010-05-07 16:24:15 [7543] [6] ERROR: AT2[9159927969]: open failed! ERRNO=19 2010-05-07 16:24:15 [7543] [6] ERROR: System error 19: No such device 2010-05-07 16:24:15 [7543] [6] ERROR: AT2[9159927969]: at2_device_thread: open_at2_device failed. 2010-05-07 16:24:15 [7543] [6] ERROR: System error 19: No such device 2010-05-07 16:24:15 [7543] [6] ERROR: AT2[9159927969]: Couldn't connect (retrying in 10 seconds). 2010-05-07 16:24:25 [7543] [6] INFO: AT2[9159927969]: opening device 2010-05-07 16:24:25 [7543] [6] ERROR: AT2[9159927969]: open failed! ERRNO=19 2010-05-07 16:24:25 [7543] [6] ERROR: System error 19: No such device 2010-05-07 16:24:25 [7543] [6] ERROR: AT2[9159927969]: at2_device_thread: open_at2_device failed. 2010-05-07 16:24:25 [7543] [6] ERROR: System error 19: No such device 2010-05-07 16:24:25 [7543] [6] ERROR: AT2[9159927969]: Couldn't connect (retrying in 10 seconds). 2010-05-07 16:24:31 [7543] [0] WARNING: Killing signal or HTTP admin command received, shutting down... 2010-05-07 16:24:31 [7543] [0] DEBUG: Shutting down Kannel... 2010-05-07 16:24:31 [7543] [0] DEBUG: shutting down smsc 2010-05-07 16:24:31 [7543] [0] DEBUG: AT2[9159927969]: Shutting down SMSCConn, slow 2010-05-07 16:24:31 [7543] [0] DEBUG: shutting down udp 2010-05-07 16:24:31 [7543] [6] INFO: AT2[9159927969]: opening device 2010-05-07 16:24:31 [7543] [6] ERROR: AT2[9159927969]: open failed! ERRNO=19 2010-05-07 16:24:31 [7543] [6] ERROR: System error 19: No such device 2010-05-07 16:24:31 [7543] [6] ERROR: AT2[9159927969]: at2_device_thread: open_at2_device failed. 2010-05-07 16:24:31 [7543] [6] ERROR: System error 19: No such device 2010-05-07 16:24:31 [7543] [6] INFO: AT2[9159927969]: Closing device 2010-05-07 16:24:31 [7543] [6] DEBUG: Thread 6 (gw/smsc/smsc_at.c:at2_device_thread) terminates. 2010-05-07 16:24:31 [7543] [4] DEBUG: Thread 4 (gw/bb_boxc.c:sms_to_smsboxes) terminates. 2010-05-07 16:24:31 [7543] [9] DEBUG: send_msg: sending msg to box: <127.0.0.1> 2010-05-07 16:24:31 [7543] [9] DEBUG: Thread 9 (gw/bb_boxc.c:boxc_sender) terminates. 2010-05-07 16:24:32 [7543] [8] INFO: Connection closed by the box <127.0.0.1> 2010-05-07 16:24:32 [7543] [8] DEBUG: Thread 8 (gw/bb_boxc.c:function) terminates. 2010-05-07 16:24:32 [7543] [5] DEBUG: Thread 5 (gw/bb_boxc.c:smsboxc_run) terminates. 2010-05-07 16:24:32 [7543] [7] DEBUG: Thread 7 (gw/bb_smscconn.c:sms_router) terminates. 2010-05-07 16:24:32 [7543] [0] INFO: All flow threads have died, killing core 2010-05-07 16:24:32 [7543] [0] DEBUG: Waiting for 2 (gwlib/http.c:server_thread) to terminate 2010-05-07 16:24:32 [7543] [3] DEBUG: HTTP: No clients with requests, quitting. 2010-05-07 16:24:32 [7543] [3] DEBUG: Thread 3 (gw/bb_http.c:httpadmin_run) terminates. 2010-05-07 16:24:32 [7543] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) terminates. 2010-05-07 16:24:32 [7543] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) terminates. 2010-05-07 16:24:32 [7543] [0] DEBUG: final clean-up for SMSCConn 2010-05-07 16:24:32 [7543] [0] DEBUG: smsbox MO concatenated message handling cleaned up 2010-05-07 16:24:32 [7543] [0] INFO: Total WDP messages: received 0, sent 0 2010-05-07 16:24:32 [7543] [0] INFO: Total SMS messages: received 1, sent 1 2010-05-07 16:24:32 [7543] [0] DEBUG: Immutable octet strings: 266.