Dear Devels,

I'm having problems receiving MO messages when addr-ton = 1

I get an error:

"Mallformed addr `12345, expected at least 7 digits."

I've isolated the problem to smsc_smpp.c, function convert_addr_from_pdu():

...
   switch(ton) {
   case GSM_ADDR_TON_INTERNATIONAL:
       /*
        * Checks to perform:
        *   1) assume international number has at least 7 chars
        *   2) the whole source addr consist of digits, exception '+' in front
        */
       if (octstr_len(addr) < 7) {
           error(0, "SMPP[%s]: Mallformed addr `%s', expected at
least 7 digits. ",
                    octstr_get_cstr(id),
                    octstr_get_cstr(addr));
           reason = SMPP_ESME_RINVSRCADR;
           goto error;
       } else if (octstr_get_char(addr, 0) == '+' &&
                  !octstr_check_range(addr, 1, 256, gw_isdigit)) {
           error(0, "SMPP[%s]: Mallformed addr `%s', expected all digits. ",
                    octstr_get_cstr(id),
                    octstr_get_cstr(addr));
           reason = SMPP_ESME_RINVSRCADR;
           goto error;
       } else if (octstr_get_char(addr, 0) != '+' &&
                  !octstr_check_range(addr, 0, 256, gw_isdigit)) {
           error(0, "SMPP[%s]: Mallformed addr `%s', expected all digits. ",
                    octstr_get_cstr(id),
                    octstr_get_cstr(addr));
           reason = SMPP_ESME_RINVSRCADR;
           goto error;
       }
....

Here's a sample MO PDU triggering the problem (numbers and smsc's
changed but preserving their original length):

2006-06-27 14:06:31 [11061] [37] DEBUG: SMPP[my-own-smsc]: Got PDU:
2006-06-27 14:06:31 [11061] [37] DEBUG: SMPP PDU 0x989cb08 dump:
2006-06-27 14:06:31 [11061] [37] DEBUG:   type_name: deliver_sm
2006-06-27 14:06:31 [11061] [37] DEBUG:   command_id: 5 = 0x00000005
2006-06-27 14:06:31 [11061] [37] DEBUG:   command_status: 0 = 0x00000000
2006-06-27 14:06:31 [11061] [37] DEBUG:   sequence_number: 1780 = 0x000006f4
2006-06-27 14:06:31 [11061] [37] DEBUG:   service_type: NULL
2006-06-27 14:06:31 [11061] [37] DEBUG:   source_addr_ton: 1 = 0x00000001
2006-06-27 14:06:31 [11061] [37] DEBUG:   source_addr_npi: 1 = 0x00000001
2006-06-27 14:06:31 [11061] [37] DEBUG:   source_addr: "12345678901"
2006-06-27 14:06:31 [11061] [37] DEBUG:   dest_addr_ton: 1 = 0x00000001
2006-06-27 14:06:31 [11061] [37] DEBUG:   dest_addr_npi: 1 = 0x00000001
2006-06-27 14:06:31 [11061] [37] DEBUG:   destination_addr: "12345"
2006-06-27 14:06:31 [11061] [37] DEBUG:   esm_class: 0 = 0x00000000
2006-06-27 14:06:31 [11061] [37] DEBUG:   protocol_id: 0 = 0x00000000
2006-06-27 14:06:31 [11061] [37] DEBUG:   priority_flag: 0 = 0x00000000
2006-06-27 14:06:31 [11061] [37] DEBUG:   schedule_delivery_time: NULL
2006-06-27 14:06:31 [11061] [37] DEBUG:   validity_period: NULL
2006-06-27 14:06:31 [11061] [37] DEBUG:   registered_delivery: 0 = 0x00000000
2006-06-27 14:06:31 [11061] [37] DEBUG:   replace_if_present_flag: 0 =
0x00000000
2006-06-27 14:06:31 [11061] [37] DEBUG:   data_coding: 0 = 0x00000000
2006-06-27 14:06:31 [11061] [37] DEBUG:   sm_default_msg_id: 0 = 0x00000000
2006-06-27 14:06:31 [11061] [37] DEBUG:   sm_length: 6 = 0x00000006
2006-06-27 14:06:31 [11061] [37] DEBUG:   short_message: "Test 6"
2006-06-27 14:06:31 [11061] [37] DEBUG: SMPP PDU dump ends.
2006-06-27 14:06:31 [11061] [37] ERROR: SMPP[my-own-smsc]: Mallformed
addr `12345', expected at least 7 digits.
2006-06-27 14:06:31 [11061] [37] DEBUG: SMPP[my-own-smsc]: Sending PDU:
2006-06-27 14:06:31 [11061] [37] DEBUG: SMPP PDU 0x989ba20 dump:
2006-06-27 14:06:31 [11061] [37] DEBUG:   type_name: deliver_sm_resp
2006-06-27 14:06:31 [11061] [37] DEBUG:   command_id: 2147483653 = 0x80000005
2006-06-27 14:06:31 [11061] [37] DEBUG:   command_status: 10 = 0x0000000a
2006-06-27 14:06:31 [11061] [37] DEBUG:   sequence_number: 1780 = 0x000006f4
2006-06-27 14:06:31 [11061] [37] DEBUG:   message_id: NULL
2006-06-27 14:06:31 [11061] [37] DEBUG: SMPP PDU dump ends.

Is this a bug, or really the dest address must have at least 7 digits?
Shouldn't be the source address? I've temporarily fixed it changing
the "7" to a "4", but I'd like to know if I'm doing something wrong
(maybe shall I prepend the short number with an international country
code?? I don't think so...) or if I've spotted a real bug.

Note that the error thrown is SMPP_ESME_RINVSRCADR but the check is
apparently performed over the destination_addr. Is this right?

Thank you in advance,
-- 
Alejandro Guerrieri
Magicom
http://www.magicom-bcn.net/
LinkedIn: http://www.linkedin.com/in/aguerrieri

_______________________________________________
devel mailing list
[email protected]
http://www.kannel.org/mailman/listinfo/devel

Reply via email to