Exemplo n.º 1
0
        private void StopListenDTFM(object o)
        {
            Debug.Assert(_listen);
            DTMFFacilityRequestParameter dtfmParam = new DTMFFacilityRequestParameter();
            FacilityRequest request = new FacilityRequest(dtfmParam);

            request.FacilitySelector   = FacilitySelector.DTMF;
            dtfmParam.FacilityFunction = FacilityFunction.StopListen;
            request.Identifier.Value   = _plci;
            RequestDTFM(request);
            _listen = false;
        }
Exemplo n.º 2
0
        private void RequestDTFM(FacilityRequest request)
        {
            MessageAsyncResult result = new MessageAsyncResult(this, request, null, null);

            ThreadPool.QueueUserWorkItem(RequestWaitCallback, result);
            object o = result.InternalWaitForCompletion();

            if (o is Exception)
            {
                throw ((Exception)o);
            }
        }
Exemplo n.º 3
0
        private void StartListenDTFM(object o)
        {
            Debug.Assert(!_listen);
            DTMFFacilityRequestParameter dtfmParam = new DTMFFacilityRequestParameter();
            FacilityRequest request = new FacilityRequest(dtfmParam);

            request.FacilitySelector   = FacilitySelector.DTMF;
            dtfmParam.FacilityFunction = FacilityFunction.StartListen;
            dtfmParam.ToneDuration     = _dtfmPause;
            dtfmParam.GapDuration      = _dtfmPause;
            request.Identifier.Value   = _plci;
            RequestDTFM(request);
            _listen = true;
        }
Exemplo n.º 4
0
        public void SendDTFMTone(string digits)
        {
            if (_status != ConnectionStatus.Connected)
            {
                throw Error.NotSupported();
            }

            DTMFFacilityRequestParameter dtfmParam = new DTMFFacilityRequestParameter();
            FacilityRequest request = new FacilityRequest(dtfmParam);

            request.FacilitySelector   = FacilitySelector.DTMF;
            dtfmParam.FacilityFunction = FacilityFunction.Send;
            dtfmParam.ToneDuration     = _dtfmDuration;
            dtfmParam.GapDuration      = _dtfmPause;
            dtfmParam.Digits           = digits;
            request.Identifier.Value   = _plci;
            RequestDTFM(request);
        }