Hi,
On Friday 19 September 2003 16:07, Yury Mikhienko wrote:
[snip]
>
> in this case - yes, but now I modify my code to:
>
> if (msg->sms.coding == DC_UCS2) {
> /*
> * remove the first two bytes FE FF from octetstring (add from yuryx
> for SMSCv3.2) *
> */
> Octstr *octstr_tmp = NULL;
> short UTF_16_PREFIX = 0xfffe;
>
> #if (defined (__sparc__) || defined (__sparc) || defined (__sun))
> UTF_16_PREFIX = 0xfeff; /* in SPARC low byte follow from hight byte
> in word (in INTEL, bytes swap in memory) */ #endif
>
> octstr_swap_bytes(pdu->u.submit_sm.short_message); /* <--------
> that necessary for properlly work with UTF-16 encoded content (I use cocoon
> for serializing output content on each request) */ octstr_tmp =
swapping bytes is not needed , because it's normally done in the external box
(e.g. smsbox). So if your box send UCS2-LE then it's your problem, just send
msgdata as UCS2-BE and it will work...
> octstr_create("");
> octstr_append_data(octstr_tmp, (char*) &UTF_16_PREFIX, 2);
> if(octstr_ncompare(pdu->u.submit_sm.short_message, octstr_tmp, 2) ==
> 0) { octstr_delete(pdu->u.submit_sm.short_message, 0, 2);
> }
> octstr_destroy(octstr_tmp);
> }
ff fe should be removed indeed...
[snip]
>
> I found and correct the wrong code in pdu_pack function (smpp_pdu.c) in
> optional parameters packing section also diff in attachment
[snip]
agreed, it's a bug and should be fixed...but we must encode all integers for
optional parameters and not only tag, length...
--
Best regards / Mit besten Gr��en aus D�sseldorf
Dipl.-Ing.
Alexander Malysh
___________________________________________
Centrium GmbH
Vogelsanger Weg 80
40470 D�sseldorf
Fon: +49 (0211) 74 84 51 80
Fax: +49 (0211) 277 49 109
email: [EMAIL PROTECTED]
web: www.centrium.de
msn: [EMAIL PROTECTED]
icq: 98063111
___________________________________________
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html