Skip to content

Instantly share code, notes, and snippets.

@dtolb
Created January 22, 2016 21:47
Show Gist options
  • Save dtolb/58ed14021ec7b7cb8854 to your computer and use it in GitHub Desktop.
Save dtolb/58ed14021ec7b7cb8854 to your computer and use it in GitHub Desktop.
Speak Sentence
private async Task ProcessCatapultFromEvent(AnswerEvent ev)
{
// "from" number answered a call. speak him a message
var call = new Call { Id = ev.CallId };
call.SetClient(Client);
var contact = DbContext.Contacts.FirstOrDefault(c => c.PhoneNumber == ev.Tag);
if (contact == null)
{
throw new Exception("Missing contact for number " + ev.Tag);
}
await call.SpeakSentence(string.Format("We are connecting you to {0}", contact.Name), ev.Tag);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment