UCMA 2.0: Resume a Terminated InstantMessagingCall
Say I have a user on OCS who represents my application endpoint, and I try to message them from a web application locally (I built on top of the BasicIMCall sample application), and at some point they close the chat window, how do I resume the InstantMe开发者_运维百科ssagingCall? I have looked all over the web for the answer but I can't figure it out. Once the user closes the window, the call state becomes Terminated. How do I recover the call along with its call history and continue or restart the terminated conversation?
If they closed the chat with you will will receive a event state that tells you the state is terminated. Its up to you want to do at that point.
If you want to talk to him again you would need to BeginEstablish
the InstantMessagingCall
again. Then he would need to accept on his side for you to chat again.
Register Call State Change event for Incoming IM Call:
call.StateChanged +=new EventHandler<CallStateChangedEventArgs>(call_StateChanged);
Further you can get state of call and when it terminates , you can initiate new call:
protected void call_StateChanged(object sender, CallStateChangedEventArgs e)
{
if (e.State == CallState.Terminated)
{
//Initiate new call again
}
}
To recover call history, i think you have to store transcript of previous conversation.
精彩评论