onlinecity / php-smpp

PHP 5 based SMPP client library
232 stars 160 forks source link

received message sometimes has no body #59

Open l0ft13 opened 8 years ago

l0ft13 commented 8 years ago

hard to reproduce but I have an example sending same "test" message into system from 2 different cellphones and one comes through fine, other one has no body although you can see the text is in the data there.

non-working message

DEBUG: read sms...

Read PDU        : 82 bytes
00 00 00 52 00 00 00 05 00 00 00 00 00 00 00 01 00 01 01 32 37 38 32 38 38 32 37 31 39 35 00 01 01 32 37 38 32 30 30 37 30 33 35 32 31 33 31 34 30 00 00 00 00 00 00 00 00 08 00 16 00 47 00 6f 00 74 00 20 00 74 00 65 00 73 00 74 00 20 d8 3d de 18 
body len        : 66
Command id      : 5
Command status  : 0
sequence number : 1

original packed
array (
  'id' => 5,
  'status' => 0,
  'sn' => 1,
  'body' => '' . "\0" . '  27828827195' . "\0" . '  2782007035213140' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . ' ' . "\0" . ' ' . "\0" . 'G' . "\0" . 'o' . "\0" . 't' . "\0" . ' ' . "\0" . 't' . "\0" . 'e' . "\0" . 's' . "\0" . 't' . "\0" . ' �=� ',
)
unpacked
array (
  1 => 0,
  2 => 1,
  3 => 1,
  4 => 50,
  5 => 55,
  6 => 56,
  7 => 50,
  8 => 56,
  9 => 56,
  10 => 50,
  11 => 55,
  12 => 49,
  13 => 57,
  14 => 53,
  15 => 0,
  16 => 1,
  17 => 1,
  18 => 50,
  19 => 55,
  20 => 56,
  21 => 50,
  22 => 48,
  23 => 48,
  24 => 55,
  25 => 48,
  26 => 51,
  27 => 53,
  28 => 50,
  29 => 49,
  30 => 51,
  31 => 49,
  32 => 52,
  33 => 48,
  34 => 0,
  35 => 0,
  36 => 0,
  37 => 0,
  38 => 0,
  39 => 0,
  40 => 0,
  41 => 0,
  42 => 8,
  43 => 0,
  44 => 22,
  45 => 0,
  46 => 71,
  47 => 0,
  48 => 111,
  49 => 0,
  50 => 116,
  51 => 0,
  52 => 32,
  53 => 0,
  54 => 116,
  55 => 0,
  56 => 101,
  57 => 0,
  58 => 115,
  59 => 0,
  60 => 116,
  61 => 0,
  62 => 32,
  63 => 216,
  64 => 61,
  65 => 222,
  66 => 24,
)
parsedarray (
  'service_type' => '' . "\0" . '',
  'source_addr_ton' => 1,
  'source_addr_npi' => 1,
  'source_addr' => '27828827195' . "\0" . '',
  'dest_addr_ton' => 1,
  'dest_addr_npi' => 1,
  'destination_addr' => '2782007035213140' . "\0" . '',
  'esm_class' => 0,
  'protocol_id' => 0,
  'priority_flag' => 0,
  'schedule_delivery_time' => 0,
  'validity_period' => 0,
  'registered_delivery' => 0,
  'replace_if_present_flag' => 0,
  'data_coding' => 8,
  'sm_default_msg_id' => 0,
  'sm_length' => 22,
  'short_message' => '04706f074020074065073074020d83dde18'

working message

DEBUG: read sms...

Read PDU        : 64 bytes
00 00 00 40 00 00 00 05 00 00 00 00 00 00 00 01 00 01 01 32 37 37 38 35 34 34 30 34 31 32 00 01 01 32 37 38 33 39 33 30 30 31 37 38 30 33 31 38 39 00 00 00 01 00 00 00 00 00 00 04 54 65 73 74 
body len        : 48
Command id      : 5
Command status  : 0
sequence number : 1

original packed
array (
  'id' => 5,
  'status' => 0,
  'sn' => 1,
  'body' => '' . "\0" . '  27785440412' . "\0" . '  2783930017803189' . "\0" . '' . "\0" . '' . "\0" . ' ' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . '' . "\0" . ' Test',
)
unpacked
array (
  1 => 0,
  2 => 1,
  3 => 1,
  4 => 50,
  5 => 55,
  6 => 55,
  7 => 56,
  8 => 53,
  9 => 52,
  10 => 52,
  11 => 48,
  12 => 52,
  13 => 49,
  14 => 50,
  15 => 0,
  16 => 1,
  17 => 1,
  18 => 50,
  19 => 55,
  20 => 56,
  21 => 51,
  22 => 57,
  23 => 51,
  24 => 48,
  25 => 48,
  26 => 49,
  27 => 55,
  28 => 56,
  29 => 48,
  30 => 51,
  31 => 49,
  32 => 56,
  33 => 57,
  34 => 0,
  35 => 0,
  36 => 0,
  37 => 1,
  38 => 0,
  39 => 0,
  40 => 0,
  41 => 0,
  42 => 0,
  43 => 0,
  44 => 4,
  45 => 84,
  46 => 101,
  47 => 115,
  48 => 116,
)
parsedarray (
  'service_type' => '' . "\0" . '',
  'source_addr_ton' => 1,
  'source_addr_npi' => 1,
  'source_addr' => '27785440412' . "\0" . '',
  'dest_addr_ton' => 1,
  'dest_addr_npi' => 1,
  'destination_addr' => '2783930017803189' . "\0" . '',
  'esm_class' => 0,
  'protocol_id' => 0,
  'priority_flag' => 1,
  'schedule_delivery_time' => 0,
  'validity_period' => 0,
  'registered_delivery' => 0,
  'replace_if_present_flag' => 0,
  'data_coding' => 0,
  'sm_default_msg_id' => 0,
  'sm_length' => 4,
  'short_message' => 'Test',
)