本文整理汇总了Python中twilio.twiml.Response.pause方法的典型用法代码示例。如果您正苦于以下问题:Python Response.pause方法的具体用法?Python Response.pause怎么用?Python Response.pause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twilio.twiml.Response
的用法示例。
在下文中一共展示了Response.pause方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_phone_score
# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import pause [as 别名]
def get_phone_score(request):
r = Response()
team_id = request.POST['Digits']
try:
team = Team.objects.get(pk=team_id)
scores = Score.objects.filter(team=team)
r.say("Scores for team, "+team.name,voice='woman',language='en-gb')
r.pause(length=2)
for score in scores:
r.say('For Event "'+score.event.name + '", You have ' + str(score.score) + ' points. ',voice='woman',language='en-gb')
r.pause(length=1)
r.say("Thank you for calling. Goodbye!",voice='woman',language='en-gb')
r.hangup()
except Team.DoesNotExist:
r.say("We're sorry, The team number entered does not exist.")
return r
示例2: notify_call
# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import pause [as 别名]
def notify_call(request, notification_uuid):
r = Response()
try:
notification = Notification.objects.get(uuid=notification_uuid)
except Notification.DoesNotExist:
return r
r.say("This is an oncaller notification.")
message = notification.message
if message:
r.say(message, loop=2)
#duke!
r.play('http://dev.oncallr.com/static/audio/b2w.mp3')
r.pause(length=1)
r.say("Hit 1 to acknowledge, 2 to reject.", voice="woman")
r.gather(action="http://www.oncallr.com/notification/call/response/{0}/".format(notification_uuid), method="POST", numDigits=1, timeout=2, finishOnKey=None)
r.redirect(url="http://www.oncallr.com/notification/call/response/{0}/".format(notification_uuid), method="POST")
return r