Created
January 22, 2016 21:47
-
-
Save dtolb/58ed14021ec7b7cb8854 to your computer and use it in GitHub Desktop.
Speak Sentence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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