From a72038e8028b5c7bc746c4a5da8c8a095f72b8d3 Mon Sep 17 00:00:00 2001 From: Michael Lambert Date: Thu, 20 Sep 2018 14:41:56 +1000 Subject: [PATCH] Allow TLV tags to be added to the SmppTransmitter send function --- Service/SmppTransmitter.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Service/SmppTransmitter.php b/Service/SmppTransmitter.php index 4c30c7f..f8536ff 100644 --- a/Service/SmppTransmitter.php +++ b/Service/SmppTransmitter.php @@ -5,6 +5,7 @@ use Kronas\SmppClientBundle\Encoder\GsmEncoder; use Kronas\SmppClientBundle\SMPP; use Kronas\SmppClientBundle\SmppCore\SmppAddress; +use Kronas\SmppClientBundle\SmppCore\SmppTag; use Kronas\SmppClientBundle\Transport\SocketTransport; use Kronas\SmppClientBundle\Transport\TransportInterface; use Kronas\SmppClientBundle\SmppCore\SmppClient; @@ -44,17 +45,18 @@ public function __construct(array $transportParamters, $login, $password, $signa /** * @param string $to * @param string $message + * @param null|SmppTag[] $tags * * @return string|void` */ - public function send($to, $message) + public function send($to, $message, $tags = null) { $message = GsmEncoder::utf8_to_gsm0338($message); $from = new SmppAddress($this->signature, SMPP::TON_ALPHANUMERIC); $to = new SmppAddress(intval($to), SMPP::TON_INTERNATIONAL, SMPP::NPI_E164); $this->openSmppConnection(); - $messageId = $this->smpp->sendSMS($from, $to, $message); + $messageId = $this->smpp->sendSMS($from, $to, $message, $tags); $this->closeSmppConnection(); return $messageId;