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
0A06F4343DEC9E0102062A0003050D012E5345512115030000001C0000001C000000841E008101FF
9E0101080300FFFF3B0003BE230E247C439E447C047C162A429AF7051603429EF7051603226AF70B
42A2F74D16062278F70B16062282F70B16062282F717160C2278F70B1606226A3714160342A2F702
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
0A06F4343DEC9E0102062A0003050D012E5345512115030000001C0000001C000000841E008101FF
9E0101080300FFFF3B0003BE230E247C439E447C047C162A429AF7051603429EF7051603226AF70B
42A2F74D16062278F70B16062282F70B16062282F717160C2278F70B1606226A3714160342A2F702
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
371c373
< if((msg->sms.pid >=0) && (msg->sms.pid < 256) ) {
---
> if(msg->sms.pid != 0) {