Welcome to GotSpeech.NET Sign in | Help

Marshall Harrison - "the gotspeech guy"

Site news, Speech Server insight and assorted ramblings
Impersonating a user in a UCMA call

Recently I was working on an application endpoint that records a Lync audio call. I got that working fine but when a Lync user called another user and the call then got redirected to my application the name in the Communicator window would change to the name that my app was registered as. Not a good thing as I wanted my callers to think they were leaving a voice mail for the user.

This is a common thing to do in a Back to Back call scenario where you impersonate a different user for the second leg (which you originate in your app). But my call was actually terminating with my app so there was no second leg that I was connecting to. I wasn't sure if this was possible so I went digging around in the debugger and IntelliSense (both are my best friends). This is what I came up with and it works great..


        private static void AudioVideoCallReceived(object sender, CallReceivedEventArgs<AudioVideoCall> e)


            Trace.WriteLineIf(tracer.TraceVerbose, "AudioVideoCallReceived");

            Debug.Assert(e != null, "e != null");

            Debug.Assert(e.RequestData != null, "e.RequestData != null");


            if (e.RequestData != null)


                e.Call.Conversation.Impersonate(e.TransferredBy, e.Call.Conversation.LocalParticipant.PhoneUri, e.Call.Conversation.LocalParticipant.DisplayName);




            StartWorkflow(e.Call, e.RequestData, e.TransferredBy.ToString(), e.RemoteParticipant.ToString());



Now the caller only sees the original caller's name and status when talking to my application. Note that the values don't have to resolve to real addresses but they do need to be properly formatted.




Posted: Monday, February 07, 2011 10:31 AM by marshallharrison


Ahmed said:

Glad you found it.

We'll have to work harder to entice people to read the documentation :) - http://msdn.microsoft.com/en-us/library/gg437556.aspx

# February 9, 2011 1:29 PM

marshallharrison said:

Hi Ahmed.

Thanks for the link. I seem to loose that and have to go hunting for it. :-)

Are you going to be around during the MVP Summit? It's been a while since we last talked.

# February 9, 2011 1:43 PM
Anonymous comments are disabled