]> git.ipfire.org Git - thirdparty/asterisk.git/commit
addons/chan_mobile: Increase buffer size of UCS2 encoded SMS messages
authorMatthew Jordan <mjordan@digium.com>
Sun, 9 Nov 2014 00:24:53 +0000 (00:24 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sun, 9 Nov 2014 00:24:53 +0000 (00:24 +0000)
commit80439dac049287be9aa671d39eca17aa495a5e9b
treeb08c1d4242bc1083df1c884e2ca92f2700a2d472
parented7dabef46502103b9fa0ad995f2f574d7ed820d
addons/chan_mobile: Increase buffer size of UCS2 encoded SMS messages

When UCS2 character encoding is used, one symbol in national language can be
expanded to 4 bytes. The current buffer used for receiving message in
do_monitor_phone is 256 bytes, which is not large enough for incoming messages.

For example:
* AT+CMGR phone response prefix
  '+CMGR: "REC UNREAD","+7**********",,"14/10/29,13:31:39+12"\r\n' - 60 bytes
* SMS body with UCS2 encoding (max) - 280 bytes
* AT+CMGR phone response suffix '\r\n\r\nOK\r\n' - 8 bytes
* Terminating null character - 1 byte

This results in a needed buffer size of 349 bytes. Hence, this patch opts for a
350 byte buffer.

ASTERISK-24468 #close
Reported by: Dmitriy Bubnov
patches:
  chan_mobile-1_8.diff uploaded by Dmitriy Bubnov (License 6651)
  chan_mobile-trunk.diff uploaded by Dmitry Bubnov (License 6651)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@427607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
addons/chan_mobile.c