m_collard
m_collard

Reputation: 2028

UCMA recording app

I've installed a MSPL script to redirect INVITE audio messages to the UCMA sip address

I'm currently writing a UCMA app for Skype for Business to:

  1. receive incoming calls
  2. accept the call
  3. create a conference call
  4. add a trusted participant to the conference
  5. create a recording instance on the trusted participant audio flow to record the conversation

The last thing I need to do is add the To caller URI to the conference call. I've tried to invite the new participant into the conference using the code examples from this article, but I get an exception saying there are no AvailableMediaTypes in the conversation.

    public static async void InviteToConference(string destinationUri)
    {
        //Create a new conversation for the application endpoint.
        _toConversation = new Conversation(_server.ApplicationEndPoint);

        var conferenceInviteSettings = new ConferenceInvitationSettings();
        conferenceInviteSettings.ConferenceUri = _conferenceUri;
        ConferenceInvitation invitation = new ConferenceInvitation(_toConversation, conferenceInviteSettings);

        try
        {
            await invitation.DeliverAsync(destinationUri);
        }
        catch (InvalidOperationException)
        {
            // Conversation was terminated while trying to add participant.
        }
    }

Can someone please show me what I need to do to add / invite a participant into a conference call?

It would be even better if someone could show me how to record a Skype for Business call without the need to create a conference, as a conference can't be forwarded.

Upvotes: 0

Views: 553

Answers (1)

Shane Powell
Shane Powell

Reputation: 14168

Your code looks like the old way (UCMA 3) of doing it. Have you tried this.

e.g.

McuDialOutOptions mcuDialOutOptions = new McuDialOutOptions();
mcuDialOutOptions.ParticipantUri = "sip:[email protected]";
mcuDialOutOptions.ParticipantDisplayName = "Alice";
mcuDialOutOptions.PreferredLanguage = CultureInfo.GetCultureInfo("en-us");
conversation.ConferenceSession.AudioVideoMcuSession.BeginDialOut("tel:+14255551234", mcuDialOutOptions, dialOutCallback, state);

Using this sort of method to record very specific and low traffic should be fine but when you start to scale it up then you are going to hit all sorts of problems.

As for how to do it without a conference:

There is no way to do it fully with the supplied Microsoft API's.

What you have to do is implement, buy or use open source libraries for the following pieces:

  • sniff network packets
  • decode RTP/SRTP streams
  • decode the audio and/or video codecs used between the callers
  • encode streams into your desired format and save somewhere

To get access to the SRTP streams encryption setup and to figure out what the dynamic payload types for the audio/video codecs used, you also need to know the SDP offered and answered between the calling parties. You also need access to the SIP traffic to determine the calling parties to know who called who. This can be a lot more trouble than what it seems...

To get the SIP/SDP information there are two options that I know of:

  • Skype/Lync Server SDK (MSPL / Server Application) to see most of the SIP traffic. This is what I've used to implement a recording solution.
  • Skype/Lync SDN SDK - I haven't used this API but it seems to give access to the SDP so it should work.

If you get all these peices into place then the next problem is you can only "record" (basically "sniff") what you can see. If you can't see the RTP/SRTP traffic you can't record the calls.

So you need to have the sniffer part of the recording software on areas of the network that see the traffic you want to record. For example if you wish to record all PSTN calls, you can have a network spanning port off the Skype mediation servers.

If you wish to record ALL calls, then that gets a lot harder. You most likely need to either:

  • Force all media trafic to go through a known place (like the Edge server) and put sniffers on the that network.
  • Have lots of sniffers in strategic areas of the network to capture most RTP/SRTP traffic.

The problems with the above solutions are:

  • Forcing all the traffic through one point can cause performance issues (like you will see with your conference setup) once load starts to increase. Also forcing external (edge server users) and/or federated calls through this one point can cause a problems. Think edger server user calls to edge server users where the media traffic may not even go into your network at all but live only on the internet. Forcing the trafficing into your network can cause performance issues.
  • When not forcing all the traffic through one point, you may never be see all skype user to skype user calls depending on your network setup. Calls between Edge server skype users are even more of a problem as the media traffic may not even enter your network at all.

On top of all that there are the general problems of storage management (recording after a while will start taking up a large amount of disk space) and call recording management (e.g. searching for a specific call) and user security around these recordings to deal with. I'm sure I'm missing a lot but those are the basics.

If recording in not going to be a core component, you could just buy a 3rd party call recording solution that supports Lync/Skype.

Upvotes: 1

Related Questions