Example #1
0
        public static string GetPhoneNo(string securitytoken, string sessionId)
        {
            try
            {
                Logger.Instance.LogMessage(Logger.LoggerFiles.DuoDefault, string.Format("GetPhoneNo sessionId : {0}", sessionId), Logger.LogLevel.Info);
                var startTIme   = DateTime.Now;
                var client      = new refEngagement.DuoEngagementServiceClient("basicEngagementEndpoint");
                var engagements = client.ViewEngagementOriginateBySessionID(securitytoken, sessionId);

                if (engagements != null)
                {
                    string[] parts = System.Text.RegularExpressions.Regex.Split(engagements.OtherData, "-");
                    Logger.Instance.LogMessage(Logger.LoggerFiles.DuoDefault, string.Format("GetPhoneNo - {0} . sessionId : {1} . Time Take : {2} . Engagement : {3}", engagements.OtherData, sessionId, DateTime.Now.Subtract(startTIme).TotalMilliseconds, engagements), Logger.LogLevel.Info);
                    return(parts[0]);
                }
                else
                {
                    Logger.Instance.LogMessage(Logger.LoggerFiles.DuoDefault, string.Format("GetPhoneNo - {0} . sessionId : {1} . Time Take : {2}", "Receive Null Data", sessionId, DateTime.Now.Subtract(startTIme).TotalMilliseconds), Logger.LogLevel.Info);
                }
            }
            catch (Exception exception)
            {
                Logger.Instance.LogMessage(Logger.LoggerFiles.DuoDefault, "GetPhoneNo", exception, Logger.LogLevel.Error);
            }
            return(string.Empty);
        }
Example #2
0
        public static string GetPhoneNo(string securitytoken, string sessionId)
        {
            try
            {
                var id = sessionId.Split('@');
                Logger.Instance.LogMessage(Logger.LoggerFiles.DuoDefault, string.Format("GetPhoneNo sessionId : {0}", sessionId), Logger.LogLevel.Info);
                var client      = new refEngagement.DuoEngagementServiceClient("basicEngagementEndpoint");
                var engagements = client.ViewEngagementOriginateBySessionID(securitytoken, id[0]);

                if (engagements != null)
                {
                    string[] parts = System.Text.RegularExpressions.Regex.Split(engagements.OtherData, "-");
                    Logger.Instance.LogMessage(Logger.LoggerFiles.DuoDefault, string.Format("GetPhoneNo - {0} . sessionId : {1}", engagements.OtherData, sessionId), Logger.LogLevel.Info);
                    return(parts[0]);
                }
            }
            catch (Exception exception)
            {
                Logger.Instance.LogMessage(Logger.LoggerFiles.DuoDefault, "Login fail", exception, Logger.LogLevel.Error);
            }
            return(string.Empty);
        }
Example #3
0
        public static string ViewCurrentEngagementDisplayInfo(string securitytoken, string sessionId)
        {
            try
            {
                //var id = sessionId.Split('@');
                Logger.Instance.LogMessage(Logger.LoggerFiles.DuoDefault, string.Format("ViewCurrentEngagementDisplayInfo sessionId : {0}", sessionId), Logger.LogLevel.Info);
                var client      = new refEngagement.DuoEngagementServiceClient("basicEngagementEndpoint");
                var engagements = client.ViewCurrentEngagementDisplayInfo(securitytoken, sessionId, "callserver", "ivr", "language");

                if (engagements != null)
                {
                    var lang  = engagements.FirstOrDefault(e => e.Key.Equals("language"));
                    var phone = engagements.FirstOrDefault(e => e.Key.Equals("phoneNumber"));
                    var ivr   = engagements.FirstOrDefault(e => e.Key.Equals("ivrPath"));
                    return(string.Format("language : {0} , Phone No : {1} , IVR : {2} ", lang != null ? lang.Value : "***", phone != null ? phone.Value : "***", ivr != null ? ivr.Value : "***"));
                }
            }
            catch (Exception exception)
            {
                Logger.Instance.LogMessage(Logger.LoggerFiles.DuoDefault, "ViewCurrentEngagementDisplayInfo", exception, Logger.LogLevel.Error);
            }
            return(string.Empty);
        }