Exemple #1
0
/* when caller picks up */
func summonCallback(w http.ResponseWriter, r *http.Request) {
	resp := twiml.NewResponse()

	r.ParseForm()
	resp.Action(
		twiml.Play{Url: "https://s3-us-west-2.amazonaws.com/hard.chat/summoner/summon1.mp3"})
	resp.Send(w)
}
Exemple #2
0
func basicTwiml(c web.C, w http.ResponseWriter, r *http.Request) {
	resp := twiml.NewResponse()
	resp.Action(twiml.Say{Text: "Hello Monkey"})
	resp.Action(twiml.Play{Url: "http://demo.twilio.com/hellomonkey/monkey.mp3"})
	resp.Action(twiml.Pause{Length: 1})
	err := resp.Dial(twiml.Conference{Name: "foobar"})
	if err != nil {
		fmt.Println(err.Error())
	}
	resp.Send(w)
}
Exemple #3
0
func receiveSMSHandler(w http.ResponseWriter, r *http.Request) {
	sender := r.FormValue("From")
	body := r.FormValue("Body")

	resp := twiml.NewResponse()
	resp.Action(twiml.Message{
		Body: fmt.Sprintf("Hello, %s, you said: %s", sender, body),
		From: twilioNumber,
		To:   sender,
	})
	resp.Send(w)
}
Exemple #4
0
func receiveCallHandler(w http.ResponseWriter, r *http.Request) {
	resp := twiml.NewResponse()
	resp.Action(twiml.Say{Text: "Hello from App Engine!"})
	resp.Send(w)
}