1

I am trying to establish a call using the following code in a UCMA workflow application:

try{
var conversation = new Conversation(endpoint);
avCall = new AudioVideoCall(conversation);
avCall.EndEstablish(avCall.BeginEstablish(CalleeParty,options,null,null));
catch (FailureResponseException frex){
_logger.WriteToLog(frex.Message, "TransferCall", this.CallerUri, this.CalleeParty);
}
catch (OperationFailureException ofex)
{
_logger.WriteToLog(ofex.Message, "TransferCall", this.CallerUri, this.CalleeParty);
}
catch (RealTimeException rtex){
}
_logger.WriteToLog(rtex.Message, "TransferCall", this.CallerUri, this.CalleeParty);
}

if the destination party rejects the call the application receives the busy response only after timeout(30 seconds) is passed. and because the call is established inside a ucma application i get no voices at all that indicate ringing and busy states.

is that normal, and if not how can i fix that?

ziwar
  • 63
  • 1
  • 9

1 Answers1

2

You can subscribe to the Call.StateChanged event before you call BeginEstablish.

If you do this then you'll be notified as the call passes through it's various states. In your example, you'll see the call move directly from Establishing to Terminated. (an accepted call would go Establishing to Established, then eventually Terminated once either party hung up).

MSDN has a useful visual diagram here: http://msdn.microsoft.com/en-us/library/hh347379.aspx. In fact, I'll link it here for everyone to see:

Lync Call States

Also, Michael Greenlee has a blog post talking about exactly this, and describes how you can also get additional information, such as TransitionReason.

Hope that helps.

Tom Morgan
  • 2,355
  • 18
  • 29
  • Thank you Tom, i actually tried that and tried also ProvisionalResponseReceived event which can show you what responses you are getting during the call such as: ringing, trying, etc. the problem is that when the remote user rejects the call there is a 30 seconds gap before I get the busy message. i.e my application does not receive any response for 30 seconds. for example: i get the following responses during the call establishment: 101 - 183 - 180 - 183 etc then if the user rejects the call i get 404 but after 30 seconds as if the call disappears for 30 seconds with no responses at all. – ziwar Apr 18 '12 at 08:29