Exemplo n.º 1
0
        public InteractionCredentials ReSetCredentials(string AgentID = "", string password = "", string location = "", string queue = "0", string AgentName = "Guest")
        {
            // This is a simple implementation of the credentials provider.
            // Here, we're using the current user credentials but credentials could
            // come from any source, custom fields, objects or a UI prompt.
            var objectProvider            = new RightNowObjectProvider(_context);
            StaffAccountInfo staffAccount = new StaffAccountInfo();

            staffAccount.Name = AgentName;

            staffAccount.AgentID   = IntTryPrase(AgentID);
            staffAccount.Password  = password;
            staffAccount.Extension = IntTryPrase(location);
            staffAccount.Queue     = IntTryPrase(queue);
            objectProvider.UpdateStaffAccountInformation(staffAccount);


            return(new InteractionCredentials
            {
                AgentCredentials = new SwitchCredentials
                {
                    Id = staffAccount.AgentID.ToString(),
                    Name = staffAccount.Name,
                    Password = staffAccount.Password,
                    AgentID = staffAccount.AgentID,
                    Extension = staffAccount.Extension,
                    Queue = staffAccount.Queue
                },
                LocationInfo = new LocationInfo
                {
                    ComputerName = location,
                    DeviceAddress = location
                }
            });
        }
Exemplo n.º 2
0
        public InteractionCredentials GetCredentials()
        {
            // This is a simple implementation of the credentials provider.
            // Here, we're using the current user credentials but credentials could
            // come from any source, custom fields, objects or a UI prompt.
            var objectProvider            = new RightNowObjectProvider(_context);
            StaffAccountInfo staffAccount = objectProvider.GetStaffAccountInformation(_context.AccountId);

            return(new InteractionCredentials {
                AgentCredentials = new SwitchCredentials {
                    Id = _context.AccountId.ToString(),
                    Name = staffAccount.Name,
                    Password = staffAccount.Password,
                    AgentID = staffAccount.AgentID,
                    Extension = staffAccount.Extension,
                    Queue = staffAccount.Queue
                },
                LocationInfo = new LocationInfo {
                    ComputerName = staffAccount.Extension.ToString(),
                    DeviceAddress = staffAccount.Extension.ToString()
                }

                //LocationInfo = new LocationInfo {
                //    ComputerName = Environment.MachineName,
                //    DeviceAddress = string.Format("{0}{1}{2}", _context.InterfaceId, _context.ProfileId, _context.AccountId)
                //}
            });
        }
Exemplo n.º 3
0
 public void SetCredentials(string AgentID, string password, string location, string AgentName = "Guest")
 {
     var objectProvider            = new RightNowObjectProvider(_context);
     StaffAccountInfo staffAccount = new StaffAccountInfo();
 }