I'm facing with this error: "Invalid call states to establish BackToBackCall" it occurs on: "B2BCall = new BackToBackCall(inLegSettings, outLegSettings);"
Basically i have an application running on a TrustedApplicationPool server. The application accepts incoming call Browse a VoiceXml and if the user properly navigate the IVR the browser closed with exitcode = "1" which means that the caller must be connected to the user: "sip:opt01@intranet.local".
Here is my code:
public class BackToBackCallManager { public BackToBackCall B2BCall { get; private set; } public BackToBackCallManager(AudioVideoCall inboundCall, LocalEndpoint applicationEndPoint) { BackToBackCallSettings inLegSettings = GetInboundLegSettings(inboundCall); BackToBackCallSettings outLegSettings = GetOutBoundLegSettings(applicationEndPoint); B2BCall = new BackToBackCall(inLegSettings, outLegSettings); B2BCall.StateChanged += BackToBackCallManager_StateChanged; } private void BackToBackCallManager_StateChanged(object sender, BackToBackCallStateChangedEventArgs e) { CallManager.AppendLog(CallManager.LogPrefixName.BackToBackCall, "Previuos state: " + e.PreviousState +" New State: " + e.State); } public void Run() { B2BCall.BeginEstablish(null, null); } private BackToBackCallSettings GetInboundLegSettings(AudioVideoCall inboundCall) { BackToBackCallSettings retVal = new BackToBackCallSettings(inboundCall); return retVal; } private BackToBackCallSettings GetOutBoundLegSettings(LocalEndpoint localEndPoint) { BackToBackCallSettings retVal = null; ConversationSettings outConvSettings = new ConversationSettings(); outConvSettings.Priority = ConversationPriority.Urgent; outConvSettings.Subject = "UCMA to group"; Conversation conversation = new Conversation(localEndPoint, outConvSettings); AudioVideoCall newLeg = new AudioVideoCall(conversation); retVal = new BackToBackCallSettings(newLeg, "sip:opt01@intranet.local"); return retVal; } }
Please note: inboundCall it's the AudioVideoCall started from caller to the App and it's State is: Established when BackToBackCallManager constructor was invoked. applicationEndPoint it's the localEndPoint established during application initialization.
I got totally stuck. Any ideas?