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


Python Response.enqueue方法代码示例

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


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

示例1: get

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import enqueue [as 别名]
    def get(self, request, client_call, pks):
        pks = pks.split(",")
        try:
            shelter = Shelter.objects.get(pk=pks[0])
        except Shelter.DoesNotExist:
            pks = ",".join(pks[1:])
            if pks:
                return redirect(reverse("phone:start_shelter_call", kwargs={"pks": pks, "client_call": client_call}))

        site = Site.objects.get_current()
        client.calls.create(
            to=shelter.phone_number,
            from_=settings.TWILIO_CALLER_ID,
            url=urljoin(
                "http://" + site.domain,
                reverse("phone:verify_shelter_availability", kwargs={"client_call": client_call, "pk": pks[0]}),
            ),
            method="GET",
            status_callback="http://%s/phone/shelter_call_callback/%s/%s/"
            % (site.domain, client_call, ",".join(pks[1:])),
            status_method="GET",
        )

        r = Response()
        r.say("We are contacting %s. Please hold." % shelter.name)
        r.enqueue(name="waiting_for_shelter", wait_url="http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient")
        return r
开发者ID:pombredanne,项目名称:continuum,代码行数:29,代码来源:views.py

示例2: setUp

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import enqueue [as 别名]
    def setUp(self):
        r = Response()
        r.enqueue("TestEnqueueAttribute", action="act", method='GET',
                  waitUrl='wait', waitUrlMethod='POST')
        xml = r.toxml()

        #parse twiml XML string with Element Tree and inspect
        #structure
        tree = ET.fromstring(xml)
        self.conf = tree.find("./Enqueue")
开发者ID:beallio,项目名称:twilio-python,代码行数:12,代码来源:test_twiml.py

示例3: setUp

# 需要导入模块: from twilio.twiml import Response [as 别名]
# 或者: from twilio.twiml.Response import enqueue [as 别名]
    def setUp(self):
        r = Response()
        with r.enqueue(None, workflowSid="Workflow1") as e:
            e.task('{"selected_language":"en"}', priority="10", timeout="50")

        xml = r.toxml()

        # parse twiml XML string with Element Tree and inspect
        # structure
        tree = ET.fromstring(xml)
        self.enqueue = tree.find("./Enqueue")
        self.task = self.enqueue.find(".//Task")
开发者ID:Adomako-Bismark,项目名称:twilio-python,代码行数:14,代码来源:test_twiml.py


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