public override void DisConnect()
 {
     RTPPort = 0; // make sure we won't process any more packets on this port.
     sipState.Close();
     sipState = null;
     audioStreamState.Close();
     audioStreamState = null;
     phoneNumber      = String.Empty;
     base.DisConnect();
 }
        public override void Connect(string phoneNumber)
        {
            string s;

            s                = Thread.CurrentThread.Name;
            RTPPort          = 0;
            someToneDetected = false;
            this.phoneNumber = phoneNumber;
            try
            {
                sipState         = new SipState();
                audioStreamState = new AudioStreamState(this.LogCall, phoneNumber);
                base.Connect(phoneNumber);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "Connect()", "RTCAudioWithToneDetect.cs");
            }
        }
Example #3
0
        public void Update()
        {
            if (!m_isPlaying)
            {
                return;
            }

            if (m_previousStreamState == AudioStreamState.Playing &&
                m_streams[m_current].GetState() == AudioStreamState.Stopped)
            {
                m_current++;
                if (m_current >= m_streams.Count)
                {
                    m_current = 0;
                }

                m_streams[m_current].Play();
            }

            m_previousStreamState = m_streams[m_current].GetState();
        }