public BaseResult<GenericTypeResult<bool>> SetPhoneBookMemory(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);
            GSMCommunication.Feature.PhoneBook pb = new GSMCommunication.Feature.PhoneBook(param.TryGet<BasicInformation>("base"));
            BaseResult<GenericTypeResult<bool>> result = pb.SetPhoneBookMemory(param.TryGet<string>("memory"));
            result.ID = param.TryGet<string>("id");

            IInternalLogging logging = ObjectPool.Instance.Resolve<IInternalLogging>();
            if (logging != null)
            {
                logging.Write(result);
            }
            return result;
        }
        public BaseResult<GenericTypeResult<List<PhoneNumberInfo>>> ReadPhoneBook(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);
            GSMCommunication.Feature.PhoneBook pb = new GSMCommunication.Feature.PhoneBook(param.TryGet<BasicInformation>("base"));
            BaseResult<GenericTypeResult<List<PhoneNumberInfo>>> result = pb.ReadPhoneBook(param.TryGet<string>("memory"), param.TryGet<int>("fromindex"), param.TryGet<int>("toindex"));
            result.ID = param.TryGet<string>("id");

            IInternalLogging logging = ObjectPool.Instance.Resolve<IInternalLogging>();
            if (logging != null)
            {
                logging.Write(result);
            }
            return result;
        }
Example #3
0
        public BaseResult <GenericTypeResult <bool> > WritePhoneBook(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);

            GSMCommunication.Feature.PhoneBook     pb     = new GSMCommunication.Feature.PhoneBook(param.TryGet <BasicInformation>("base"));
            BaseResult <GenericTypeResult <bool> > result = pb.WritePhoneBook(param.TryGet <string>("memory"), param.TryGet <string>("index"), param.TryGet <string>("name"), param.TryGet <string>("phonenumber"));

            result.ID = param.TryGet <string>("id");

            IInternalLogging logging = ObjectPool.Instance.Resolve <IInternalLogging>();

            if (logging != null)
            {
                logging.Write(result);
            }
            return(result);
        }
Example #4
0
        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();
        }