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


Python Response.gather方法代码示例

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


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

示例1: handle_third_response

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import gather [as 别名]
def handle_third_response(request):
    digits = request.POST.get('Digits', '')
    twilio_response_three=Response()
    #twilio_response_three.say(digits)
    twilio_response_three.play('http://travellingscholar.com/ammi/message6.mp3')
    twilio_response_three.gather(action='respond4', numDigits=1)
    return twilio_response_three
开发者ID:Sabina321,项目名称:ammitips_code,代码行数:9,代码来源:views.py

示例2: handle_call

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import gather [as 别名]
def handle_call(request):
	r = Response()
	if request.GET['key'] == settings.TWILIO_KEY:
		kwargs = {'text':settings.GREETINGS, 'voice':None, 'language':None, 'loop':None}
		r.say(**kwargs)
		kwargs = {'action':settings.BASE_URL+'call_reference/?key='+request.GET['key'], 'method':'POST', 'timeout':settings.TWILIO_TIMEOUT, 'finish_on_key':settings.TWILIO_FINISHKEY}
		r.gather(**kwargs)
	return r
开发者ID:vinczente,项目名称:xLines,代码行数:10,代码来源:views.py

示例3: voice

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import gather [as 别名]
def voice(request):
    """Create a Twilio response object which gathers the callers input"""
    r = Response()
    with r.gather(action='/respond/') as g:
        g.say('Please enter a number to play phone buzz. Press the pound key when finished.', voice='woman')
        g.pause(length=10)
    return r
开发者ID:jtmurphy89,项目名称:phonebuzz,代码行数:9,代码来源:views.py

示例4: ring

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import gather [as 别名]
def ring(request):
    twilio_response = Response()
    message = 'Welcome to Fizz Buzz! Press up to three digits to start playing.'
    with twilio_response.gather(action='/response/', numDigits=3) as g:
        g.say(message)
        g.pause(length=1.5)
        g.say(message)
    return twilio_response
开发者ID:Sticksword,项目名称:exploringTwilioAPI,代码行数:10,代码来源:views.py

示例5: gather

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response 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 = Response()
    r.gather(action=action, method=method, numDigits=num_digits,
             timeout=timeout, finishOnKey=finish_on_key)
    return r
开发者ID:EagleInformationMapping,项目名称:Hackathon2014,代码行数:19,代码来源:views.py

示例6: gather_digits

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import gather [as 别名]
def gather_digits(request):
    twilio_response=Response()
    
    with twilio_response.gather(action='https://www.twilio.com/blog/respond/', numDigits=1) as g:
        g.say('Press one for a song, two to recieve an sms')
        g.pause(length=1)
        g.say('Press one for a song, two to recieve an sms')
        return twilio_response
开发者ID:Quantumke,项目名称:InteractiveVoiceResponseSystem,代码行数:10,代码来源:views.py

示例7: receiveDigits

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import gather [as 别名]
def receiveDigits(request):
    "Once the call has been made, this presents the user with an automated greeting"
    greeting = "Please press a number that would you like fizzbuzzed. Note, for your own convenience, keep the number 2 digits or less."
    returnMessage = Response()
    #Use <Gather> to collect digits that a caller enters into his or her telephone keypad. The data is then submitted.
    with returnMessage.gather(action='/respond/', numDigits=2) as initialGreeting: 
        initialGreeting.say(greeting)
        initialGreeting.pause(length=3)
    return returnMessage
开发者ID:ndanait,项目名称:LendUp-Challenge_Neil,代码行数:11,代码来源:views.py

示例8: gather_digits

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import gather [as 别名]
def gather_digits(request):
	
	twilio_response = Response()
	try:
		with twilio_response.gather(action='/phonebuzz/respond/', numDigits=3, finish_on_key='#') as g:
			g.say('Enter your FizzBuzz Number followed by a pound')
	except:
		return HttpResponseBadRequest
	return twilio_response
开发者ID:wcookie,项目名称:LendUpChallenge,代码行数:11,代码来源:views.py

示例9: get

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import gather [as 别名]
    def get(self, request):
        call, _ = ClientCall.objects.get_or_create(sid=request.GET["CallSid"])
        call.request_bed_count()

        r = Response()
        r.say("How many beds do you need tonight?")
        with r.gather(finishOnKey="#", method="POST", action=reverse("phone:bed_count"), numdigits=1) as g:
            g.say("Press a number, then press pound")

        return r
开发者ID:pombredanne,项目名称:continuum,代码行数:12,代码来源:views.py

示例10: gather_digits

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

    twilio_response = Response()

    with twilio_response.gather(action='/respond/', numDigits=1) as g:
        g.say('Press one to Notify Yaser, or  press two to notify Nazih')
        g.pause(length=1)
        g.say('Press one to notify  Yaser, or press two to notify Nazih')

    return twilio_response
开发者ID:ywattar,项目名称:djangoTwilio,代码行数:12,代码来源:views.py

示例11: gather_digits

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import gather [as 别名]
def gather_digits(request):
 
    twilio_response = Response()
 
    with twilio_response.gather(action='/respond/', numDigits=1) as g:
        g.say('Press one to hear a song, two to receive an SMS')
        g.pause(length=1)
        g.say('Press one to hear a song, two to receive an SMS')
 
    return twilio_response
开发者ID:mickstevens,项目名称:dev-angel-ivr,代码行数:12,代码来源:old_views.py

示例12: gather_digits

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

    msg = 'Oye. Press a number to enter the world of Fizz Buzz. You can press maximum two digits'

    twilio_response = Response()
    with twilio_response.gather(action='/respond/', numDigits=2) as g:
        g.say(msg)
        g.pause(length=1)
        g.say(msg)

    return twilio_response
开发者ID:sreenug,项目名称:lendup-phonebuzz,代码行数:13,代码来源:views.py

示例13: gather_digits

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import gather [as 别名]
def gather_digits(request):
    twilio_response = Response()

    twilio_response.play('http://travellingscholar.com/ammi/message1.mp3') 

    twilio_response.play('http://travellingscholar.com/ammi/message2.mp3')
    with twilio_response.gather(action='respond', numDigits=1) as g:
#g.say('Assalaam walaikum, Ammi Tips par khush amdeed')
        #g.say(request)
        g.pause(length=1)
    return twilio_response
开发者ID:Sabina321,项目名称:ammitips_code,代码行数:13,代码来源:views.py

示例14: gather_digits

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

    msg = 'Press one to hear a song, two to receive an SMS, three to record a message.'

    twilio_response = Response()
    with twilio_response.gather(action='/respond_digits/', numDigits=1) as g:
        g.say(msg)
        g.pause(length=3)
        g.say(msg)

    return twilio_response
开发者ID:kishan,项目名称:Django_Twilio_Project,代码行数:13,代码来源:views.py

示例15: login

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import gather [as 别名]
def login(request):
    r = Response()
    with r.gather(
        numDigits=6,
        timeout=10,
        finishOnKey='*',
        action=reverse('twiliorouter:handle_login'), method='POST'
    ) as g:
        g.say(
            'please enter your 6 digit phone number to continue'
        )
    return r
开发者ID:jamieingram,项目名称:twilio_switchboard,代码行数:14,代码来源:views.py


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