Hello,

I was looking forward for this bug and it appears that the code is not clear
on the transcoding (see below), does someone know why the transcoding is
done in at_smsc :


    debug("bb.smsc.at2", 0, "AT2[%s]: Udh decoding done len=%d udhi=%d
udhlen=%d udh='%s'",
          octstr_get_cstr(privdata->name), len, udhi, udhlen, (udh ?
octstr_get_cstr(udh) : ""));

    if (pos > octstr_len(pdu) || len < 0)
        goto msg_error;

    /* build the message */
    message = msg_create(sms);
    if (!dcs_to_fields(&message, dcs)) {
        /* XXX Should reject this message? */
        debug("bb.smsc.at2", 0, "AT2[%s]: Invalid DCS",
octstr_get_cstr(privdata->name));
        dcs_to_fields(&message, 0);
    }

    message->sms.pid = pid;

    /* deal with the user data -- 7 or 8 bit encoded */
    tmpstr = octstr_copy(pdu, pos, len);
    if (message->sms.coding == DC_8BIT || message->sms.coding == DC_UCS2) {
        text = octstr_duplicate(tmpstr);
    } else {
        int offset = 0;
        text = octstr_create("");
        if (udhi && message->sms.coding == DC_7BIT) {
            int nbits;
            nbits = (udhlen + 1) * 8;
            /* fill bits for UDH to septet boundary */
            offset = (((nbits / 7) + 1) * 7 - nbits) % 7;     
        }
        at2_decode7bituncompressed(tmpstr, len, text, offset);
    }

    message->sms.sender = origin;
    if (octstr_len(privdata->my_number)) {
        message->sms.receiver = octstr_duplicate(privdata->my_number);
    } else {
        /* Put a dummy address in the receiver for now (SMSC requires one)
*/
        message->sms.receiver = octstr_create_from_data("1234", 4);
    }
    if (udhi) {
        message->sms.udhdata = udh;
    }
    message->sms.msgdata = text;
    message->sms.time = stime;

    /* cleanup */
    octstr_destroy(pdu);
    octstr_destroy(tmpstr);

    return message;


 

-----Original Message-----
From: info.ubichip [mailto:[EMAIL PROTECTED] 
Sent: jeudi 15 mai 2008 01:11
To: users@kannel.org
Subject: Strange msg data conversion in pdu : kannel bug ?

Hello,

I got a strange behavior from kannel.

Here is the log from the bearerbox that show a message arrived :

2008-05-15 08:53:48 [26800] [6] DEBUG: AT2[GSM0]: <--
07913366003000F0240B913366496236F90000805051
80054080A01354005000000000000000000000000000704A200A0F0103134010D267B2985C3E
9B5D924421000000000000
000000000000000000000000000000000000000000000000040A020000000000000000000000
0000000000000000000000
0000000000000000000000061D95A841186C340A010000000000000000000000000000000000
000000000000000000
2008-05-15 08:53:48 [26800] [6] DEBUG: AT2[GSM0]: received message from
SMSC: +33660003000
2008-05-15 08:53:48 [26800] [6] DEBUG: AT2[GSM0]: Numeric sender
(international) <+33669426639>
2008-05-15 08:53:48 [26800] [6] DEBUG: AT2[GSM0]: User data length read as
(160)
2008-05-15 08:53:48 [26800] [6] DEBUG: AT2[GSM0]: Udh decoding done len=160
udhi=0 udhlen=0 udh=''
2008-05-15 08:53:48 [26800] [12] DEBUG: send_msg: sending msg to box:
<127.0.0.1>
2008-05-15 08:53:48 [26800] [12] DEBUG: boxc_sender: sent message to
<127.0.0.1>


I assumed the user data (length=0A=160) is :


1354005000000000000000000000000000704A200A0F0103134010D267B2985C3E9B5D924421
000000000000
000000000000000000000000000000000000000000000000040A020000000000000000000000
0000000000000000000000
0000000000000000000000061D95A841186C340A010000000000000000000000000000000000
000000000000000000

Then the message is transmit to the smsbox :

2008-05-15 08:50:08 [26835] [0] INFO: Connected to bearerbox at 127.0.0.1
port 13003.
2008-05-15 08:53:48 [26835] [4] INFO: Starting to service
<?([EMAIL PROTECTED]@@@@@@@@@@@@@@@\'Çòéå$ø?£òèigdbdeg
è¥?Çé£@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@£é$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@¥æ*"
$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@> from <+33yyyyyyyy> to <003xxxxxxxx>

And then the transmit data to the web server throug a sms service :

 "GET
/INSMS.jsp?t=2008-05-15+06:56:03&q=%2B3366942xx39&coding=0&charset=ISO-8859-
1&a=%3F(%A3%40%E9%A3%40%40%40%40%40%40%40%40%40%40%40%40%3F%40%5C'+%F2%E9%E5
%F27%40%A3+%E8jhdbdfhh*%C5%E8%A3%40%40%40%40%40%40%40%40%40%40%40%40%40%40%4
0%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%A3%E9%24%40%40
%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%
40%40%40%40%40%40%40%40%40%40%40%A5%C6%26%C9%F8%A5%E9%DF+%E8%A3%40%40%40%40%
40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40%40


I don't understand why kannel doesn't transmit the orginal 1354.... And why
it is making strange caracters in the url such as the parenthesis or the
strange "%E8jhdbdfhh*" in the middle of the url.

Is it a bug in kannel or I forget something ? Is it a problem with url
encode or with pdu transformation ?

Please help me.











Reply via email to