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


Python VoiceResponse.gather方法代码示例

本文整理汇总了Python中twilio.twiml.voice_response.VoiceResponse.gather方法的典型用法代码示例。如果您正苦于以下问题:Python VoiceResponse.gather方法的具体用法?Python VoiceResponse.gather怎么用?Python VoiceResponse.gather使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twilio.twiml.voice_response.VoiceResponse的用法示例。


在下文中一共展示了VoiceResponse.gather方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: incoming_call

# 需要导入模块: from twilio.twiml.voice_response import VoiceResponse [as 别名]
# 或者: from twilio.twiml.voice_response.VoiceResponse import gather [as 别名]
def incoming_call(request):
    """ Returns TwiML instructions to Twilio's POST requests """
    resp = VoiceResponse()
    resp.say("For Programmable SMS, press one. For Voice, press any other key.")
    resp.gather(numDigits=1, action="/call/enqueue", method="POST")

    return HttpResponse(resp)
开发者ID:TwilioDevEd,项目名称:task-router-django,代码行数:9,代码来源:views.py

示例2: voice_twiml

# 需要导入模块: from twilio.twiml.voice_response import VoiceResponse [as 别名]
# 或者: from twilio.twiml.voice_response.VoiceResponse import gather [as 别名]
def voice_twiml(question):
    response = VoiceResponse()
    response.say(question.content)
    response.say(VOICE_INSTRUCTIONS[question.kind])

    action_url = url_for('answer', question_id=question.id)
    transcription_url = url_for('answer_transcription',
                                question_id=question.id)
    if question.kind == Question.TEXT:
        response.record(action=action_url,
                        transcribe_callback=transcription_url)
    else:
        response.gather(action=action_url)
    return str(response)
开发者ID:TwilioDevEd,项目名称:automated-survey-flask,代码行数:16,代码来源:question_view.py

示例3: gather

# 需要导入模块: from twilio.twiml.voice_response import VoiceResponse [as 别名]
# 或者: from twilio.twiml.voice_response.VoiceResponse import gather [as 别名]
def gather(request, action=None, method='POST', num_digits=None, timeout=None,
           finish_on_key=None):
    """
    See: http://www.twilio.com/docs/api/twiml/gather.

    Usage::

        # urls.py
        urlpatterns = patterns('',
            # ...
            url(r'^gather/$', 'django_twilio.views.gather'),
            # ...
        )
    """
    r = VoiceResponse()
    r.gather(action=action, method=method, num_digits=num_digits,
             timeout=timeout, finish_on_key=finish_on_key)
    return r
开发者ID:boardman,项目名称:django-twilio,代码行数:20,代码来源:views.py

示例4: voice

# 需要导入模块: from twilio.twiml.voice_response import VoiceResponse [as 别名]
# 或者: from twilio.twiml.voice_response.VoiceResponse import gather [as 别名]
def voice():

    resp = VoiceResponse()
    # Greet the caller by name
    resp.say("Hello. It's me. ")
    # Play an mp3
    resp.play("http://howtodocs.s3.amazonaws.com/ahoyhoy.mp3")

    # Gather digits.
    with resp.gather(numDigits=1, action="/handle-gather", method="POST") as g:
        g.say(
            """To speak to a real person, press 1.
                 Press 2 to record a message for a Twilio educator.
                 Press any other key to start over."""
        )

    return str(resp)
开发者ID:GilbertoBotaro,项目名称:api-snippets,代码行数:19,代码来源:twiml-record.6.x.py

示例5: VoiceResponse

# 需要导入模块: from twilio.twiml.voice_response import VoiceResponse [as 别名]
# 或者: from twilio.twiml.voice_response.VoiceResponse import gather [as 别名]
from twilio.twiml.voice_response import Gather, VoiceResponse

response = VoiceResponse()
response.gather()

print(response)
开发者ID:GilbertoBotaro,项目名称:api-snippets,代码行数:8,代码来源:gather-2.6.x.py


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