Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            SMPPClient client = new SMPPClient();
            SMSC       sms    = new SMSC()
            {
                Host       = "smpp.smsc.ru",
                Port       = 3700,
                SystemId   = "SystemId",
                Password   = "******",
                SourceTon  = 5,
                SourceNpi  = 1,
                AddrTon    = 1,
                AddrNpi    = 1,
                SystemType = ""
            };

            client.AddSMSC(sms);

            if (client.Connect())
            {
                int res = client.SendSms("from", "to", "message");
                Console.WriteLine(res);

                client.Disconnect();
                client.ClearSMSC();
            }

            Console.ReadLine();
        }
Ejemplo n.º 2
0
 public virtual void Dispose()
 {
     Disconnect();
     smppClient = null;
     events.Clear();
     events = null;
     statusCodes.Clear();
     statusCodes = null;
 }
Ejemplo n.º 3
0
        public SmsClient()
        {
            smppClient = new SMPPClient();

            smppClient.OnDeliverSm    += new DeliverSmEventHandler(onDeliverSm);
            smppClient.OnSubmitSmResp += new SubmitSmRespEventHandler(onSubmitSmResp);

            smppClient.OnLog   += new LogEventHandler(onLog);
            smppClient.LogLevel = 0xffff /* LogLevels.LogErrors */;

            LoadConfig();

            smppClient.Connect();
        }
Ejemplo n.º 4
0
        public SmsClient(string description, string host, int port, string systemId, string password, string systemType, int seqn)
        {
            smppClient = new SMPPClient();

            smppClient.OnDeliverSm    += new DeliverSmEventHandler(onDeliverSm);
            smppClient.OnSubmitSmResp += new SubmitSmRespEventHandler(onSubmitSmResp);

            smppClient.OnLog   += new LogEventHandler(onLog);
            smppClient.LogLevel = LogLevels.LogErrors;
            // smppClient.LogLevel = LogLevels.LogDebug;

            SMSC smsc = new SMSC(description, host, port, systemId, password, systemType, seqn);

            smppClient.AddSMSC(smsc);
        }
Ejemplo n.º 5
0
        public SmsClient(bool writeLog)
        {
            this.writeLog = writeLog;

            smppClient                 = new SMPPClient();
            smppClient.WriteLog        = writeLog;
            smppClient.OnDeliverSm    += new DeliverSmEventHandler(onDeliverSm);
            smppClient.OnSubmitSmResp += new SubmitSmRespEventHandler(onSubmitSmResp);

            smppClient.OnLog   += new LogEventHandler(onLog);
            smppClient.LogLevel = LogLevels.LogErrors;

            LoadConfig();

            smppClient.Connect();
        }