Hi Puneet,
I'm using java to send and receive sms through Kannel wap and sms gateway,
and I do the following steps:
# For MO's:
----------------
- add "mo-recode = true" in smsbox group
- in the servlet; I get the text (value of %a) in "ISO-8859-1" and covert it
to utf-8 using:
text = new String(request.getParameter("text").getBytes("ISO-8859-1"),
"utf-8");
# For MT's:
---------------
- URL encode the MT message using:
String data = java.net.URLEncoder.encode(mtMessage, "UTF8");
- add "&charset=utf-8&coding=2" to send sms request:
String sendURL =
"http://KannelServerIP:KannelSendsmsPort/cgi-bin/sendsms?username=user&password=passw0rd&charset=utf-8
&coding=2&to=urlEncodedMISDN&text=data&smsc=smscID&from=From";
- send request to Kannel:
java.net.URL url = new java.net.URL(sendURL);
java.io.InputStream in = url.openStream();
java.io.BufferedInputStream bufIn = new java.io.BufferedInputStream(in);
String result = "";
for (;;) {
int car = bufIn.read(); // Check for EOF
if (car == -1) {
break;
} else {
result = result + (char) car;
}
}
bufIn.close();
in.close();
Regards,
--
Benaiad
On Wed, Feb 17, 2010 at 9:29 AM, <[email protected]> wrote:
> Hi Benaiad,
>
> I am working with UNICEF in helping them host a SMS solution for children
> in Iraq. Naturally, this involves sending and receiving Arabic SMSes. We are
> using kannel to interface with our SMS gateway provider. We are facing some
> problems while receiving Arabic text in our application (django app).
>
> I just came across your post and looks like you got it working properly.
> You think it would be possible for you to throw over some code which
> receives SMS from kannel and your kannel config? Language of the code does
> not matte, I just want to see the logic.
>
> Thanks a lot in advance. An early response will be much appreciated :)
> Puneet Goyal
>