diff options
author | Matthew Jordan <mjordan@digium.com> | 2014-11-09 00:26:57 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2014-11-09 00:26:57 +0000 |
commit | d773f9d03e5c337045a2434314ebd8da95bdad11 (patch) | |
tree | dce7925c789673e2b87c03b7eb014b0006cff106 /addons | |
parent | 08d773532bdbef24c6785ab8c3c5144d6a10df80 (diff) |
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)
........
Merged revisions 427607 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 427610 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 427611 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'addons')
-rw-r--r-- | addons/chan_mobile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/chan_mobile.c b/addons/chan_mobile.c index aa537c96a..3304702d2 100644 --- a/addons/chan_mobile.c +++ b/addons/chan_mobile.c @@ -3801,7 +3801,7 @@ static void *do_monitor_phone(void *data) { struct mbl_pvt *pvt = (struct mbl_pvt *)data; struct hfp_pvt *hfp = pvt->hfp; - char buf[256]; + char buf[350]; int t; at_message_t at_msg; struct msg_queue_entry *entry; |