I'm developing C# VOIP LAN application. The application makes a call and shows the client is calling.
The problem is:
After accepting the Call the following error message dialog box is shown.
The code which process the Accepted call is:
//Act according to the received message.
switch (msgReceived.cmdCommand)
{
//We have an incoming call.
case Command.Invite:
{
if (bIsCallActive == false)
{
//We have no active call.
//Ask the user to accept the call or not.
if (MessageBox.Show("Call coming from " + msgReceived.strName + ".\r\n\r\nAccept it?",
"VoiceChat", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
SendMessage(Command.OK, receivedFromEP);
vocoder = msgReceived.vocoder;
otherPartyEP = receivedFromEP;
otherPartyIP = (IPEndPoint)receivedFromEP;
InitializeCall();
}
else
{
//The call is declined. Send a busy response.
SendMessage(Command.Busy, receivedFromEP);
}
}
else
{
//We already have an existing call. Send a busy response.
SendMessage(Command.Busy, receivedFromEP);
}
break;
}
//OK is received in response to an Invite.
case Command.OK:
{
//Start a call.
InitializeCall();
break;
}