Commit d4745a0f authored by Ghislain MARY's avatar Ghislain MARY

Prevent "The RPC server is unavailable." exceptions when going into background.

parent 5c3329de
......@@ -220,11 +220,20 @@ namespace Linphone.Model
}
// Cancel any incoming call
if (LinphoneCore.GetCallsNb() == 1)
try
{
if (LinphoneCore.GetCallsNb() == 1)
{
LinphoneCall call = (LinphoneCall)LinphoneCore.GetCalls()[0];
if (call.GetState() == LinphoneCallState.IncomingReceived)
LinphoneCore.TerminateCall(call);
}
}
catch (Exception)
{
LinphoneCall call = (LinphoneCall)LinphoneCore.GetCalls()[0];
if (call.GetState() == LinphoneCallState.IncomingReceived)
LinphoneCore.TerminateCall(call);
// Catch "The RPC server is unavailable." exceptions that occur sometimes at this point.
// This is to clarify why the access to the RPC server is not reliable when called application
// deactivation handler...
}
BackgroundProcessConnected = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment