private void OnEvent(EventBase receivedEvent) { if (!receivedEvent.IsChannelEvent) { return; } ChannelEvent channelEvent = (ChannelEvent)receivedEvent; if (channelEvent.UniqueId != _uuid) { return; } if (receivedEvent is EventChannelAnswer) { _answered = true; } else if (receivedEvent is EventDtmf) { EventDtmf evt = (EventDtmf)receivedEvent; Console.WriteLine("DTMF Event: " + evt.Digit); if (_queue.GotDtmf(evt.Digit)) { lock (_dtmf) _dtmf += evt.Digit; if (_dtmfWaitCount != 0 && _dtmf.Length >= _dtmfWaitCount) { Console.WriteLine("Got all DTMF: " + _dtmfWaitCount + "/" + _dtmf.Length); _dtmfTimeout.Set(); } if (DtmfReceived != null) { DtmfReceived(this, new DtmfEventArgs(_dtmf)); } } } else if (receivedEvent is EventChannelDestroy || receivedEvent is EventChannelHangup) { if (_mgr != null) { _mgr.EventReceived -= OnEvent; _mgr = null; } } else if (receivedEvent is EventChannelExecute) { EventChannelExecute exec = (EventChannelExecute)receivedEvent; _queue.Execute(exec); } else if (receivedEvent is EventChannelExecuteComplete) { EventChannelExecuteComplete exec = (EventChannelExecuteComplete)receivedEvent; _queue.ExecuteComplete(exec); } }
public void Execute(EventChannelExecute evt) { }