Exemplo n.º 1
0
        private bool BulkSmsRequest(string message)
        {
            _logger.LogDebug("SMS sending BULK_SMS_REQUEST start. SendId: {0}", SendId);

            int localPort = Send(ACKPacketFactory.BULK_SMS_REQUEST(SendId, message));

            // If localport == 0 then sending error
            if (localPort == 0)
            {
                return(false);
            }

            // get request
            string ret = Get(localPort);

            if (!ret.StartsWith(string.Format("PASSWORD {0}", SendId)))
            {
                ErrorMessage = "BULK_SMS_REQUEST error!";
                _logger.LogWarning("Bulk SMS BULK_SMS_REQUEST error. SendID: {0} Return value: {1}", SendId, ret);
                OnSmsSendError(this, new GoIpSmsSendErrorEventArgs(ErrorMessage, SendId));
                return(false);
            }

            _logger.LogDebug("SMS sending BULK_SMS_REQUEST successfully. SendId: {0}", SendId);
            return(true);
        }