public BaseResult <SMSSendResult> Send(ParameterizedMap map) { UnboxParameterizedMap param = new UnboxParameterizedMap(map); GSMCommunication.Feature.SMS sms = new GSMCommunication.Feature.SMS(param.TryGet <BasicInformation>("base")); BaseResult <SMSSendResult> result = null; result = sms.Send(param.TryGet <string>("message"), param.TryGet <string>("number")); if (result != null) { result.ID = param.TryGet <string>("id"); IInternalLogging logging = ObjectPool.Instance.Resolve <IInternalLogging>(); ISMSLogging smsLogging = ObjectPool.Instance.Resolve <ISMSLogging>(); if (logging != null) { logging.Write(result); } if (smsLogging != null) { smsLogging.Send(result); } } return(result); }
public BaseResult<GenericTypeResult<bool>> Delete(ParameterizedMap map) { UnboxParameterizedMap param = new UnboxParameterizedMap(map); GSMCommunication.Feature.SMS sms = new GSMCommunication.Feature.SMS(param.TryGet<BasicInformation>("base")); BaseResult<GenericTypeResult<bool>> result = sms.Delete(param.TryGet<int>("index")); result.ID = param.TryGet<string>("id"); IInternalLogging logging = ObjectPool.Instance.Resolve<IInternalLogging>(); if (logging != null) logging.Write(result); return result; }
public List<BaseResult<SMSReadResult>> ReadAll(ParameterizedMap map) { UnboxParameterizedMap param = new UnboxParameterizedMap(map); GSMCommunication.Feature.SMS sms = new GSMCommunication.Feature.SMS(param.TryGet<BasicInformation>("base")); List<BaseResult<SMSReadResult>> result = sms.Read(SMSStatus.AllMessages); IInternalLogging logging = ObjectPool.Instance.Resolve<IInternalLogging>(); ISMSLogging smsLogging = ObjectPool.Instance.Resolve<ISMSLogging>(); if (smsLogging != null) smsLogging.Read(result); return result; }
public List <BaseResult <SMSReadResult> > ReadAll(ParameterizedMap map) { UnboxParameterizedMap param = new UnboxParameterizedMap(map); GSMCommunication.Feature.SMS sms = new GSMCommunication.Feature.SMS(param.TryGet <BasicInformation>("base")); List <BaseResult <SMSReadResult> > result = sms.Read(SMSStatus.AllMessages); IInternalLogging logging = ObjectPool.Instance.Resolve <IInternalLogging>(); ISMSLogging smsLogging = ObjectPool.Instance.Resolve <ISMSLogging>(); if (smsLogging != null) { smsLogging.Read(result); } return(result); }
public BaseResult <GenericTypeResult <bool> > Delete(ParameterizedMap map) { UnboxParameterizedMap param = new UnboxParameterizedMap(map); GSMCommunication.Feature.SMS sms = new GSMCommunication.Feature.SMS(param.TryGet <BasicInformation>("base")); BaseResult <GenericTypeResult <bool> > result = sms.Delete(param.TryGet <int>("index")); result.ID = param.TryGet <string>("id"); IInternalLogging logging = ObjectPool.Instance.Resolve <IInternalLogging>(); if (logging != null) { logging.Write(result); } return(result); }
public BaseResult<SMSSendResult> Send(ParameterizedMap map) { UnboxParameterizedMap param = new UnboxParameterizedMap(map); GSMCommunication.Feature.SMS sms = new GSMCommunication.Feature.SMS(param.TryGet<BasicInformation>("base")); BaseResult<SMSSendResult> result = null; result = sms.Send(param.TryGet<string>("message"), param.TryGet<string>("number")); if (result != null) { result.ID = param.TryGet<string>("id"); IInternalLogging logging = ObjectPool.Instance.Resolve<IInternalLogging>(); ISMSLogging smsLogging = ObjectPool.Instance.Resolve<ISMSLogging>(); if (logging != null) logging.Write(result); if (smsLogging != null) smsLogging.Send(result); } return result; }
private void InitSerialPort(BasicInformation connection) { //// let the connection remains open until the server is closed/disposed connection.Connector.Open(); connection.OnBeginExecuting(); BaseResult<GenericTypeResult<string>> manufacturer = connection.GetManufacturer(); if (!string.IsNullOrEmpty(manufacturer.Response.Result)) { connection.GetServiceCenter(); connection.SetErrorMessageFormat(1); connection.GetOperator(); PhoneBook pb = new PhoneBook(connection); pb.SetPhoneBookMemory(MemoryStorage.SIMOwnNumber); pb.GetInfo(); SMS sms = new SMS(connection); sms.SetMessageStorage(MemoryStorage.MobilePhonebook, MemoryStorage.MobilePhonebook, MemoryStorage.MobilePhonebook); sms.SetMessageFormat(connection.PDUMode); string prefixOwnNumber = string.Empty; if (string.IsNullOrEmpty(prefixOwnNumber)) { GSMServer.Configuration.IConfiguration configuration = ObjectPool.Instance.Resolve<GSMServer.Configuration.IConfiguration>(); prefixOwnNumber = ((ApplicationSettings)configuration).General.PrefixOwnNumber; } BaseResult<GenericTypeResult<List<PhoneNumberInfo>>> list = pb.ReadPhoneBook(MemoryStorage.SIMOwnNumber, 1, -1); if (list.Response.Result.Count > 0) { foreach (PhoneNumberInfo info in list.Response.Result) { if (info.Name.Equals(prefixOwnNumber)) { connection.OwnNumber = info.PhoneNumber; break; } } } portColletion.Add(connection); } connection.OnEndExecuting(); }