All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] SMS-DELIVER TP-OA Alphanum decoding and encoding fix
@ 2015-02-13 12:23 Tommi Kenakkala
  2015-02-13 12:23 ` [PATCH 1/2] sms: " Tommi Kenakkala
  2015-02-13 12:23 ` [PATCH 2/2] unit: SMS-DELIVER decoding/encoding test for long alphanum address Tommi Kenakkala
  0 siblings, 2 replies; 7+ messages in thread
From: Tommi Kenakkala @ 2015-02-13 12:23 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

There are problems with some real-life scenarios where SMS-DELIVER originator
address is an alphanumeric string with 11 chars (some extended ASCII like äöü).
Currently oFono rejects such messages. Here's a patch to improve that.

Tommi Kenakkala (2):
  sms: SMS-DELIVER TP-OA Alphanum decoding and encoding fix
  unit: SMS-DELIVER decoding/encoding test for long alphanum address

 src/smsutil.c   |   12 +++++++++---
 src/smsutil.h   |    6 +++++-
 unit/test-sms.c |   38 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+), 4 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] sms: SMS-DELIVER TP-OA Alphanum decoding and encoding fix
@ 2015-02-13  9:49 Tommi Kenakkala
  0 siblings, 0 replies; 7+ messages in thread
From: Tommi Kenakkala @ 2015-02-13  9:49 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]

>
> Date: Thu, 12 Feb 2015 12:59:18 -0600
> From: Denis Kenzior <denkenz@gmail.com>
> To: ofono(a)ofono.org
> Subject: Re: [PATCH 1/2] sms: SMS-DELIVER TP-OA Alphanum decoding and
>         encoding fix
> Message-ID: <54DCF806.5060609@gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Tommi,
>
> On 02/12/2015 09:09 AM, Tommi Kenakkala wrote:
> > Ofono ignores receved SMS if they have a long alphanum address with
> > extended ascii characters:
> > 1) sms_encode_address_field: TP-OA max length comparison before encoding
> > is incorrect because TP-OA's 11 octets are 7-bit coded and thus transport
> > twelve 8-bit chars. Change ofono to compare character count to character
> > limit instead of octet limit.
>
> How did you arrive at 11 octet figure? TP-OA is limited to 12 bytes.  So
> 12 - TON - LEN = 10 bytes payload.
>

Apologies, I did develop this using those values but apparently had a
glitch in my thought-generator during patch creation. I'll re-submit a
better patch.
Thanks for the quick comments.

Br.
-- 
Tommi

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 1572 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH 0/2] SMS-DELIVER Alphanum TP-OA encoding/decoding fix
@ 2015-02-12 15:09 Tommi Kenakkala
  2015-02-12 15:09 ` [PATCH 1/2] sms: SMS-DELIVER TP-OA Alphanum decoding and encoding fix Tommi Kenakkala
  0 siblings, 1 reply; 7+ messages in thread
From: Tommi Kenakkala @ 2015-02-12 15:09 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1926 bytes --]

There are problems with some real-life scenarios where SMS-DELIVER originator
address is an alphanumeric string with 11 chars, some extended ASCII (like äöü).
Ofono assumes Short Message's TP-OA max length is 11 octets (ref [1] and [2])
and rejects messages whose _decoded_ alphanumeric address takes more
than 11 bytes.
However, [3] defines Alphanumeric address is 7-bit coded referring to [4].
7-bit alphabet coding allows packing up to twelve 8-bit characters into 11
octets. The limit applies to octets, not to decoded characters or bytes.
Here is a fix proposals for your consideration,
with these a phone utilizing ofono will accept such short messages.
FYI a commercial Android phone reference handles the same messages fine.
Note: I've been able to test only using max 11-character TP-OA, but referred 
specifications suggest a 12th char would fit into the 11 octets as well.

REFERENCES:
[1] 24.011 8.2.5.1 Originator address element
[2] 23040 9.2.2.1 SMS‑DELIVER type
[3] 23040 9.1.2.5 Address fields
[4] 3GPP TS 23.038 GSM 7‑bit default alphabet
[5] Problem 1 callstack:
 ofono_sms_deliver_notify
  src.sms:handle_deliver
   src.sms:sms_dispatch
    src/sms.c:compute_incoming_msgid
     src/smsutil.c:sms_encode
       src/smsutil.c:encode_deliver
        src/smsutil.c:sms_encode_address_field
         if (len > 11)
[6] Problem 2 callstack:
 ofono_sms_deliver_notify
  src/smsutil.c:sms_decode
   src/smsutil.c:decode_deliver
    src/smsutil.c:sms_decode_address_field
     if (strlen(utf8) > 20

Tommi Kenakkala (2):
  sms: SMS-DELIVER TP-OA Alphanum decoding and encoding fix
  unit: SMS-DELIVER decoding/encoding test for long alphanum address

 src/smsutil.c   |   12 +++++++++---
 src/smsutil.h   |    6 +++++-
 unit/test-sms.c |   52 ++++++++++++++++++++++++++++++++++++++++++++++++----
 3 files changed, 62 insertions(+), 8 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-13 15:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13 12:23 [PATCH 0/2] SMS-DELIVER TP-OA Alphanum decoding and encoding fix Tommi Kenakkala
2015-02-13 12:23 ` [PATCH 1/2] sms: " Tommi Kenakkala
2015-02-13 15:13   ` Denis Kenzior
2015-02-13 12:23 ` [PATCH 2/2] unit: SMS-DELIVER decoding/encoding test for long alphanum address Tommi Kenakkala
  -- strict thread matches above, loose matches on Subject: below --
2015-02-13  9:49 [PATCH 1/2] sms: SMS-DELIVER TP-OA Alphanum decoding and encoding fix Tommi Kenakkala
2015-02-12 15:09 [PATCH 0/2] SMS-DELIVER Alphanum TP-OA encoding/decoding fix Tommi Kenakkala
2015-02-12 15:09 ` [PATCH 1/2] sms: SMS-DELIVER TP-OA Alphanum decoding and encoding fix Tommi Kenakkala
2015-02-12 18:59   ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.