I'm attempting to build a live support chat application in C# using a WCF microservice and after endless searches I still can't find the answer, hopefully someone here can point me in the right direction.
My problem is that rather than a typical chat room a where users broadcast messages to all connected clients, I need the application to be more like a Live Support app found on websites such as Amazon or eBay.
Ideally multiple customer support agents will have a pre installed WinForms chat application on their machines, when a customer opens a chat window (aspx page) it will connect to a server/service and the server/service will then call all connected customer support agents until one answers. At this point the customer and agent will be connected in a private chat window.
Could somebody please give me some insight or ideas on how to do this?
Thanks,
Owen
You can use ASP.NET SignalR which is a library for ASP.NET developers that makes developing real-time web functionality easy. SignalR allows bi-directional communication between server and client. Servers can now push content to connected clients instantly as it becomes available.
Here you can find more details and many tutorials about SignalR.
The first resoult in google
A WCF-WPF Chat Application
Video tutorial
WCF Chat Application
ASP.NET Chatting using WCF Services and JSon
A simple peer to peer chat application using WCF netPeerTcpBinding
usefull lectures
HTML 5 Web Sockets
Always first ask google, above you have few ready to use projects that you can copy to your solution
EDIT:
Also as tip I can recommend bi-directional message queues at application level, then make index for messages with session and users identifier. Next step would be WCF with pop and push logic based on wait objects. At low cost you will need to lock queue. WCF will do heavy job. Also problems can occure inside app with proxy management and message sending so dedicated proxy for chat would be great and safest idea. And read about Duplex Services that can be usefull here DUPLEX SERVICE
These are my findings, not checked though:
Live Support Chat using SignalR
Parle
A tutorial from ASP.NET team:
Real-time chat with SignalR 2
The first one looks very early development stage, Parle is somewhat more promising.
Anyway, since I continue my research on the topic maybe I'd need to augment my answer. Until then the links could be a good starting point.
Related
Developing a messaging application for web and mobile with real-time notification. Project flow is ..
Backend - DataBaseOperations and Services
Web
APi (for mobile app)
I need to send messages from the server to a user that can be connected from more than one location (web and mobile app).
Web and API works separately and access Backend. Please share suggestions what flow should I use to implement singalR in my project
This is a broad question, but I'll give enough to get you started in the right direction. Since you're going to be in load-balanced environment, you'll need to implement a backplane. This sits behind your web servers and aggregates the messaging. Here are some links that will guide you set up SignalR:
https://www.asp.net/signalr/overview/guide-to-the-api
https://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-javascript-client
https://www.asp.net/signalr/overview/performance/scaleout-in-signalr
Also, you'll need these nuget packages (minimum):
Microsoft.AspNet.SignalR.Redis or SqlServer
Microsoft.AspNet.SignalR
Microsoft.Owin
There is nothing really special in what you want to achieve.
Your client app needs to be authenticated before sending SignalR messages. That way you can identify a user and protect your server resources.
That´s the first part I would start looking into (there are tons of info about this matter if you google it).
Then you need to send a message from the server to a user and that user can have 2 client apps connected (web and mobile or even more, like other browser tabs). That can be achieved using SignalR groups.
A SignalR group is just a group of connections (not users) with a given name.
One common scenario is creating a group for each user, and that group will hold the connections of the user. This is a logical pseudo structure of how SignalR groups work (not actual code):
Group name: "johnUser"
Group connections: [
00001, // mobile app connection
00002, // brower tab connection
00003, // broswer tab connection 2
0000n // etc
]
Those numbers are simulations of Connection ids. SignalR creates them for you.
Then you just need to send a message to the group, and all connected clients will get it.
If you are just starting with SignalR I would not complicate things implenting a backpane unless you really need it and you know what you are doing. A single server can handle hundreds of concurrent connections and you can scale-out later if you want.
Regarding architecture, it´s not very clear what you mean by Web and API works separately. It´s better if you ask more specific questions after you actually try to code something.
I'm starting up a little code project to learn from the process, but I am not sure what's the best way of communicating between the different parts.
First, I have a pure html/js client where the users need to get live updates frequently.
Secondly, I'm considering having a web api application running to provide data.
Thirdly I have a console application running, that needs to communicate with the web api application.
So I'm thinking about using WebSockets all the way from client->web api->console app, but I have trouble making it work. I can make the console app work as a server, but I can't figure out how to make the web api work as a client, so that when it spins up, creates a connection to the console app, and keeps it open for communication, while it delivers data to the clients upon requests.
I tried with different implementations and I have ended up with SignalR, as it seems like that's what people use today :)
Since I have all these problems getting a connection I am wondering if there are better ways of sending data that fulfills my requirements?
If WebSocket (using SignalR) is the way to go, can you provide some links with working examples? I have tried all the top links from Google with no success ^^
Thanks in advance
Your WebAPI project can act as WebSocket server as well. Check this link that uses an IHttpHandler, but you can also do it in a WebAIP's controller how is explained here : Using WebSockets with ASP.NET Web API
The console application should connect as client, using for example ClientWebSocket class.
WebSockets are persistent full duplex connections, so once the client is connected both ends can push information to the other end.
I want to create an Instant Messaging app for Windows Phone.
I have found some information about Live SDK, but it looks like the messenger api is outdated?
Can anyone help me start? All I want to do at first is embed the IM.
A simple IM app where the user logs in with their Live ID, sees who already has the app (Live Contacts) and an IM-service with a UI like the SMS-service in windows phone.
Can anyone help me get started?
Firstly i hope i got your question right.
I have multiple lookouts for you:
XMPP (Jabber): start from there. It is fairly simple, and there are opensource clients out there where you can dismantle code and learn by understanding what others have done.
Check out the SignalR
ASP.NET SignalR is a new library for ASP.NET developers that makes it incredibly simple to add real-time web functionality to your applications. It's the ability to have your server-side code push content to the connected clients as it happens, in real-time.
You may have heard of WebSockets, a new HTML5 API that enables bi-directional communication between the browser and server. SignalR will use WebSockets under the covers when it's available, and gracefully fallback to other techniques and technologies when it isn't, while your application code stays the same.
SignalR also provides a very simple, high-level API for doing server to client RPC (call JavaScript functions in your clients' browsers from server-side .NET code) in your ASP.NET application, as well as adding useful hooks for connection management, e.g. connect/disconnect events, grouping connections, authorization.
What I need to do is create the server side for a chat application that will run on the iPhone, Android, Blackberry and web browsers.
To do this I am thinking of:
creating an application and hosting
it on Microsoft's Azure cloud
using XMPP as the communication
protocol.
The iPhone app that I am building will then connect to my app on the cloud and they will have very colorful conversations in TCP/IP and XMPP.
Is there a better way to do this?
Do you have any tutorials to help me start?
Not a full answer or a recommendation, but I saw a bit of the Steve Marx's presentation today which covered node.js implementation https://github.com/smarx/smarxchat at http://chat.smarx.com/
Whilst not a finished architecture, it certainly will suggest an alternative possible design!
This is an old question. But if anyone is looking for a more ready solution today, I'd recommend give Azure Communication Services a try. It offers a managed solution for chat, SMS, telephone call, and audio/video call across all platforms.
If you're writing your own xmpp server, you'll need to use a worker roles and open the necessary ports.
If you're looking to implement an existing xmpp server solution, you'll probably be better off using a VM role, building the server image and uploading it.
We are building an application which is suppose to connect to the Support Engineer's Mobile phone and will alert him about any job to be done.
This application will be based on 2 parts. one is Control Centre part where the interface will be built using Silverlight 4.0 and ppl from Control Centre will be using it using normal pc over internet. The 2nd part is based on the Mobile Part where the support Engineer will be sent a communication via some magic that there is a job. And if the support Engineer will accept the job then the job will assigned to his tasks list...
Now the only issue is that how we communicate to the support Engineer on his mobile. We have couple of options...like SMS, Email over SMS etc...
SMS option is costly, so due to the cost management has refused the option, but actually SMS is fine as far as it is sent from the control Centre, but how we get the reply back from the support engineer. Coz we dont want the support engineer send us reply VIA sms coz this will cost him(thats why management refused this option). We have decided a solution that built a custom application for windows mobile which will intercept the coming SMS on the Support Engineer's mobile and will rasie a poupup detailing the job specs and on the same popup there will be couple of buttons like Accept, Reject. what ever the action will be taken it will update the control room via internet/WCF/HTTP. I have no idea how? and thats why I am here.
I am posting all this LOVE STORY so that any body senior can guide me abut the architect if it is ok or not...or any other options we can dig down further.
I appreciate your participation in this regard.
Thanks
Communication to the device is typically the hard part because the device rarely will have a routable network address. Sending an SMS is a reasonable way - so is sending an email (that's how the Microsoft email transport for WCF works). Another option is to have the device periodically "check in" to a server to see if it has any messages waiting.
Communication back is pretty simple. Build up a public web/WCF service that the devices communicate back to. Personally I'd probably lean toward a REST service to keep your mobile connection point a bit more open in the event you want to connect via something that maybe doesn't support WCF.
#Shax I've not done any mobile development but I think you need a WP7 app that will poll control center server over HTTP etc. if there is any job for the engineer. Another option will be to push any job notification from server to mobile. But I am not sure if this (push notification) is easier and/or cost effective.
Another option will be of setting up a website with details of jobs, then you can alert engineer with an SMS. Upon receiving SMS engineer can log into website and get details of the job.