Agent Chat Released
Agent Chat
The ability to switch from a predefined structured flow to a live chat agent is now part of ANA Platform. This can be used if users are stuck at some point in the chat flow due to lack of clarity or they want some manual assistance.
-
Pre-requisites:
Rocket Chat server: Rocket Chat is a full flege open source chat application. This is used as the agent chat platform here. A running Rocket Chat Server with admin access is needed to configure Agent Chat. Follow their docs and setup your rocket chat server. Note down the server URL, admin username and password.
-
Agent Chat Setup:
This process assumes you have already setup ANA without agent chat by following above instructions.
Setting up agent chat involves the following steps.
- Setup LiveClientSockets Server:
- Deploy the NodeJS project 'LiveClientSocketsManager' (included in the repo) on a server. The server can be same or different than the one ANA Platform is deployed on.
- Note: If you are not using IISNode to host it or you are not hosting it in IIS server, make sure the variables 'auth_username' and 'auth_password' are accessible via process.env to the node js code. IISNode does that automatically as these variables are defined in web.config
- Once the code is deployed. Make note of two things..
- Server URL: http://<your-domain.com>/
- Basic Auth Base64:
- Which is the base 64 of <auth_username>:<auth_password> of the values you set as in the web.config.
- Default is agentchat:agentchat and its Basic Auth Base64 will be 'YWdlbnRjaGF0OmFnZW50Y2hhdA=='
- Configure Rocket Chat:
- Login to rocket chat with admin user.
- Goto /admin/integrations
- Create a new outgoing integration
- This is basically setting up a web hook to notify ANA about a new message sent from Rocket Chat.
- Set the fields of the integration as following
- Event Trigger: Message Sent
- Enabled: true
- Channel: all_direct_messages
- URLs: http://<your-ANA-domain.com>/api/AgentChat/CallbackReceivedFromRocketChatServerAsync
- Impersonate: False
- Post as: [Use any existing user]. This callback will not post anything using the call back response to this 'Post as' does not matter.
- Create a new outgoing integration
- Goto /admin/Layout
- Inside 'User Interface' section, set everything to true, mainly, 'Use Real Name' option. This will display the actual name of the user in the rocket chat threads. It is picked up from 'PERSON_NAME' variable from Memory Stack of the simulator. Make sure 'PERSON_NAME' is captured in your chat flow before switching to agent chat.
- Create few users in rocket chat other than admin. They will be the users which agents have to login with. ANA automatically assigns agents to new chat requests, depending on availability.
- Make another user account which will act as the default user to which ANA will assign new incoming agent chat requests if none of the agents are available.
- Configure ANA Platform:
- Open appsettings-sample.json
- Fill in all the new fields present in the json by the ones which you have noted above and move those settings to your existing appsettings.json file.
- Setup the simulator:
- Install the latest simulator app and open it.
- Choose the 'Update APIs' option from the top right options button (…).
- Enter the above noted sockets server URL in the specified field.
- Update the 'Chat Flow URL' to end with 'HybridChat' instead of 'Chat', which was previously the case.
- Click Ok to save.
- Trying out Agent Chat:
- Login to a user in rocket chat. Make sure the status is online if the user is not the default agent chat user!
- Open the simulator app. Assuming you have your own chat flow setup and working, the simulator will start the structured chat as usual. After completing 1-2 steps of your chat flow, to switch to an agent, click the 'Agent Chat' option in the top right options menu.
- If everything is working fine, the current chat flow history should come into the rocket chat thread, text input box should appear in the simulator. From now on, Simulator and Rocket Chat user can chat two ways. Whatever typed in the simulator will be sent to the rocket chat user and vice versa.
- Sending the chat flow user (simulator user) back to a structured flow from agent chat is a planned feature coming soon.
- Setup LiveClientSockets Server:
Note
LiveClientSocketsManager is a node js app. It can be directly obtained from the source code and hence is not included in the release.