예제 #1
0
        public override Digits ProcessResponse(FastAGIResponse response)
        {
            if (response.ResultValue == "-1")
            {
                throw new AGICommandException("SayPhonetic Command Failed.");
            }

            if (response.ResultValue != "0")
            {
                _pressedDigit = AsteriskAGI.GetDigitsFromString(((Char)int.Parse(response.ResultValue)).ToString());
            }

            return(_pressedDigit);
        }
예제 #2
0
        public override Digits ProcessResponse(FastAGIResponse response)
        {
            if (response.ResultValue == "-1")
            {
                throw new AGICommandException("WaitForDigit Command Failed.");
            }

            if (response.ResultValue != "0")
            {
                int digitCode;
                if (int.TryParse(response.ResultValue, out digitCode))
                {
                    _digit = AsteriskAGI.GetDigitsFromString(((Char)digitCode).ToString());
                }
            }

            return(_digit);
        }
예제 #3
0
        public override StreamFileResult ProcessResponse(FastAGIResponse response)
        {
            if (response.ResultValue == "-1")
            {
                throw new AGICommandException("StreamFile Command Failed.");
            }

            if (response.EndPosition != null)
            {
                _offset = response.EndPosition.Value;
            }

            if (response.ResultValue != "0")
            {
                _digit = AsteriskAGI.GetDigitsFromString(((Char)int.Parse(response.ResultValue)).ToString());
            }

            return(new StreamFileResult(_digit, _offset));
        }