private static TropoModel ConvertSay(global::VoiceModel.Say model) { TropoModel tmodel = new TropoModel(); ConvertPromptList(model.prompts, ref tmodel); return(tmodel); }
public static TropoModel VoiceToTropo(VoiceModel vmodel) { TropoModel tmodel = new TropoModel(); switch (vmodel.GetType().ToString()) { case "VoiceModel.Exit": tmodel = ConvertExit((Exit)vmodel); break; case "VoiceModel.Ask": tmodel = ConvertAsk((global::VoiceModel.Ask)vmodel); break; case "VoiceModel.Say": tmodel = ConvertSay((global::VoiceModel.Say)vmodel); break; default: tmodel = Error(); break; } return(tmodel); }
private static void ConvertPrompt(global::VoiceModel.Prompt prompt, ref TropoModel tmodel, string sayOnEvent = null) { foreach (IAudio audio in prompt.audios) { tmodel.tropo.Add("say", new global::VoiceModel.TropoModel.say(audio.message)); } }
private static TropoModel ConvertAsk(global::VoiceModel.Ask model) { TropoModel tmodel = new TropoModel(); ConvertPromptList(model.initialPrompt, ref tmodel); return(tmodel); }
private static TropoModel ConvertExit(Exit model) { TropoModel tmodel = new TropoModel(); ConvertPromptList(model.ExitPrompt, ref tmodel); hangup h = null; tmodel.tropo.Add("hangup", h); return(tmodel); }
private static void ConvertPromptList(List <global::VoiceModel.Prompt> prompts, ref TropoModel tmodel, string sayOnEvent = null) { foreach (Prompt prompt in prompts) { ConvertPrompt(prompt, ref tmodel); } }
//TODO: Build say object that provides error message private static TropoModel Error() { TropoModel tmodel = new TropoModel(); return(tmodel); }