当前位置: 首页>>代码示例>>Python>>正文


Python Response.pause方法代码示例

本文整理汇总了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
开发者ID:hgrimberg01,项目名称:esc,代码行数:21,代码来源:views.py

示例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
开发者ID:kylestoneman,项目名称:killitwithfire,代码行数:23,代码来源:views.py


注:本文中的twilio.twiml.Response.pause方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。