private async Task ProcessCalledToOwnerEvent(PlaybackEvent ev, TinyIoCContainer container) { if (ev.Status != "done") { return; } var call = new Call {Id = ev.CallId}; switch (ev.Tag) { case "start-recording": Trace.WriteLine("Start recording of voice message"); await call.RecordingOn(); break; default: { var tags = ev.Tag.Split(':'); if (tags[0] == "voice-message") { var index = int.Parse(tags[1]); if (index > 0) { Trace.WriteLine(string.Format("Play next voice message: {0}", index - 1)); await PlayVoiceMessage(container, call, index - 1); } else { Trace.WriteLine("Return back to the conference"); await CurrentConferenceMember .Update(new Dictionary<string, object> { {"hold", false} }); } } break; } } }