Example #1
0
        private static TropoModel ConvertSay(global::VoiceModel.Say model)
        {
            TropoModel tmodel = new TropoModel();

            ConvertPromptList(model.prompts, ref tmodel);
            return(tmodel);
        }
Example #2
0
        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);
        }
Example #3
0
 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));
     }
 }
Example #4
0
        private static TropoModel ConvertAsk(global::VoiceModel.Ask model)
        {
            TropoModel tmodel = new TropoModel();

            ConvertPromptList(model.initialPrompt, ref tmodel);

            return(tmodel);
        }
Example #5
0
        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);
        }
Example #6
0
 private static void ConvertPromptList(List <global::VoiceModel.Prompt> prompts, ref TropoModel tmodel, string sayOnEvent = null)
 {
     foreach (Prompt prompt in prompts)
     {
         ConvertPrompt(prompt, ref tmodel);
     }
 }
Example #7
0
        //TODO: Build say object that provides error message
        private static TropoModel Error()
        {
            TropoModel tmodel = new TropoModel();

            return(tmodel);
        }