SightMax Live Chat - The Premier Installable and Hosted Live Chat Solution...

Get Operator Availability

rated by 0 users
Not Answered This post has 0 verified answers | 7 Replies | 3 Followers

Top 100 Contributor
1 Posts
Clint posted on 04-22-2009 1:27 PM | 70.254.224.126

Ok I need an example to help get me started here

Dim client As RemotedWebsiteAdministratorClient = New RemotedWebsiteAdministratorClient()

client.Open()

 

 

client.Close()

I want to beable to request if any agent is available

 

 

 

 

 

All Replies

Top 10 Contributor
12 Posts
Mike G replied on 04-22-2009 3:10 PM | 64.207.249.76

Hi Clint.  Below is an example of how to login and find the available operators in C#.  I hope this helps.  The status of all objects on the server is obtained through either a syncdataspool of an Operator or System Administrator.  The spool is initialized through the Login method demonstrated below and all updates to the server will come through on a call to Sync for the operator.

using System;

using System.Collections.Generic;

using System.Linq;

using System.ServiceModel;

using System.Text;

 

namespace WindowsDemo

{

    class Program

    {

        static ChannelFactory<SmartMax.SightMax.Agent.Operator.IRemotedOperator> _factoryOp = null;

        static void Main(string[] args)

        {

            _factoryOp = new ChannelFactory<SmartMax.SightMax.Agent.Operator.IRemotedOperator>();

              Version m_GuiVersion = new Version("6.0.0.0");

       SmartMax.SightMax.Chat.CannedResponseSharedDataCollection m_AccountCannedResponses;

       SmartMax.SightMax.Chat.AccountCannedResponseAssociationCollection m_AccountCannedResponseAssociations;

        SmartMax.SightMax.Chat.CannedResponseSharedDataCollection m_OperatorCannedResponses;

        SmartMax.SightMax.Chat.CannedResponseSharedDataCollection m_OperatorCannedResponseShortcuts;

        int m_nOperatorTimeoutSeconds;

        bool m_bPreviouslyLoggedIn;

        bool m_whiteboxversion;

 

            SmartMax.SightMax.Agent.Operator.OperatorAgentSharedData data = null;

 

            SmartMax.SightMax.Agent.Operator.SyncDataSpool initialSpool = null;

            SmartMax.SightMax.Agent.Operator.SecurityIdentifier sid = new SmartMax.SightMax.Agent.Operator.SecurityIdentifier(-1, -1, Guid.Empty);

            Version serverVersion = null;            

            using (SmartMax.SightMax.Agent.Operator.ClientOperator client = new SmartMax.SightMax.Agent.Operator.ClientOperator(_factoryOp))

            {

                data = client.IOperator.Login(

                    m_GuiVersion,

                    "OpertorName",

                    SmartMax.SightMax.Utility.Encryption.Encrypt("OpertorPassword"),

                    "MyAccount",

                    out initialSpool,

                    out sid,

                    out serverVersion,

                    out m_AccountCannedResponses,

                    out m_AccountCannedResponseAssociations,

                    out m_OperatorCannedResponses,

                    out m_OperatorCannedResponseShortcuts,

                    out m_nOperatorTimeoutSeconds,

                    out m_bPreviouslyLoggedIn, out m_whiteboxversion);

                client.IOperator.Logout(sid);         

            }

 

            //output operators and their availability

            foreach(var op  in initialSpool.OperatorAgents)

                Console.WriteLine("Operator: {0}, Availability: {1}", op.Name, op.Availability);

 

            //out operators that are account administrators

            var acctAdmins = initialSpool.OperatorAgents

                .Where(o => o.Permissions.IsAccountAdmin);

 

            foreach (var admin in acctAdmins)

            {

                Console.WriteLine("Account Admin: {0}", admin.Name);

            }

        }

    }

}

 

Top 25 Contributor
5 Posts
danp129 replied on 04-22-2009 3:24 PM | 70.254.224.126

What namespace is Encryption.Encrypt under?

Top 10 Contributor
12 Posts
Mike G replied on 04-22-2009 3:31 PM | 64.207.249.76

Ive edited my post to include full namespaces

Top 25 Contributor
5 Posts
danp129 replied on 04-22-2009 3:47 PM | 70.254.224.126

Using a VB.NET Website and generating the code using svcutil.exe only exposes SmartMax.SightMax.Utility.PointInTime

Using a VB app and adding a service reference to the project, I don't have the utility namespace.

Top 10 Contributor
12 Posts
Mike G replied on 04-22-2009 3:58 PM | 64.207.249.76

Sorry, I had assumed the dll had been referenced within the project (SmartMax.SightMax.Common).  If you are going strictly from the wsdl, the encryption method is below

/// <summary>

/// </summary>

public static Byte[] Encrypt(String s)

{

MD5 md5 = new MD5CryptoServiceProvider();

ASCIIEncoding myAscii = new ASCIIEncoding();

Byte[] ba = md5.ComputeHash(myAscii.GetBytes(s));

return ba;

}

Top 25 Contributor
5 Posts
danp129 replied on 04-22-2009 4:18 PM | 70.254.224.126

Thanks, I'm getting something new now when attempting the login:

The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

Do you know how to fix this?

Top 25 Contributor
5 Posts
danp129 replied on 04-22-2009 4:21 PM | 70.254.224.126

nevermind, found it in the .config file

Page 1 of 1 (8 items) | RSS
Copyright 2006-2009, SmartMax Software, Inc. All Rights Reserved.