public void SMSCallBack(int i)
        {
            var            req            = this.HttpContext.Request.Form;
            var            smsSid         = Request.Form["SmsSid"];
            var            messageStatus  = Request.Form["MessageStatus"];
            SMSSentRequest sMSSentRequest = new SMSSentRequest();

            sMSSentRequest.To   = req["to"];
            sMSSentRequest.Body = "SMS Id: " + smsSid.ToString() + "/nMessageStatus:" + messageStatus.ToString();
            this.ServiceClient.Post(sMSSentRequest);
        }
Beispiel #2
0
        public void Post(SMSSentRequest req)
        {
            this.EbConnectionFactory = new EbConnectionFactory(req.SolnId, this.Redis);
            Dictionary <string, string> MsgStatus = this.EbConnectionFactory.SMSConnection.SendSMS(req.To, req.Body);

            SMSStatusLogMqRequest logMqRequest = new SMSStatusLogMqRequest
            {
                SentStatus = new SentStatus()
            };

            if (!(MsgStatus is null))
            {
                foreach (var Info in MsgStatus)
                {
                    if (Info.Key == "To")
                    {
                        logMqRequest.SentStatus.To = Info.Value;
                    }
                    if (Info.Key == "From")
                    {
                        logMqRequest.SentStatus.From = Info.Value;
                    }
                    if (Info.Key == "Body")
                    {
                        logMqRequest.SentStatus.Body = Info.Value;
                    }
                    if (Info.Key == "Status")
                    {
                        logMqRequest.SentStatus.Status = Info.Value;
                    }
                    if (Info.Key == "Result")
                    {
                        logMqRequest.SentStatus.Result = Info.Value;
                    }
                    if (Info.Key == "ConId")
                    {
                        logMqRequest.SentStatus.ConId = int.Parse(Info.Value);
                    }
                }
            }
            logMqRequest.UserId   = req.UserId;
            logMqRequest.SolnId   = req.SolnId;
            logMqRequest.RefId    = req.RefId;
            logMqRequest.MetaData = JsonConvert.SerializeObject(req.Params);
            logMqRequest.RetryOf  = req.RetryOf;
            SaveSMSLogs(logMqRequest);
        }
Beispiel #3
0
        public IActionResult SendSMS(int i)
        {
            var            req            = this.HttpContext.Request.Form;
            SMSSentRequest sMSSentRequest = new SMSSentRequest();

            sMSSentRequest.To   = req["to"];
            sMSSentRequest.From = req["from"];
            sMSSentRequest.Body = req["body"];
            string[] subdomain = this.HttpContext.Request.Host.Host.Split('.');
            sMSSentRequest.TenantAccountId = subdomain[0];

            var client = new JsonServiceClient(this.ServiceClient.BaseUri)
            {
                Credentials = new NetworkCredential("GATblcTqWNFI9ljZRWX-aUtidVYjJwoj", "")
            };

            client.Post(sMSSentRequest);
            return(View());
        }
Beispiel #4
0
        public void CallBack(string apikey)
        {
            var            req            = this.HttpContext.Request.Form;
            var            smsSid         = Request.Form["SmsSid"];
            var            messageStatus  = Request.Form["MessageStatus"];
            string         stsbody        = req.ToJson();
            SMSSentRequest sMSSentRequest = new SMSSentRequest();

            sMSSentRequest.To   = "+919961596200";
            sMSSentRequest.Body = "SMS Id: " + smsSid.ToString() + "/nMessageStatus:" + messageStatus.ToString() + "/nFull Message:" + stsbody.ToString();
            string[] subdomain = this.HttpContext.Request.Host.Host.Split('.');
            sMSSentRequest.TenantAccountId = subdomain[0];

            var client = new JsonServiceClient(this.ServiceClient.BaseUri)
            {
                Credentials = new NetworkCredential(apikey, "")
            };

            client.Post(sMSSentRequest);
        }