Add optional twilio-call-format config option
To be able to set custom TwiML send to the Call API.
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
twilioCallFormat = `
|
||||
defaultTwilioCallFormat = `
|
||||
<Response>
|
||||
<Pause length="1"/>
|
||||
<Say loop="3">
|
||||
@@ -65,6 +65,10 @@ func (s *Server) callPhone(v *visitor, r *http.Request, m *message, to string) {
|
||||
if u != nil {
|
||||
sender = u.Name
|
||||
}
|
||||
twilioCallFormat := defaultTwilioCallFormat
|
||||
if len(s.config.TwilioCallFormat) > 0 {
|
||||
twilioCallFormat = s.config.TwilioCallFormat
|
||||
}
|
||||
body := fmt.Sprintf(twilioCallFormat, xmlEscapeText(m.Topic), xmlEscapeText(m.Message), xmlEscapeText(sender))
|
||||
data := url.Values{}
|
||||
data.Set("From", s.config.TwilioPhoneNumber)
|
||||
|
||||
Reference in New Issue
Block a user