private void Sender_CallEvent(object src, CallEventArgs args)
{
if (args.Type == CallEventType.ConfigurationComplete)
{
//STEP6: we got access to media devices
Debug.Log("sender configuration done. Listening on address " + address);
sender.Call(address);
}
else if (args.Type == CallEventType.ConfigurationFailed)
{
//STEP6: user might have blocked access?
Debug.LogError("sender failed to access the audio device");
}
else if (args.Type == CallEventType.ConnectionFailed)
{
//This can happen if the signaling connection failed or
//if the direct connection failed e.g. due to firewall
//See FAQ for more info how to find problems that cause this
Debug.LogError("sender failed to connect");
}
else if (args.Type == CallEventType.CallAccepted)
{
//STEP7: Call Accepted
Debug.Log("sender CallAccepted");
}
else if (args.Type == CallEventType.CallEnded)
{
//STEP8: CallEnded. Either network died or
//one of the calls was destroyed/disposed
Debug.Log("sender received CallEnded event");
}
}