예제 #1
0
        private void pbCall_Click(object sender, EventArgs e)
        {
            if (txtIP.Text == string.Empty)
            {
                MessageBox.Show("Please enter an ip to call.", "Missing ip", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            string myIp         = ics.GetLocalIp()[0].ToString();
            string ipToCall     = txtIP.Text;
            int    videoPort    = 9990;
            int    audioTcpPort = 17860;
            int    audioUdpPort = 17861;

            //place a call to an iConf Server
            //note when using the Call function we have the ability to supply callback parameters
            //which will help the peer connection call us back

            if (displayName == "")
            {
                displayName = "User" + RandomNumber(1, 1000);
                InputBoxSample.InputBoxResult res = InputBoxSample.InputBox.Show("You do not have a display name. Please enter your Display Name",
                                                                                 "Display Name", displayName, null);
                if ((res != null) && (res.Text != ""))
                {
                    displayName = res.Text;
                }
            }

            pnlOtherVideo.Visible = true;
            icc.Parent            = pnlMain;
            ics.Parent            = pnlOtherVideo;


            icc.Call(ipToCall, videoPort, 0, 0, displayName, ics.CallBackId, myIp, videoPort, audioTcpPort, audioUdpPort, "");

            pbHangup.Visible = true;
            pbCall.Visible   = false;

            HideOptionsPanel();
        }
예제 #2
0
        private void btnCall_Click(object sender, RoutedEventArgs e)
        {
            string myIp         = icServer.GetLocalIp()[0].ToString();
            string ipToCall     = txtIP.Text;
            int    videoPort    = 9990;
            int    audioTcpPort = 17860;
            int    audioUdpPort = 17861;

            if (btnCall.Content.ToString() == "Hang up")
            {
                icClient.Disconnect();
                icClient.ClearImage();
                btnCall.Content = "Call";
                return;
            }
            //place a call to an iConf Server
            //note when using the Call function we have the ability to supply callback parameters
            //which will help the peer connection call us back

            btnCall.Content = "Hang up";
            icClient.Call(ipToCall, videoPort, 0, 0, "test", icServer.CallBackId, myIp, videoPort, audioTcpPort, audioUdpPort, "");
        }