public SmppSmsSettings GetSetting(SmsServiceType smsServiceType) { SmppSmsSettings setting = null; if (!this.settingsDict.TryGetValue(smsServiceType, out setting)) { throw new Exception($"Invalid Setting {smsServiceType}"); } return(setting); }
public BaseSmppSmsService(ISmppSmsSettingsProvider provider)//, ISmsDao smsDao) { this.smppSmsSettings = provider.GetSetting(this.SmsServiceType); this.TimerReconnect = new System.Timers.Timer(); // Create 1st instance of the SMPP component smppClientConnection = new smscc.SMPP.SMSCclientSMPP(); ((System.ComponentModel.ISupportInitialize)(this.TimerReconnect)).BeginInit(); // // TimerReconnect // this.TimerReconnect.AutoReset = false; this.TimerReconnect.Interval = this.smppSmsSettings.TimerInterval; //10000 this.TimerReconnect.Elapsed += new System.Timers.ElapsedEventHandler(this.TimerReconnect_Elapsed); // // smsccService // ((System.ComponentModel.ISupportInitialize)(this.TimerReconnect)).EndInit(); // Just to be sure TimerReconnect.Enabled = false; // Set properties required for communication smppClientConnection.KeepAliveInterval = 10; smppClientConnection.OnTcpDisconnected += SMSCclientSMPP_OnTcpDisconnected; //smppClientConnection.OnSmppMessageReceived += SMSCclientSMPP_OnSmppMessageReceived; smppClientConnection.OnSmppStatusReportReceived += SMSCclientSMPP_OnSmppStatusReportReceived; smppClientConnection.OnSmppSubmitResponseAsyncReceived += SMSCclientSMPP_OnSmppSubmitResponseAsyncReceived; smppClientConnection.ThrottleRate = 100; // Signal for automatic reconnecting that // service initialization is finished bServiceReady = true; // Start timer for first lap TimerReconnect.Enabled = true; }
public BaseInfoBipSmsService(ISmppSmsSettingsProvider provider) { this.smppSmsSettings = provider.GetSetting(this.SmsServiceType); }