From f323e782dac5faaabc76c903495a14eddf7f79c2 Mon Sep 17 00:00:00 2001
From: Adhidarma Hadiwinoto <me@adhisimon.org>
Date: Wed, 7 Aug 2019 19:01:11 +0700
Subject: [PATCH] Penanganan gagal kirim SMS

---
 lib/modem.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/modem.js b/lib/modem.js
index 22d51c8..a8bc763 100644
--- a/lib/modem.js
+++ b/lib/modem.js
@@ -272,7 +272,8 @@ async function registerSignalStrengthBackgroundQuery() {
 async function sendSMS(destination, msg) {
     if (typeof destination !== 'string' || typeof msg !== 'string' || !destination.trim() || !msg.trim()) return;
 
-    const parser = new ParserRegex({ regex: REGEX_WAIT_FOR_OK_OR_ERROR });
+    // const parser = new ParserRegex({ regex: REGEX_WAIT_FOR_OK_OR_ERROR });
+    const parser = new ParserReadline({ delimiter: '\r\n' });
     parser.on('data', () => {
         port.unpipe(parser);
         mutex.releaseLockWaitForSubCommand();
-- 
1.9.0