private void ProcessAsteriskMessages(object sender, PbxMessagesEventArgs e) { var logMessage = "\r\n Parsed messages:" + String .Join ( "\r\n\r\n", e.Messages .Select ( r => String.Join("\r\n", r.Select(x => x.Key + " " + x.Value)) ) ) + "\r\n End of parsed messages." ; NLogContaner.Instance.Trace(logMessage); foreach (var pbxEvent in e.Messages) { var eventCache = new PbxEventCache { Event = pbxEvent, TimeStamp = DateTime.Now }; mPbxEventCachesRepository.Create(eventCache); } mClients.All.broadcastMessage(e.Messages); }
private void OnPbxMessageRecived(PbxMessagesEventArgs e) { var handler = PbxMessageRecived; if (handler != null) handler(this, e); }