application.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:wwalexa 作者: nealrs 项目源码 文件源码
def begin_call():
    print "start /begin_call"
    from_number = request.values.get('From', None)
    if from_number in callers:
        session['caller'] = callers[from_number]
    else:
        session['caller'] = "unknown"

    resp = VoiceResponse()
    if session['caller'] != "unknown":
        resp.say("Hey " + session['caller'] + "!")
        gather = Gather(input='dtmf speech', timeout=5, num_digits=4, action='/set_date', method='GET')
        gather.say("Let's record a new "+os.environ['PODCASTNAME']+"!\n First, when will this episode air?\n Say the air date or punch it in using a Month Month Day Day format.\n For example, you could say October 31st or punch in 10 31.")
        resp.append(gather)
        resp.say("You didn't give me a date. Bye!")
    else:
        resp.say("Hey, this isn't for you. \nBoy Bye!")
        resp.hangup()
        session.clear()
    return str(resp)


# validate date & record audio
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号