diff options
-rw-r--r-- | gateway/protocol/smppclient.class.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gateway/protocol/smppclient.class.php b/gateway/protocol/smppclient.class.php index 6c4de5b..d7aedab 100644 --- a/gateway/protocol/smppclient.class.php +++ b/gateway/protocol/smppclient.class.php @@ -920,8 +920,10 @@ class DeliveryReceipt extends SMS */ public function parseDeliveryReceipt() { - $numMatches = preg_match('/^id:([^ ]+) sub:(\d{1,3}) dlvrd:(\d{3}) submit date:(\d{10}) done date:(\d{10}) stat:([A-Z]{7}) err:(\d{3}) text:(.*)$/', $this->message, $matches); - if ($numMatches == 0) throw new \InvalidArgumentException('Could not parse delivery receipt'); + $numMatches = preg_match('/^id:([^ ]+) sub:(\d{1,3}) dlvrd:(\d{3}) submit date:(\d{10}) done date:(\d{10}) stat:([A-Z]{7}) err:(\d{3}) text:(.*)$/ms', $this->message, $matches); + if ($numMatches == 0) { + throw new \InvalidArgumentException('Could not parse delivery receipt: '.$this->message."\n".bin2hex($this->body)); + } list($matched, $this->id, $this->sub, $this->dlvrd, $this->submitDate, $this->doneDate, $this->stat, $this->err, $this->text) = $matches; // Convert dates |