public override void ProcessResponse(FastAGIResponse response) { if (response.ResultValue == "0") { throw new AGICommandException("TDDMode Command Failed. The channel is not TDD capable."); } }
public override void ProcessResponse(FastAGIResponse response) { if (response.ResultValue != "0") { throw new AGICommandException("SetPriority Command Failed."); } }
public override void ProcessResponse(FastAGIResponse response) { if (response.ResultValue == "-1") { throw new AGICommandException("SendImage Command Failed."); } }
public override void ProcessResponse(FastAGIResponse response) { if (response.ResultValue == "0") { throw new AGICommandException("DatabaseDeleteTree Command Failed."); } }
public override string ProcessResponse(FastAGIResponse response) { if (response.ResultValue == "1") { _variableValue = response.Payload; } return(_variableValue); }
public override ChannelStatus ProcessResponse(FastAGIResponse response) { if (Enum.IsDefined(typeof(ChannelStatus), response.ResultValue)) { _channelStatus = (ChannelStatus)Enum.Parse(typeof(ChannelStatus), response.ResultValue); } return(_channelStatus); }
public override string ProcessResponse(FastAGIResponse response) { if (response.ResultValue == "-1") { throw new AGICommandException("ReceiveText Command Failed."); } _text = response.ResultValue; return(_text); }
public override string ProcessResponse(FastAGIResponse response) { _applicationReturnValue = response.ResultValue; if (response.ResultValue == "-2") { throw new AGICommandException("Execute Command Failed."); } return(_applicationReturnValue); }
public override string ProcessResponse(FastAGIResponse response) { if (response.ResultValue == "0") { throw new AGICommandException("DatabaseGet Command Failed."); } _resultingValue = response.Payload; return(_resultingValue); }
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); }
public override GetDataCommandResult ProcessResponse(FastAGIResponse response) { if (response.ResultValue == "-1") { throw new AGICommandException("GetData Command Failed."); } _result = new GetDataCommandResult(); _result.ResultingDtmfData = response.ResultValue; _result.Timeout = response.Payload == "timeout"; return(_result); }
public override Char?ProcessResponse(FastAGIResponse response) { if (response.ResultValue == "-1") { throw new AGICommandException("ReceiveChar Command Failed."); } if (response.ResultValue != "0") { _character = (Char)int.Parse(response.ResultValue); } return(_character); }
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); }
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)); }
public override Char?ProcessResponse(FastAGIResponse response) { if (response.ResultValue == "-1") { if (response.Payload == "waitfor") { throw new AGICommandException(string.Format("{0} Waitfor. EndPos={1}", CommonExceptionMessage, response.EndPosition)); } if (response.Payload == "writefile") { throw new AGICommandException(string.Format("{0} Failure to write file.", CommonExceptionMessage)); } } else if (response.ResultValue == "0") { if (response.Payload == "hangup") { throw new HangUpException(string.Format("{0} EndPos={1}", CommonExceptionMessage, response.EndPosition)); } if (response.Payload == "timeout") { throw new AGICommandException(string.Format("{0} Timeout. EndPos={1}", CommonExceptionMessage, response.EndPosition)); } } else if (response.Payload == "randomerror") { throw new AGICommandException(string.Format("{0} Random Error. EndPos={1}, Error={2}", CommonExceptionMessage, response.EndPosition, response.ResultValue)); } if (response.Payload == "dtmf") { _dtmfDigit = (Char)int.Parse(response.ResultValue); } return(_dtmfDigit); }
public override void ProcessResponse(FastAGIResponse response) { //This command always returns a result value of 0. }
public abstract void ProcessResponse(FastAGIResponse response);