Bug in smsc_emi2.c?

"Steve Rapaport" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
This diff is suggested by Francesco, it makes
sense to me.  Could someone please respond and
say if we're crazy or it should be included?

smsc_emi2.c::
373c371
<     if(msg->sms.pid != 0) {
---
>     if((msg->sms.pid  >=0) && (msg->sms.pid < 256) ) {

Thanks, all.  See below for the use case that fails without this diff.
____________________________________________
Steve Rapaport
CTO, A-Tono
Via Amedei, 15 - Milano 20123
Cel.: +39 348 6431573
Fax : +1 617 687 0415



-----Original Message-----
From: francesco emmi [mailto:[email protected]]
Sent: Monday, March 25, 2002 12:09 PM
To: [email protected]; [email protected]
Cc: [email protected]
Subject: Explaining PDU trouble


Dear Mr. Rodrigues,

As I wrote in the past, we have tried to send 8-bit SMS with EMI2 without
success. We set  PID to 0 and UDH to F5. Although we didn't
receive the SMS correctly, we could analize the PDU received by mobile:


07919333852802004414D0E5F61CFD6E975DEE321D39F5203012911504408C1180
0A06F4343DEC9E0102062A0003050D012E5345512115030000001C0000001C000000841E0081
01FF
9E0101080300FFFF3B0003BE230E247C439E447C047C162A429AF7051603429EF7051603226A
F70B
42A2F74D16062278F70B16062282F70B16062282F717160C2278F70B1606226A3714160342A2
F702
960142A4F702960142A2F7029601429EF702.


As you can see, for some reason unknown, PID was changed to 39.
We thought the problem was in the kannel code. Look at smsc_emi2.c
(in the CVS version) line 373:

 if(msg->sms.pid != 0) {
         emimsg->fields[E50_RPID] = octstr_format("%04d", msg->sms.pid);


As we want to set PID to 0, no octet is created in our PDU.
Changing the code in a way such this:

 if((msg->sms.pid >= 0) && (msg->sms.pid<256)) {
        emimsg->fields[E50_RPID] = octstr_format("%04d", msg->sms.pid);

finally we could receive the 8-bit SMS corectly whose PDU was:

07919333852802004414D0E5F61CFD6E975DEE321D00F5203012911504408C1180
0A06F4343DEC9E0102062A0003050D012E5345512115030000001C0000001C000000841E0081
01FF
9E0101080300FFFF3B0003BE230E247C439E447C047C162A429AF7051603429EF7051603226A
F70B
42A2F74D16062278F70B16062282F70B16062282F717160C2278F70B1606226A3714160342A2
F702
960142A4F702960142A2F7029601429EF702

As you can see, PID now is 0.

So, do you think the piece of code I underlined, is a bug?

I'll include a diff file for smsc.emi2.c

Thank in advance

Francesco Emmi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.