Dear Emmanuel,

Yes, it works. I can send the SMS now. I use SMSLib library to send the SMS.
So which kind of ending I set in order to get %2B in the phone number.

Below is my code snippet (C#) to send the SMS.

Service service = new Service;
KannelHTTPGateway gatway = new KannelHTTPGateway ("abcd", "
http://localhost:13013/cgi-bin/sendsms";, "tester", "foobar");
service.addGateway(gateway);
...
OutboundMessage message = new OutboundMessage(phone, text);   //phone =
+65####
message.setEncoding(MessageEncodings.ENCUCS2); // which encoding
service.sendMessage(message);

This link shows the 4 types of encoding. So which one I should use to change
+ sign to %2B in the phone variable?

http://smslib.googlecode.com/svn-history/r453/smslib/trunk/src/java/org/smslib/MessageEncodings.java


Thank you.
Sambath


On Wed, Jan 12, 2011 at 9:17 AM, Emmanuel CHANSON <emmanuelchan...@gmail.com
> wrote:

> Hello,
>
> Maybe you can try by url-encode your request:
>
> ***
> http://localhost:13013/cgi-bin/sendsms?username=tester&password=foobar&from=
> %2B85516872490&to=%2B6597379814&text=TestSendingAnSMSFromTheSystem<http://localhost:13013/cgi-bin/sendsms?username=tester&password=foobar&from=+85516872490&to=+6597379814&text=TestSendingAnSMSFromTheSystem>
> ***
>
> Just an idea
>
> Emmanuel
>
> 2011/1/12 Sambath Prum <psb.samb...@gmail.com>
>
> I'm in Cambodia, and I'm currently able to use kannel gateway to send sms
>> to local mobile numbers. However, I run into an error why trying to send SMS
>> to oversea mobile number (Singapore mobile number). If I take out my sim
>> card and place into a phone, I'm able to send the SMS to oversea.
>>
>> The error is *2011-01-11 10:58:04 [3960] [6] ERROR: AT2[abcd]: Generic
>> error: ERROR*
>>
>> Has anyone ever encountered this issue? I really appreciate for your help.
>> Thank you.
>>
>> I'm using Kannel 1.4.3 installed on Ubuntu 10.04 LTS. I use a wavecom
>> modem whose model is WAVECOM FASTRACK type DUAL BRANCH MODEM connected to
>> kannel via serial port.
>>
>> This is the command I use to send SMS from a web browser
>>
>> *
>> http://localhost:13013/cgi-bin/sendsms?username=tester&password=foobar&from=+85516872490&to=+6597379814&text=TestSendingAnSMSFromTheSystem
>> *
>>
>> Below are my config file and log files.
>>
>> Should you need further detail, please let me know.
>>
>> Thanks,
>>
>> Sambath
>>
>> *Config file: kannel.conf*
>>
>> group = core
>>
>>
>> admin-port = 13000
>> admin-password = bar
>> smsbox-port = 13001
>> smsbox-port-ssl = false
>> log-file = "/home/sambath/Documents/softwares/kannel/kannel.log"
>> log-level = 0
>> access-log = "/home/sambath/Documents/softwares/kannel/access.log"
>>
>>
>> access-log-clean = true
>> sms-resend-retry = 0
>>
>> # SMSC GSM
>>
>> group = smsc
>> smsc = at
>> smsc-id = abcd
>> modemtype = wavecom
>> device = /dev/ttyUSB0
>> pin = 0000
>> alt-charset = "ASCII"
>>
>>
>>
>> group = modems
>> id = wavecom
>> name = "wavecom"
>> detect-string = "wavecom"
>> message-storage = sm
>> speed = 115200
>>
>> # SMSBOX SETUP
>>
>> group = smsbox
>> bearerbox-host = localhost
>>
>>
>> sendsms-port = 13013
>> sendsms-chars = "0123456789 +-"
>> log-file = "/home/sambath/Documents/softwares/kannel/smsbox.log"
>> access-log = "/home/sambath/Documents/softwares/kannel/access.log"
>>
>>
>> mo-recode = true
>>
>> # SEND-SMS USERS
>>
>> group = sendsms-user
>> username = tester
>> password = foobar
>>
>> # SMS SERVICES
>>
>> group = sms-service
>> keyword = default
>> get-url = "http://localhost:8080/ReceiveSms.php?sender=%p&text=%a";
>>
>>
>> catch-all = true
>> max-messages = 0
>>
>> *Log file: kannel.log
>>
>> *2011-01-11 10:57:44 [3960] [0] INFO: Added logfile 
>> `/home/sambath/Documents/softwares/kannel/kannel.log' with level `0'.
>>
>>
>> 2011-01-11 10:57:44 [3960] [0] INFO: Started access logfile 
>> `/home/sambath/Documents/softwares/kannel/access.log'.
>> 2011-01-11 10:57:44 [3960] [0] INFO: SSL not supported, no SSL 
>> initialization done.
>> 2011-01-11 10:57:44 [3960] [0] INFO: HTTP: Opening server at port 13000.
>>
>>
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 1 (gwlib/fdset.c:poller)
>> 2011-01-11 10:57:44 [3960] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) maps 
>> to pid 3960.
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 2 
>> (gwlib/http.c:server_thread)
>>
>>
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 3 
>> (gw/bb_http.c:httpadmin_run)
>> 2011-01-11 10:57:44 [3960] [3] DEBUG: Thread 3 (gw/bb_http.c:httpadmin_run) 
>> maps to pid 3960.
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: starting smsbox connection module
>>
>>
>> 2011-01-11 10:57:44 [3960] [0] INFO: BOXC: 'smsbox-max-pending' not set, 
>> using default (100).
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 4 
>> (gw/bb_boxc.c:sms_to_smsboxes)
>> 2011-01-11 10:57:44 [3960] [4] DEBUG: Thread 4 
>> (gw/bb_boxc.c:sms_to_smsboxes) maps to pid 3960.
>>
>>
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 5 
>> (gw/bb_boxc.c:smsboxc_run)
>> 2011-01-11 10:57:44 [3960] [5] DEBUG: Thread 5 (gw/bb_boxc.c:smsboxc_run) 
>> maps to pid 3960.
>> 2011-01-11 10:57:44 [3960] [0] INFO: Set SMS resend frequency to 60 seconds.
>>
>>
>> 2011-01-11 10:57:44 [3960] [0] INFO: SMS resend retry set to 0.
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: smsbox MO concatenated message 
>> handling enabled
>> 2011-01-11 10:57:44 [3960] [0] INFO: DLR rerouting for smsc id <abcd> 
>> disabled.
>>
>>
>> 2011-01-11 10:57:44 [3960] [0] INFO: AT2[abcd]: configuration shows 
>> modemtype <wavecom>
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: AT2[abcd]: Reading modem definitions 
>> from <kannel.conf>
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: AT2[abcd]: Found <1> modems in config
>>
>>
>> 2011-01-11 10:57:44 [3960] [0] INFO: AT2[abcd]: read modem definition for 
>> <wavecom>
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 6 
>> (gw/smsc/smsc_at.c:at2_device_thread)
>> 2011-01-11 10:57:44 [3960] [6] DEBUG: Thread 6 
>> (gw/smsc/smsc_at.c:at2_device_thread) maps to pid 3960.
>>
>>
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 7 
>> (gw/bb_smscconn.c:sms_router)
>> 2011-01-11 10:57:44 [3960] [7] DEBUG: Thread 7 (gw/bb_smscconn.c:sms_router) 
>> maps to pid 3960.
>> 2011-01-11 10:57:44 [3960] [6] INFO: AT2[abcd]: trying to use speed <115200> 
>> from modem definition
>>
>>
>> 2011-01-11 10:57:44 [3960] [6] INFO: AT2[abcd]: opening device
>> 2011-01-11 10:57:44 [3960] [0] INFO: ----------------------------------------
>> 2011-01-11 10:57:44 [3960] [0] INFO: Kannel bearerbox II version 1.4.3 
>> starting
>>
>>
>> 2011-01-11 10:57:44 [3960] [0] INFO: MAIN: Start-up done, entering mainloop
>> 2011-01-11 10:57:44 [3960] [0] DEBUG: AT2[abcd]: start called
>> 2011-01-11 10:57:44 [3960] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) 
>> maps to pid 3960.
>>
>>
>> 2011-01-11 10:57:44 [3960] [6] DEBUG: AT2[abcd]: device opened. Telnet mode 
>> = 0
>> 2011-01-11 10:57:44 [3960] [6] DEBUG: AT2[abcd]: device opened
>> 2011-01-11 10:57:44 [3960] [6] INFO: AT2[abcd]: speed set to 115200
>>
>> 2011-01-11 10:57:44 [3960] [6] DEBUG: AT2[abcd]: --> ^M
>>
>> 2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: --> AT^M
>> 2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: <-- AT
>> 2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: <-- OK
>> 2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: Closing device
>>
>>
>> 2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: speed is 115200
>> 2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: opening device
>> 2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: device opened. Telnet mode 
>> = 0
>> 2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: device opened
>>
>>
>> 2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: Logging in
>> 2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: init device
>> 2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: speed set to 115200
>> 2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: --> ATZ^M
>>
>>
>> 2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: <-- ATZ
>> 2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: <-- OK
>> 2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: --> AT^M
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: <-- AT
>>
>>
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: <-- OK
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: --> AT&F^M
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: <-- AT&F
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: <-- OK
>>
>>
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: --> ATE0^M
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: <-- ATE0
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: <-- OK
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: --> AT+IFC=2,2^M
>>
>>
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: <-- OK
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: --> AT+CPIN?^M
>> 2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: <-- +CPIN: READY
>> 2011-01-11 10:57:48 [3960] [5] INFO: Client connected from <127.0.0.1>
>>
>>
>> 2011-01-11 10:57:48 [3960] [5] DEBUG: Started thread 8 
>> (gw/bb_boxc.c:function)
>> 2011-01-11 10:57:48 [3960] [8] DEBUG: Thread 8 (gw/bb_boxc.c:function) maps 
>> to pid 3960.
>> 2011-01-11 10:57:48 [3960] [8] DEBUG: Started thread 9 
>> (gw/bb_boxc.c:boxc_sender)
>>
>>
>> 2011-01-11 10:57:48 [3960] [9] DEBUG: Thread 9 (gw/bb_boxc.c:boxc_sender) 
>> maps to pid 3960.
>> 2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: --> AT+CMGF=0^M
>> 2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: <-- OK
>>
>>
>> 2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: --> AT+CSMS=?^M
>> 2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: <-- +CSMS: (0,1)
>> 2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: <-- OK
>> 2011-01-11 10:57:58 [3960] [6] INFO: AT2[abcd]: Phase 2+ is supported
>>
>>
>> 2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: --> AT+CSMS=1^M
>> 2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: <-- +CSMS: 1,1,1
>> 2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: <-- OK
>> 2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: --> AT+CNMI=1,2,0,1,0^M
>>
>>
>> 2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: <-- OK
>> 2011-01-11 10:57:58 [3960] [6] INFO: AT2[abcd]: AT SMSC successfully opened.
>> 2011-01-11 10:58:00 [3960] [8] DEBUG: boxc_receiver: sms received
>> 2011-01-11 10:58:00 [3960] [8] DEBUG: send_msg: sending msg to box: 
>> <127.0.0.1>
>>
>>
>> 2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: TP-Validity-Period: 24.0 
>> hours
>> 2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: --> AT+CMGS=39^M
>> 2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: <--
>> 2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: <-- >
>>
>>
>> 2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: send command status: 1
>> 2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: --> 
>> 0011000A8156797377780000A71DD4F29C3E2DBBC969F739E89E36A746F9BB4D4597A7F939BDDC06
>> 2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: --> ^Z
>>
>>
>> 2011-01-11 10:58:04 [3960] [6] DEBUG: AT2[abcd]: <-- ERROR
>> 2011-01-11 10:58:04 [3960] [6] ERROR: AT2[abcd]: Generic error: ERROR
>> 2011-01-11 10:58:04 [3960] [6] DEBUG: AT2[abcd]: send command status: -1
>> 2011-01-11 10:58:04 [3960] [7] DEBUG: sms_router: handling message 
>> (0x9268090 vs 0x9268090)
>>
>>
>> 2011-01-11 10:58:04 [3960] [7] DEBUG: re-queing SMS not-yet-to-be resent
>>
>>
>> *Log file: smsbox.log
>>
>> *2011-01-11 10:57:48 [3968] [0] INFO: Added logfile 
>> `/home/sambath/Documents/softwares/kannel/smsbox.log' with level `0'.
>>
>>
>> 2011-01-11 10:57:48 [3968] [0] INFO: Logging accesses to 
>> '/home/sambath/Documents/softwares/kannel/access.log'.
>> 2011-01-11 10:57:48 [3968] [0] INFO: Started access logfile 
>> `/home/sambath/Documents/softwares/kannel/access.log'.
>>
>>
>> 2011-01-11 10:57:48 [3968] [0] INFO: HTTP: Opening server at port 13013.
>> 2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 1 (gwlib/fdset.c:poller)
>> 2011-01-11 10:57:48 [3968] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) maps 
>> to pid 3968.
>>
>>
>> 2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 2 
>> (gwlib/http.c:server_thread)
>> 2011-01-11 10:57:48 [3968] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) 
>> maps to pid 3968.
>> 2011-01-11 10:57:48 [3968] [0] INFO: Set up send sms service at port 13013
>>
>>
>> 2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 3 
>> (gw/smsbox.c:sendsms_thread)
>> 2011-01-11 10:57:48 [3968] [3] DEBUG: Thread 3 (gw/smsbox.c:sendsms_thread) 
>> maps to pid 3968.
>> 2011-01-11 10:57:48 [3968] [0] DEBUG: 
>> ----------------------------------------------
>>
>>
>> 2011-01-11 10:57:48 [3968] [0] DEBUG: Kannel smsbox version 1.4.3 starting
>> 2011-01-11 10:57:48 [3968] [0] DEBUG:   dumping group (sendsms-user):
>> 2011-01-11 10:57:48 [3968] [0] DEBUG:     <group> = <sendsms-user>
>>
>>
>> 2011-01-11 10:57:48 [3968] [0] DEBUG:     <username> = <tester>
>> 2011-01-11 10:57:48 [3968] [0] DEBUG:     <password> = <foobar>
>> 2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 4 
>> (gw/smsbox.c:obey_request_thread)
>>
>>
>> 2011-01-11 10:57:48 [3968] [4] DEBUG: Thread 4 
>> (gw/smsbox.c:obey_request_thread) maps to pid 3968.
>> 2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 5 
>> (gw/smsbox.c:url_result_thread)
>> 2011-01-11 10:57:48 [3968] [5] DEBUG: Thread 5 
>> (gw/smsbox.c:url_result_thread) maps to pid 3968.
>>
>>
>> 2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 6 
>> (gw/smsbox.c:http_queue_thread)
>> 2011-01-11 10:57:48 [3968] [6] DEBUG: Thread 6 
>> (gw/smsbox.c:http_queue_thread) maps to pid 3968.
>> 2011-01-11 10:57:48 [3968] [0] INFO: Connected to bearerbox at localhost 
>> port 13001.
>>
>>
>> 2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 7 
>> (gw/heartbeat.c:heartbeat_thread)
>> 2011-01-11 10:57:48 [3968] [7] DEBUG: Thread 7 
>> (gw/heartbeat.c:heartbeat_thread) maps to pid 3968.
>> 2011-01-11 10:58:00 [3968] [2] DEBUG: HTTP: Creating HTTPClient for 
>> `127.0.0.1'.
>>
>>
>> 2011-01-11 10:58:00 [3968] [2] DEBUG: HTTP: Created HTTPClient area 
>> 0x84472b0.
>> 2011-01-11 10:58:00 [3968] [3] INFO: smsbox: Got HTTP request 
>> </cgi-bin/sendsms> from <127.0.0.1>
>> 2011-01-11 10:58:00 [3968] [3] INFO: sendsms used by <tester>
>>
>>
>> 2011-01-11 10:58:00 [3968] [3] INFO: sendsms sender:<tester: 85516872490> 
>> (127.0.0.1) to:< 6597379814> msg:<TestSendingAnSMSFromTheSystem>
>> 2011-01-11 10:58:00 [3968] [3] DEBUG: Stored UUID 
>> 7b596f94-9784-456c-bd51-930b1f129df0
>>
>>
>> 2011-01-11 10:58:00 [3968] [3] DEBUG: message length 29, sending 1 messages
>> 2011-01-11 10:58:00 [3968] [3] DEBUG: Status: 202 Answer: <Sent.>
>> 2011-01-11 10:58:00 [3968] [3] DEBUG: Delayed reply - wait for bearerbox
>>
>>
>> 2011-01-11 10:58:00 [3968] [0] DEBUG: Got ACK (0) of 
>> 7b596f94-9784-456c-bd51-930b1f129df0
>> 2011-01-11 10:58:00 [3968] [0] DEBUG: HTTP: Resetting HTTPClient for 
>> `127.0.0.1'.
>>
>>
>

Reply via email to