本文整理汇总了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
示例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")
示例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")