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

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.

Related

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

Establish a Lync/Skype for business IM Chat from a website (Intranet)

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. :)

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.

Lync, skype & msn in a WCF service

I have a WCF service allowing users to connect to different protocols accounts (like Yahoo)
I'm now interested in adding a "microsoft" feature to this WCF, so users can connect to their msn/skype/lync account.
I've searched online and found good infos on how lync and LCS don't work together, but nothing really clear about the microsoft plans of regrouping APIs. (now that the own Skype)
2 questions:
I] Is there something I've missed (like a nice unified microsoft API) or should i really use different & separate APIs?
(skype API mentions: The Skype Public API is no longer being improved, although it is still being maintained)
II] Lync API needs Lync client to be install on the computer: it re-uses the lync server connection. I'm afraid i'll have problems if I try to implement it on a WCF. (multiple connection, authorization, disconnection of the "real" client if he uses lync in his Outlook)
Thank you
Dont know about all questions, but Lync definately allows multiple connections for a single user. I'm using a trusted server application (in a hosted service) in which I create user endpoints for people connecting through the service. This has no impact on any other connections a user might have.