public void ProcessCallAccept(PacketData data) { CallData myCall = new JavaScriptSerializer().Deserialize <CallData>(data.Data); this.myCall = myCall; voiceConnection = new VoiceConnection(this); voiceConnection.ConnectVoiceListener(myVoiceNodeAddress); voiceConnection.ConnectVoiceSender(myCall.VoiceNodeAddress); SetStatusText("Call Connected"); }
private void btCall_Click(object sender, EventArgs e) { if (btCall.Text == "Pick up") { myVoiceNodeAddress = main.network.GetAvailableAddress(); main.commands.CallAccept(myCall, myVoiceNodeAddress); voiceConnection = new VoiceConnection(this); voiceConnection.ConnectVoiceListener(myVoiceNodeAddress); voiceConnection.ConnectVoiceSender(myCall.VoiceNodeAddress); btCall.Text = "Hang up"; lbStatus.Text = "Call Connected"; } else if (btCall.Text == "Call") { main.commands.callForm = this; btCall.Text = "Hang up"; Thread thread = new Thread(new ThreadStart(ProcessCallInvite)); thread.IsBackground = true; thread.Start(); } else { //btCall.Text = "Call"; //lbStatus.Text = "Call Ended"; //tbAddress.ReadOnly = //if (voiceConnection != null) //{ // voiceConnection.DisconnectVoiceListener(); // voiceConnection.DisconnectVoiceSender(); //} this.Close(); } }