For MO you need just get text (%a) and charset (%C).
Then you can convert text string to your preferred charset.

Here is example for Perl:
-------------
# Kannel configuration part
group = sms-service
keyword = default
get-url = 
"http://127.0.0.1/smsc/life?type=mo&msisdn=%p&sn=%P&text=%a&smscid=%i&msgid=%I&coding=%c&mclass=%m&charset=%C&udh=%u&binmsg=%b&meta=%D";
accept-x-kannel-headers = true

-------------
my $cgi = CGI::Fast->new();
my $msg_body = $cgi->param('text');
my $charset = $cgi->param('charset');
my $CV = Text::Iconv->new($charset, 'UTF-8//IGNORE');
$msg_body = $CV->convert($msg_body);

# Now $msg_body contains utf-8 encoded MO message
-------------

2009/7/2 dhcmega <[email protected]>:
> Michael
> Is this information for MOs? I not testing MTs at all yet, I will go there
> when I get MOs to work OK.
> Thanks again!!
>
> dhcmega
>
> On Thu, Jul 2, 2009 at 11:43 AM, Michael Bochkaryov <[email protected]>
> wrote:
>>
>> Hi,
>>
>> If you send reply as UTF-8 string in the same HTTP session, set the
>> following HTTP headers:
>>
>> Content-Type: text/html; charset=UTF-8
>> X-Kannel-Coding: 2
>>
>> And dont forget to set the following to sms-service group:
>> accept-x-kannel-headers = 1
>>
>> ---------------
>> For sendsms API just use the following parameters:
>>
>> coding=2&charset=utf-8
>>
>> 2009/7/2 dhcmega <[email protected]>:
>> > Hi, thank you all!!
>> >
>> > I am using 1.4.2, I can try with 1.4.3 (and I think I will today)
>> >
>> > Mean while, with 1.4.2 and mclass hardcoded to 3 (otherwise it doesn´t
>> > work), when I receive "váca" o "victoría" I get this:
>> >
>> > 2009-07-02 11:07:15 Receive SMS [SMSC:connection_3] [SVC:] [ACT:]
>> > [BINF:]
>> > [from:1234567890] [to:1234] [flags:-1:2:-1:0:-1]
>> >
>> > [msg:32:0056006900630074006F007200ED00610000006F00000072000000ED00000061]
>> > [udh:0:]
>> > 2009-07-02 11:07:15 [4550] [4] INFO: MO message converted from UCS-2 to
>> > ISO-8859-1
>> > 2009-07-02 11:07:15 [4550] [4] INFO: Starting to service <Victoría> from
>> > <1234567890> to <1234>
>> > 2009-07-02 11:07:15 [4550] [5] INFO: No reply sent, denied.
>> > 2009-07-02 11:07:15 SMS HTTP-request sender:1234567890 request: 'OK'
>> > url:
>> > 'http://localhost/index.php?coding=0&charset=ISO-8859-1' reply: 200 '<<
>> > successful >>'
>> >
>> > 2009-07-02 11:07:15 Receive SMS [SMSC:connection_2] [SVC:] [ACT:]
>> > [BINF:]
>> > [from:1234567890] [to:1234] [flags:-1:2:-1:0:-1]
>> > [msg:16:005600E1006300610000006300000061] [udh:0:]
>> > 2009-07-02 11:07:15 [4550] [4] INFO: MO message converted from UCS-2 to
>> > ISO-8859-1
>> > 2009-07-02 11:07:15 [4550] [4] INFO: Starting to service <Váca> from
>> > <1234567890> to <1234>
>> > 2009-07-02 11:07:15 [4550] [5] INFO: No reply sent, denied.
>> > 2009-07-02 11:07:15 SMS HTTP-request sender:1234567890 request: 'OK'
>> > url:
>> > 'http://localhost/index.php?coding=0&charset=ISO-8859-1' reply: 200 '<<
>> > successful >>'
>> > I am still having problems.
>> > Thanks!
>> >
>> > dhcemga
>> >
>> > On Wed, Jul 1, 2009 at 6:44 PM, Michael Bochkaryov
>> > <[email protected]>
>> > wrote:
>> >>
>> >> Oops, seems like list configured without rewriting Reply-To  header.
>> >> IMHO, it may be better to set replies to maillist as default behaviour.
>> >>
>> >>
>> >> 2009/7/1 Michael Bochkaryov <[email protected]>:
>> >> > Hi,
>> >> >
>> >> > 2009/7/1 dhcmega <[email protected]>:
>> >> >> There is a lot of mails regarding how to send SMS to terminals using
>> >> >> special
>> >> >> chars, but not much about receiving.
>> >> >>
>> >> >> The operator tells me that when I receive a MO message with special
>> >> >> chars I
>> >> >> get it with coding DCS UCS2
>> >> >
>> >> > UCS2-BE if more correctly.
>> >> >
>> >> >> How should I configure kannel to interpret it OK?
>> >> >
>> >> > For Kannel itself no need to configure anything because of it's
>> >> > standard for Unicode messages.
>> >> > Just set transmission of text charset and SMS coding (%C and %c) in
>> >> > get-url.
>> >> >
>> >> > It should be something like this:
>> >> > get-url = "http://127.0.0.1/my.service?....coding=%c&charset=%C";
>> >> >
>> >> > I recommend also set "mo-recode = 1" in "smsbox" group.
>> >> > In this case message will recoded to WINDOWS-1252 or UTF-8 by Kannel
>> >> > before sending to your service.
>> >> > Seems UTF-8 processing will be more suitable for development.
>> >> >
>> >> >> It is a SMPP 3.4 connection.
>> >>
>> >> --
>> >> Regards,
>> >> Michael Bochkaryov
>> >> www.rattler.kiev.ua
>> >>
>> >
>> >
>>
>>
>>
>> --
>> Regards,
>> Michael Bochkaryov
>> www.rattler.kiev.ua
>
>



-- 
Regards,
Michael Bochkaryov
www.rattler.kiev.ua

Reply via email to