[asterisk-commits] mjordan: trunk r427612 - in /trunk: ./ addons/chan_mobile.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Nov 8 18:26:59 CST 2014


Author: mjordan
Date: Sat Nov  8 18:26:57 2014
New Revision: 427612

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=427612
Log:
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

Modified:
    trunk/   (props changed)
    trunk/addons/chan_mobile.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/addons/chan_mobile.c
URL: http://svnview.digium.com/svn/asterisk/trunk/addons/chan_mobile.c?view=diff&rev=427612&r1=427611&r2=427612
==============================================================================
--- trunk/addons/chan_mobile.c (original)
+++ trunk/addons/chan_mobile.c Sat Nov  8 18:26:57 2014
@@ -3801,7 +3801,7 @@
 {
 	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;




More information about the asterisk-commits mailing list