Beispiel #1
0
        private void AnswerCall()
        {
            SetStatusMessage("Answering Call...");
            if (playbackTerminal != null)
            {
                playbackTerminal.Dispose();
                playbackTerminal = null;
            }

            // Get the playback terminal from the call
            try
            {
                playbackTerminal = activeCall.RequestTerminal(TTerminal.FilePlaybackTerminal,
                                                              TAPIMEDIATYPES.AUDIO, TERMINAL_DIRECTION.TD_CAPTURE);
                if (playbackTerminal != null)
                {
                    playbackTerminal.MediaPlayList = new string[] { PLAY_FILENAME };
                    activeCall.SelectTerminalOnCall(playbackTerminal);
                    activeCall.Answer();
                }
                else
                {
                    MessageBox.Show("Failed to retrieve playback terminal.");
                    activeCall.Disconnect(DISCONNECT_CODE.DC_REJECTED);
                }
            }
            catch (TapiException ex)
            {
                MessageBox.Show(ex.Message);
                activeCall.Disconnect(DISCONNECT_CODE.DC_NORMAL);
            }
        }
Beispiel #2
0
        private void OnAnswerClicked(object sender, EventArgs e)
        {
            TCall call = (TCall)lbCalls.SelectedItem;

            try
            {
                call.SelectDefaultTerminals();
                call.Answer();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }