Hi,

Actually I just had a look at the smsbox.c code. It doesn't support gsm in cgi-bin/sendsms. That's why (2) comes out garbled. You should provide iso or utf-8 text urlencoded. Why your mobile doesn't display it correctly, it is a question of either your mobile's settings, or your SMScs.

BR,
Nikos
----- Original Message ----- From: "Nikos Balkanas" <nbalka...@gmail.com> To: "Nicolas de Bari Embriz Garcia Rojas" <nb...@backup.sh>; <us...@vm1.kannel.org>
Sent: Sunday, May 22, 2011 11:19 PM
Subject: Re: gsm7 send messages > 140 <=160 chars length


Hi,

1) Output is correct GSM and kannel sends it out correctly. You should
contact your SMSc to see if they support GSM and if they do, why it is not
displaying correctly on the mobile. Try also &text==%00%7D%05&coding=0.
Should work and it is fewer characters to type.
2) data_coding 241 is for GSM. Kannel is trying to send GSM 03.38 but it
doesn't look right. It actually sends in GSM: ?{?. Anyway just skip it.
3) Indeed UTF-8 will take up twice as many characters (other than latin-1)
and maximum size is 80 <= size <= 160

BR,
Nikos
----- Original Message ----- From: "Nicolas de Bari Embriz Garcia Rojas" <nb...@backup.sh>
To: "Nikos Balkanas" <nbalka...@gmail.com>; <users@kannel.org>
Sent: Sunday, May 22, 2011 9:17 PM
Subject: Re: gsm7 send messages > 140 <=160 chars length


Hi, please find bellow the 3 different outputs of the  SMPP PDU log

This one is using urlencode('@Γ±Γ©'); (message are not properly
displayed on the phone but kannel send 3 chars as supposed based on
the GSM charset: (smsc has NO alt-charset = "UTF-8") and seems

&text=%40%C3%B1%C3%A9&coding=0

--
DEBUG: SMPP PDU 0x801febe80 dump:
DEBUG:   type_name: submit_sm
DEBUG:   command_id: 4 = 0x00000004
DEBUG:   command_status: 0 = 0x00000000
DEBUG:   sequence_number: 7 = 0x00000007
DEBUG:   service_type: NULL
DEBUG:   source_addr_ton: 0 = 0x00000000
DEBUG:   source_addr_npi: 1 = 0x00000001
DEBUG:   source_addr: "42865"
DEBUG:   dest_addr_ton: 2 = 0x00000002
DEBUG:   dest_addr_npi: 1 = 0x00000001
DEBUG:   destination_addr: "9988776655"
DEBUG:   esm_class: 3 = 0x00000003
DEBUG:   protocol_id: 0 = 0x00000000
DEBUG:   priority_flag: 0 = 0x00000000
DEBUG:   schedule_delivery_time: NULL
DEBUG:   validity_period: NULL
DEBUG:   registered_delivery: 0 = 0x00000000
DEBUG:   replace_if_present_flag: 0 = 0x00000000
DEBUG:   data_coding: 0 = 0x00000000
DEBUG:   sm_default_msg_id: 0 = 0x00000000
DEBUG:   sm_length: 3 = 0x00000003
DEBUG:   short_message:
DEBUG:    Octet string at 0x80220fca0:
DEBUG:      len:  3
DEBUG:      size: 6
DEBUG:      immutable: 0
DEBUG:      data: 00 7d 05                                          .}.
DEBUG:    Octet string dump ends.
DEBUG: SMPP PDU dump ends.
--

This one is using:%00 %7D %05   (message are not properly displayed on
the phone but kannel send 3 chars as supposed based on the GSM
charset: (smsc has alt-charset = "UTF-8")

text=%00%7D%05&coding=0&alt-dcs=1  (here i think kannel recodes the
sms and does not recognize the alt-dsc)

--
DEBUG: SMPP PDU 0x801fe1040 dump:
DEBUG:   type_name: submit_sm
DEBUG:   command_id: 4 = 0x00000004
DEBUG:   command_status: 0 = 0x00000000
DEBUG:   sequence_number: 4974 = 0x0000136e
DEBUG:   service_type: NULL
DEBUG:   source_addr_ton: 0 = 0x00000000
DEBUG:   source_addr_npi: 1 = 0x00000001
DEBUG:   source_addr: "42865"
DEBUG:   dest_addr_ton: 2 = 0x00000002
DEBUG:   dest_addr_npi: 1 = 0x00000001
DEBUG:   destination_addr: "9988776655"
DEBUG:   esm_class: 3 = 0x00000003
DEBUG:   protocol_id: 0 = 0x00000000
DEBUG:   priority_flag: 0 = 0x00000000
DEBUG:   schedule_delivery_time: NULL
DEBUG:   validity_period: NULL
DEBUG:   registered_delivery: 0 = 0x00000000
DEBUG:   replace_if_present_flag: 0 = 0x00000000
DEBUG:   data_coding: 241 = 0x000000f1
DEBUG:   sm_default_msg_id: 0 = 0x00000000
DEBUG:   sm_length: 4 = 0x00000004
DEBUG:   short_message:
DEBUG:    Octet string at 0x801f836a0:
DEBUG:      len:  4
DEBUG:      size: 1024
DEBUG:      immutable: 0
DEBUG:      data: 3f 1b 29 3f                                       ?.)?
DEBUG:    Octet string dump ends.
DEBUG: SMPP PDU dump ends.
--


This one works and is using urlencode('@Γ±Γ©'); (messages are correctly
displayed on the phone but kannel is transmitting 5 chars instead of 3
(gsm charset)

message sent using: text=%40%C3%B1%C3&coding=0

---
DEBUG: SMPP PDU 0x801fe1040 dump:
DEBUG:   type_name: submit_sm
DEBUG:   command_id: 4 = 0x00000004
DEBUG:   command_status: 0 = 0x00000000
DEBUG:   sequence_number: 4970 = 0x0000136a
DEBUG:   service_type: NULL
DEBUG:   source_addr_ton: 0 = 0x00000000
DEBUG:   source_addr_npi: 1 = 0x00000001
DEBUG:   source_addr: "42865"
DEBUG:   dest_addr_ton: 2 = 0x00000002
DEBUG:   dest_addr_npi: 1 = 0x00000001
DEBUG:   destination_addr: "9988776655"
DEBUG:   esm_class: 3 = 0x00000003
DEBUG:   protocol_id: 0 = 0x00000000
DEBUG:   priority_flag: 0 = 0x00000000
DEBUG:   schedule_delivery_time: NULL
DEBUG:   validity_period: NULL
DEBUG:   registered_delivery: 0 = 0x00000000
DEBUG:   replace_if_present_flag: 0 = 0x00000000
DEBUG:   data_coding: 0 = 0x00000000
DEBUG:   sm_default_msg_id: 0 = 0x00000000
DEBUG:   sm_length: 5 = 0x00000005
DEBUG:   short_message:
DEBUG:    Octet string at 0x801e66560:
DEBUG:      len:  5
DEBUG:      size: 6
DEBUG:      immutable: 0
DEBUG:      data: 40 c3 b1 c3 a9                                    @....
DEBUG:    Octet string dump ends.
DEBUG: SMPP PDU dump ends.
---


So far only using alt-charset = "UTF-8" on the smsc and url encoding
the GSM chars works but sending chars over ASCII 126 start to use
twice the space where in theory if I am right if they are coded using
the  GSM charset must consume 1 space.

Thanks in advance.

regards.


2011/5/21 Nikos Balkanas <nbalka...@gmail.com>:
Hi,

I saw that. But you never posted your submit_sm PDU from that attempt.
Something else might be wrong. Please do.

BR,
Nikos
----- Original Message ----- From: "Nicolas de Bari Embriz Garcia Rojas"
<nb...@backup.sh>
To: "Nikos Balkanas" <nbalka...@gmail.com>; <users@kannel.org>
Sent: Saturday, May 21, 2011 3:46 AM
Subject: Re: gsm7 send messages > 140 <=160 chars length


Hi, thanks for the reply, as said on the first email, when using this:

text=%00%7D%05&coding=0&alt-dcs=1

the characters are not properly Β displayed on the phone

the only way I can get the chars to be displayed correctly is using
alt-charset = "UTF-8" but with this i can just send a max of 140 chars

or coding the messages with UCS-2 but that limit to 70 chars

Could it be an issue with Β kannel or a parameter that i could be
missing ? since looks like if internally maybe when using iconv, is
treating the GSM like ASCII since the latin char n with tilde Γ± and Γ©
is using 2 bytes instead of 1 like supposed to be the GSM charset

regards.

2011/5/20 Nikos Balkanas <nbalka...@gmail.com>:

Hi,

1) mo-recode is for incoming, not outgoing SMS. Read UG about it.
2) SMSc submit_sm PDU takes precedence over access log. If it shows 3
Bytes,
it sends only 3 Bytes. I don't know access log that well, it may be
mistaken.
3) Correct sendsms to send as GSM is:

text=%00%7D%05&coding=0&alt-dcs=1

Use alt-dcs if you have alt-charset in your smsc configuration and want to
force gsm.

BR,
Nikos
----- Original Message ----- From: "Nicolas de Bari Embriz Garcia Rojas"
<nb...@backup.sh>
To: <users@kannel.org>
Sent: Friday, May 20, 2011 5:47 PM
Subject: gsm7 send messages > 140 <=160 chars length


Hi all, this topic has been discussed several times, but I still
haven't found how to properly send messages > 140 <= 160 char length
including only the GSM 03.38 charset.

for example, how to send a text messages of 160 characters including
only chars like @ �  �Ή.

I updated my sources to the latest available on the SVN: REvision
4908, and configured kannel with the following options:

./configure --with-defaults=speed --enable-docs=no
--with-malloc=native --enable-start-stop-daemon=no --prefix=/usr/local
--with-libs=-lpthread --with-mysql --disable-localtime
--with-cflags=-L/usr/local/lib -I/usr/local/include

I had to use the --with-cflags="-L/usr/local/lib -I/usr/local/include"
so that on my system (FreeBSD 8.1 amd64) It could find iconv

after compiling and installing the file gw-config.h seems to properly
been using iconv:
/* Defines for iconv. Ξ’ */
#define HAVE_ICONV 1
#define ICONV_CONST const

Kannel is up and running (sending/receiving messages) my smsc conf is like
this:
group = smsc
smsc = smpp
smsc-id = "T42865"
allowed-smsc-id = "T42865"
transceiver-mode = 1
host = 10.23.15.4
our-host = 10.14.19.7
port = 8808
receive-port = 0
smsc-username = "username"
smsc-password = "password"
system-type = NULL
address-range = ""
source-addr-ton = 0
source-addr-npi = 1
dest-addr-ton = 2
dest-addr-npi = 1
msg-id-type = 0x01
log-file = "/var/log/kannel/smsc/T42865.log"
log-level = 0

And my smsbox is like this:
group = smsbox
bearerbox-host = localhost
sendsms-port = 13013
sendsms-chars = "0123456789 "
log-file = "/var/log/kannel/smsbox/smsbox.log"
log-level = 1
access-log = "/var/log/kannel/smsbox/access.log"
mo-recode = true
http-request-retry = 10
http-queue-delay = 30


With this configuration If I want to send Β the chars "@ �  or �Ή" Β I
just urlencode the values and send them with coding=0

$msg = urlencode('@� �Ή');

so $msg is %40%C3%B1%C3%A9

where:
%40 on UTF-8 is = Ξ’ 00 on gsm
%C3%B1 on UTF-8 is = Ξ’ 7D on gsm
%C3%A9 on UTF-8 is = Ξ’ 05 on gsm

I send Ξ’ the message like:

cgi-bin/sendsms?text=%40%C3%B1%C3%A9&coding=0....

on the debug logs I see the following:
Ξ’ [12] DEBUG: Ξ’ Ξ’ Octet string at 0x801ef4e60:
Ξ’ [12] DEBUG: Ξ’ Ξ’ Ξ’ len: Ξ’ 3
Ξ’ [12] DEBUG: Ξ’ Ξ’ Ξ’ size: 6
Ξ’ [12] DEBUG: Ξ’ Ξ’ Ξ’ immutable: 0
Ξ’ [12] DEBUG: Ξ’ Ξ’ Ξ’ data: 00 7d 05 .}.
Ξ’ [12] DEBUG: Ξ’ Ξ’ Octet string dump ends.

where seems that kannel is properly converting from UTF-8 go the GSM 7
bit charset
DEBUG: Ξ’ Ξ’ Ξ’ data: 00 7d 05

but later on the bearerbox (access.log) I get something like this:

[msg:5:@....] [udh:0:]

If I am right, it means it is using 5 characters to send the @� �Ή

Now If I add to the Ξ’ smsc this:
alt-charset = "UTF-8"

the debug output is:
DEBUG: Ξ’ data: 40 c3 b1 c3 a9 Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ Ξ’ @....

and the bearerbox (access.log) is the same:
[msg:5:@....] [udh:0:]

But in this time the txt messages was Ξ’ properly delivering to the
users displaying the chars @� �Ή instead of just ??? but the size of the
sent messages was again 5 instead of 3.

So my question is how to properly code or send the message to use only
3 chars instead of 5 when sending only gsm-7 chars.

I have also try using this:

text=%00%7D%05&coding=0&alt-dcs=1

of

text=007D05&coding=0&alt-dsc=1

but the message received by the phone din't display the chars. also
changing mo-encode true/false din't help.

When using UCS-2 and coding=2 the chars are displayed on the mobile
but I can only send a max of 70 chars. and I would like to send 160.

Any idea of how to do it?

thanks in advance.







Reply via email to