Exemplo n.º 1
0
 public GoIpDeliveryReportEventArgs(string message, GoIpSmsDeliveryReportPacket packet, string host, int port)
 {
     Message = message;
     Packet  = packet;
     Host    = host;
     Port    = port;
 }
Exemplo n.º 2
0
        private void DeliverReport(string data, string host, int port)
        {
            _logger.LogDebug("Start SMS delivery report");

            GoIpSmsDeliveryReportPacket packet = new GoIpSmsDeliveryReportPacket(data);

            // if auth error
            if (packet.authid != _options.AuthId || packet.password != _options.AuthPassword)
            {
                // TODO: log?
                _logger.LogInformation("Received SMS delivery report authentication error. Data: {0}", data);
                Send(ACKPacketFactory.ACK("DELIVER", packet.receiveid.ToString(), "Authentication error!"), host, port);
                OnDeliveryReport?.Invoke(this, new GoIpDeliveryReportEventArgs("Delivery report authentication error!", packet, host, port));
                return;
            }

            packet.password = "";  // Delete password for security reasons

            _logger.LogInformation("Received SMS delivery report OK. ReceiveId: {0} Send number: {1} SMS no: {2}", packet.receiveid, packet.send_num, packet.sms_no);

            Send(ACKPacketFactory.ACK("DELIVER", packet.receiveid.ToString(), ""), host, port);
            OnDeliveryReport?.Invoke(this, new GoIpDeliveryReportEventArgs("OK", packet, host, port));
        }