Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public string GetRawXml(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);

            GSMServer.Configuration.IConfiguration config = ObjectPool.Instance.Resolve <GSMServer.Configuration.IConfiguration>();
            string section = param.TryGet <string>("section");

            return(config.GetRawXml(section));
        }
Exemplo n.º 3
0
        private void Unmap(ParameterizedMap map)
        {
            this.datamap.Add("base", map.TryGet <BasicInformation>("base"));
            PacketEventArgs packet = map.TryGet <PacketEventArgs>("packet");

            if (packet != null)
            {
                DynamicData data = map.TryGet <DynamicData>("parameters");
                foreach (string key in data.GetDictionary().Keys)
                {
                    this.datamap.Add(key, data.GetDictionary()[key]);
                }
            }
        }
Exemplo n.º 4
0
        public BaseResult <GenericTypeResult <bool> > SetErrorMessageFormat(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);
            BasicInformation      basic = param.TryGet <BasicInformation>("base");
            BaseResult <GenericTypeResult <bool> > result = basic.SetErrorMessageFormat(param.TryGet <int>("format"));

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

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

            if (logging != null)
            {
                logging.Write(result);
            }
            return(result);
        }
Exemplo n.º 5
0
        public BaseResult <GenericTypeResult <int> > GetSignalQuality(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);
            BasicInformation      basic = param.TryGet <BasicInformation>("base");
            BaseResult <GenericTypeResult <int> > result = basic.GetSignalQuality();

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

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

            if (logging != null)
            {
                logging.Write(result);
            }
            return(result);
        }
Exemplo n.º 6
0
        public BaseResult <GenericTypeResult <bool> > SetFunctionality(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);
            BasicInformation      basic = param.TryGet <BasicInformation>("base");
            BaseResult <GenericTypeResult <bool> > result = basic.SetFunctionality((FunctionalityLevel)Convert.ToInt32(param.TryGet <string>("level")));

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

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

            if (logging != null)
            {
                logging.Write(result);
            }
            return(result);
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
        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);
        }
Exemplo n.º 9
0
        public BaseResult <USSDResult> SendUSSD(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);

            GSMCommunication.Feature.Call call   = new GSMCommunication.Feature.Call(param.TryGet <BasicInformation>("base"));
            BaseResult <USSDResult>       result = call.SendUSSD(param.TryGet <string>("code"), param.TryGet <string>("number"));

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

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

            if (logging != null)
            {
                logging.Write(result);
            }
            return(result);
        }
Exemplo n.º 10
0
        public BaseResult <GenericTypeResult <bool> > Answer(ParameterizedMap map)
        {
            UnboxParameterizedMap param = new UnboxParameterizedMap(map);

            GSMCommunication.Feature.Call          call   = new GSMCommunication.Feature.Call(param.TryGet <BasicInformation>("base"));
            BaseResult <GenericTypeResult <bool> > result = call.Answer();

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

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

            if (logging != null)
            {
                logging.Write(result);
            }
            return(result);
        }
Exemplo n.º 11
0
 public bool Save(ParameterizedMap map)
 {
     GSMServer.Configuration.IConfiguration config = ObjectPool.Instance.Resolve <GSMServer.Configuration.IConfiguration>();
     return(config.Save());
 }
Exemplo n.º 12
0
 public UnboxParameterizedMap(ParameterizedMap map)
 {
     Unmap(map);
 }