def post_valid(self, request):
"""Expects a POST request from Twilio, and return a response directing
Twilio to play the greeting mp3 and post the recorded response to
the handle voicemail URL
"""
response = VoiceResponse()
self.static_greeting_path = static(self.voicemail_static_path)
self.record_voicemail_url = request.build_absolute_uri(
reverse('phone-handle_new_message')).replace('http:', 'https:')
response.play(self.static_greeting_path)
response.record(action=self.record_voicemail_url, method='POST')
return HttpResponse(response)
评论列表
文章目录