The local participant address is automatically inferred from the endpoint that is specified. If the application is trusted by the Office Communication Server computer, the application can impersonate another user. This is normally required to offer services on behalf of a specific user who initiated the call to the application. For example, a help-desk application might want to impersonate the user who calls in for help when it directs the call to an agent who can help the user.
Before adding calls to the conversation, the application must first indicate who is being impersonated. The impersonation API can be called for both an outgoing conversation created locally when the conversation state is Idle, and for an incoming conversation. The impersonation API call is allowed only for an application endpoint that is associated with a server platform.
The following code demonstrates impersonating the user specified by the first parameter. The second parameter specifies the phone number of the impersonated user, and the string “Help Desk” is the name that will be displayed for the impersonated user.
conversation.Impersonate("sip:firstname.lastname@example.org", "tel:+2341234678", "Help Desk");