我正在使用带有会议指令的 TaskRouter 处理来电,如下所示
@csrf_exempt
def TaskEnqueue(request):
""" Put call into queue """
response = VoiceResponse()
digits = request.POST['Digits']
selected_service = 'Support' if digits == '1' else 'Sales'
task = {'selected_service': selected_service}
enqueue = response.enqueue(None, workflowSid=TWILIO_WORKFLOW_SID)
enqueue.task(json.dumps(task))
return HttpResponse(
str(response), content_type='application/xml; charset=utf-8'
)
@csrf_exempt
def TaskAssignmentView(request):
""" Task assignment """
worker_attributes = json.loads(request.POST['WorkerAttributes'])
assigned_worder_uri = worker_attributes['contact_uri']
response = {'instruction': 'conference',
'from': TWILIO_NUMBER,
'to': assigned_worder_uri,
'end_conference_on_exit': True,
'post_work_activity_sid': TWILIO_ACTIVITY_BREAK}
return JsonResponse(response)
我想在代理或呼叫者挂断后结束会议。
即使使用“end_conference_on_exit”属性,会议也仅在座席挂断时结束,而不是在呼叫者挂断时结束。
我错过了什么吗?