summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Duedal <hd@onlinecity.dk>2014-11-13 10:42:05 +0100
committerHans Duedal <hd@onlinecity.dk>2014-11-13 10:42:05 +0100
commitbc4a085967d3c0fa968ddcaf1a41945bb459a9a4 (patch)
tree09105dc52107218d401648d4f4cbdd23b6ddf373
parentc0cbc62d82c7614501f93fa4e00514f4e844a40b (diff)
downloadphp-smpp-bc4a085967d3c0fa968ddcaf1a41945bb459a9a4.zip
php-smpp-bc4a085967d3c0fa968ddcaf1a41945bb459a9a4.tar.gz
php-smpp-bc4a085967d3c0fa968ddcaf1a41945bb459a9a4.tar.bz2
Fixed SMS padding if configured with 8bit CSMS UDH
Some providers would pad messages with 0x0D if using 8 bit CSMS reference numbers in the UDH and only using 152 of the available 153 GSM 03.38 chars.
-rw-r--r--smppclient.class.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/smppclient.class.php b/smppclient.class.php
index 8a01a42..9c6ea91 100644
--- a/smppclient.class.php
+++ b/smppclient.class.php
@@ -266,6 +266,7 @@ class SmppClient
* $message is always in octets regardless of the data encoding.
* For correct handling of Concatenated SMS, message must be encoded with GSM 03.38 (data_coding 0x00) or UCS-2BE (0x08).
* Concatenated SMS'es uses 16-bit reference numbers, which gives 152 GSM 03.38 chars or 66 UCS-2BE chars per CSMS.
+ * If we are using 8-bit ref numbers in the UDH for CSMS it's 153 GSM 03.38 chars
*
* @param SmppAddress $from
* @param SmppAddress $to
@@ -290,7 +291,7 @@ class SmppClient
break;
case SMPP::DATA_CODING_DEFAULT:
$singleSmsOctetLimit = 160; // we send data in octets, but GSM 03.38 will be packed in septets (7-bit) by SMSC.
- $csmsSplit = 152; // send 152 chars in each SMS since, we will use 16-bit CSMS ids (SMSC will format data)
+ $csmsSplit = (self::$csms_method == SmppClient::CSMS_8BIT_UDH) ? 153 : 152; // send 152/153 chars in each SMS (SMSC will format data)
break;
default:
$singleSmsOctetLimit = 254; // From SMPP standard