Commit 3f614b14accc8e6529fd48cab82dde7332945729

Authored by Adhidarma Hadiwinoto
1 parent 48edb4d589
Exists in master

MAX_SMS_LENGTH

Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff

1 1 "use strict";
2 2  
  3 +const MAX_SMS_LENGTH = 160;
  4 +
3 5 const url = require('url');
4 6 const request = require('request');
5 7 const uuidv4 = require('uuid/v4');
... ... @@ -20,8 +22,8 @@ function _send(destinationNumber, msg, handlerIMSI) {
20 22 if (msg.length > 160) {
21 23 logger.info('Splitting message');
22 24  
23   - const newMsg = msg.slice(0, 160);
24   - const remainingMsg = msg.slice(160);
  25 + const newMsg = msg.slice(0, MAX_SMS_LENGTH);
  26 + const remainingMsg = msg.slice(MAX_SMS_LENGTH);
25 27  
26 28 _send(destinationNumber, newMsg, handlerIMSI);
27 29 setTimeout(() => {