Establish a Lync/Skype for business IM Chat from a website (Intranet) - asp.net-mvc-4

We need to develop a website in Asp.net MVC 4 which will connect user within the organisation on Lync or (skype for business now):The ask is:
1) A Sales guy see 10 Technical person in the list which is in database and all of them are in AD if that helps
2) A sales guy click on an icon to connect to a technical person, a lync window appears on client machine (We can assume that all client will have Lync or skype for business up and running on their system from where they will access website)
3) A lync window appears on the machine of a person we are trying to connect to with Default text "hi! Bla Bla Bla"
Can somebody point me to the correct implementation with some set up details from infrastructure POV as well. We tried to do that but that does not work when we deploy to server:
AutomationModalities conversationModes = 0;
Dictionary<AutomationModalitySettings, object> conversationSettings =
new Dictionary<AutomationModalitySettings, object>();
conversationModes = AutomationModalities.InstantMessage;
conversationSettings.Add(AutomationModalitySettings.FirstInstantMessage, "Hi This is a call XXXXXXn");
conversationSettings.Add(AutomationModalitySettings.SendFirstInstantMessageImmediately, true);'

Since it appears you cannot touch the cross-domain authorization list (white-list), you should be able to achieve what you are looking for by writing some non-JavaScript code to communicate with UCWA. There are a few articles on MSDN that demonstrate how to communicate with UCWA using C#/.NET which might prove interesting:
Lync 2013: Create UCWA Windows Store apps using C#/XAML and XML
Set up the UCWA event channel to receive incoming notifications
Making an outgoing IM call and sending messages
Answer an incoming IM call and receive messages
It gives the basics of handling authentication, interacting with the events channel, handling incoming IM calls and messages. It is designed to handle XML, but that could be changed to work with JSON.

You could use the Skype Web SDK for this - Microsoft have a bunch of examples on their site for the SDK.
http://developer.skype.com/
or more specifically
https://msdn.microsoft.com/en-us/library/dn962160%28v=office.16%29.aspx
It's a JavaScript library, but very easy to integrate with a .NET MVC or Forms app.
I also have some tutorials on exactly this on my blog but not if it's appropriate to post that here. :)

Related

Docusign Webhook .net core 2.0

I am trying to implement Docusign in my application for digital signature. I am using .net core 2.0 for development purpose. I found that the Docusign SDK(https://www.nuget.org/packages/DocuSign.eSign.dll/) is not compatible with .net core so I tried with the other one (https://www.nuget.org/packages/DocuSign.Core). The general signature request is working fine but when it comes to Embedded Signing, there is no method available in the SDK(but is available in the original SDK). I am using REST API to complete Embedded signing process and is working fine for now.
Now I want to keep track the status of the document(like when it is delivered, when it is signed by signers and so on). I am configuring webhook to accomplish this task but not getting the webhook object in the webhook endpoint. I referred few documents ("https://github.com/docusign/recipe-010-webhook-csharp/blob/master/Webhook/Controllers/WebhookController.cs", "https://developers.docusign.com/esign-rest-api/code-examples/webhook-status",
"https://www.docusign.com/blog/dsdev-msbuild2018-session-thr2605/") to see how a webhook works but looks like none of them is working. In the examples, everyone is getting the webhook object inside request content(request.Content.ReadAsStreamAsync()) but I am getting null at Content.
Can someone help me out to resolve this issue. A sample code or helpful documents(apart from the one I am referring) would be great.
Thank you.
Re: .Net Core SDK support -- we hear you and we're working on it.
Re: webhook setup --
How are you creating the webhook subscription? Via the Administration tool or via the eventNotification object in the Envelopes::create call?
To get going, I'd suggest using the Administration tool. Use the Connect screen to add a webhook notification subscription to your server (your "listener"). Then you'll receive notifications for the events you've indicated an interest in.
Your server must support https and be available on the public internet so DocuSign can send POST requests to it.

Test Automation: Automate outgoing calls from fixed phones registered with a Skype for Business IP-PBX

For test automation purposes, we're currently investigating upon how we can have a fixed phone registered with a Skype for Business IP-PBX (e.g. an AudioCodes phone or a Yealink phone or...), make an outgoing call upon request.
E.g. Our test automation platform would send a request to the Skype for Business Server to tell this server to initiate an outgoing call from phone A registered with that Skype for Business Server to an external phone B. So a little bit similar as JTAPI functionality...
I.e. Would this be feasible by using UCMA 5.0?
There is no way to SIP to make a physical phone make a call.
With UCMA you are effectively a softphone, so with UCMA you can make your "softphone" make a call.
With the Lync Client API you are remote controlling the Lync Client (Skype for Business client), so with the Lync Client API you can remote control the Lync Client to make a call.
The only way I can think of to make a physical phone dial would be to use a Polycom VVX phone linked to a instance of a Lync Client using there "Better Together" application. Then you can use the Lync Client API to remote control the Lync Client which would in turn remote control the Polycom VVX phone.
I haven't done this in a Skype/Lync environment but I've done something similar in Asterisk a long time ago. I don't remember all the details of the test any more.
One key to get hardware involved, if you don't use a BToE connection, is to leverage the "Auto Answer" answer feature on most handsets.
I have seen some phones also allow for some push/curl commands to be sent to the device. An example of this with a polycom is here. The post is old and it's been years since I messed with that, but I assume some of that function may still be in some devices/firmware. I haven't seen anything similar with AudioCodes or Yealink, but they maybe there as well.

Should I use UCWA or UCMA or another API for a Skype for Business Server Application?

There seems to be a lot of different SDKs / APIs around Skype for Business. I'm having a tough time deciphering which one would be appropriate for a server side Bot like application that could communicate domain specific information to the users within the organization. For example we'd like to be able to deliver task(s) via messages and perform presence based task assignment. This seems to be fairly low hanging fruit but where's the REST endpoints and documentation to make this happen. Assuming for example I wanted to create a little console application that could facilitate this what API would you recommend?
Here are the main differences between UCMA and UCWA:
UCMA is a .NET SDK that provides rich control over a Skype for Business server deployment. It enables applications to automatically route calls and messages, provide automatic responses (IVR or chat bots), record conversations etc. It can be used in a number of scenarios such as a 'contact center' application that distributes incoming calls to an available agent with the right skillset. UCMA applications are managed by running them on application servers that are activated as part of the Skype for Business server deployment. As such, UCMA is not available for Skype for Business Online (Office 365).
UCWA is a RESTful Web API that acts on behalf of a single Skype for Business user. It enables applications to send and receive messages for that user, read presence for their contacts, etc. Typically it is used for interactive "line of business" applications that want to embed Skype for Business messaging/presence. It is also possible to create a 'technical account', that doesn't correspond to a real person, and use UCWA in 'headless' server applications but this approach currently has authentication and scalability limitations. UCWA applications have no deployment constraints since UCWA is a regular RESTful Web API. It is available for both Skype for Business Server (get started) and for Skype for Business Online (get started). The latter has slightly fewer capabilities right now: - for example, messages can be sent but not received - though this should change soon.
I think both UCMA and UCWA can be used. However, considering you want a server application, UCWA seems fit the case. Here is the detail of SDK, you can find code samples at there:
https://msdn.microsoft.com/en-us/library/office/mt650889(v=office.16).aspx

How to monitor all lync users instant message via C# console application?

I have created UCMA trusted application using C# console application.
I want to monitor all Lync Users instant messaging calls (in one place) as well as store their conversations in the database via this console application.
Is it possible?.
If possible, please give an idea or any url.
UCMA trusted applications will only respond to traffic to the endpoints associated with that application so if you want to monitor all instant message traffic it would be the wrong API.
I would suggest using SIP Application API http://msdn.microsoft.com/en-us/library/office/hh364644(v=office.14).aspx to create a server application. This will also require the use of MSPL documented here
As Dai has asked - is the console application a requirement or will a windows service be ok?
Try our this sample application SipSnoop it basically shows all the metadata passing throught the lync server, you can tweak around it according to your requirement.

How to send a Skype chat message to a group using a remote server?

I looked at the Skype API docs (http://dev.skype.com/desktop-api-reference) and it seems to provide API functionality for interacting with a Skype program running on the same machine.
How can you send a chat message from a server that is not running Skype?
If you still need a solution for this problem, you can try now creating a Bot using Skype Bot Framework from Microsoft (https://docs.botframework.com/en-us/skype/getting-started).
It's kinda easy to implement, and the bot acts like a contact, wich must be added by someone to start interacting with your app behind it.