praekelt/vumi — pull request #778 by smn (2014-04-18 11:56:01+00:00)
Title: SMPP UDH encoding may be too eager.

From Mtech:

```
On another note, I have made a slight observation. The usage of SMS is also
not as efficient as could be. The messages come to us with a specified UDH
(SMS headers). What this means is that the 3rd Party tells us how many SMS
messages a response will be split up into. So far, I have noticed a limitation
of 130 characters for the first message. In other words, a message with 140
characters will be split into a 2-page SMS of 130 chars and 10 chars.
```

Looking at the logs seems to confirm this:

```
2014-04-16 22:00:21+0000 [VumiRedis,client] << {'body': {'mandatory_parameters': {'priority_flag': 0, 'dest_addr_npi': 1, 'source_addr': 'XXXXXX', 'protocol_id': 0, 'replace_if_present_flag': 0, 'registered_delivery': 1, 'dest_addr_ton': 0, 'source_addr_npi': 0, 'schedule_delivery_time': '', 'sm_default_msg_id': 0, 'sm_length': 0, 'esm_class': 64, 'data_coding': 0, 'service_type': '', 'source_addr_ton': 0, 'validity_period': '', 'destination_addr': '234XXXXXXXXX', 'short_message': '\x05\x00\x03\xd3\x02\x01Sorry! The promotion has now closed. Love football? Click http://m.guinnessvip.com/ for da inside track & more! Drink Responsibly.'}}, 'header': {'command_status': 'ESME_ROK', 'command_length': 0, 'sequence_number': 23672, 'command_id': 'submit_sm'}}
2014-04-16 22:00:21+0000 [VumiRedis,client] << {'body': {'mandatory_parameters': {'priority_flag': 0, 'dest_addr_npi': 1, 'source_addr': 'XXXXXX', 'protocol_id': 0, 'replace_if_present_flag': 0, 'registered_delivery': 1, 'dest_addr_ton': 0, 'source_addr_npi': 0, 'schedule_delivery_time': '', 'sm_default_msg_id': 0, 'sm_length': 0, 'esm_class': 64, 'data_coding': 0, 'service_type': '', 'source_addr_ton': 0, 'validity_period': '', 'destination_addr': '234XXXXXXXXX', 'short_message': '\x05\x00\x03\xd3\x02\x02 18+'}}, 'header': {'command_status': 'ESME_ROK', 'command_length': 0, 'sequence_number': 23673, 'command_id': 'submit_sm'}}
```

The sms is
```
Sorry! The promotion has now closed. Love football? Click http://m.guinnessvip.com/
for da inside track & more! Drink Responsibly. 18+
```

but it's chunked in two.