Esempio n. 1
0
 internal PlayResult(ChannelEvent eventMessage) : base(eventMessage)
 {
     if (eventMessage != null)
     {
         Success = ResponseText == "FILE PLAYED";  //eventMessage.Headers[HeaderNames.ApplicationResponse] == "FILE PLAYED";
     }
     else
     {
         Success = false;
     }
 }
Esempio n. 2
0
        protected internal static AttendedTransferResult Hangup(ChannelEvent hangupMessage)
        {
            if (hangupMessage.EventName != EventName.ChannelHangup)
            {
                throw new InvalidOperationException("Expected event of type ChannelHangup, got {0} instead".Fmt(hangupMessage.EventName));
            }

            return(new AttendedTransferResult()
            {
                HangupCause = hangupMessage.HangupCause, Status = AttendedTransferResultStatus.Failed
            });
        }
Esempio n. 3
0
        internal ReadResult(ChannelEvent eventMessage, string channelVariable) : base(eventMessage)
        {
            if (eventMessage != null)
            {
                Digits = eventMessage.GetVariable(channelVariable);
                var readResult = eventMessage.GetVariable("read_result");
                Result = !string.IsNullOrEmpty(readResult)
                                  ? (ReadResultStatus)Enum.Parse(typeof(ReadResultStatus), readResult, true)
                                  : ReadResultStatus.Failure;
            }
            else
            {
                Result = ReadResultStatus.Failure;
            }

            Success = Result == ReadResultStatus.Success;
        }
Esempio n. 4
0
 private OriginateResult(ChannelEvent channelEvent)
 {
     ChannelData = channelEvent;
     Success     = channelEvent.AnswerState != AnswerState.Hangup;
     HangupCause = channelEvent.HangupCause;
 }