Aracılığıyla paylaş


İşi zamanlama

Bir çağrı merkezi bağlamında müşteriler daha sonra zamanlanmış bir geri arama almak isteyebilir. Bu nedenle, İş Yönlendiricisi'nde zamanlanmış bir iş oluşturmanız gerekir.

Önkoşullar

ScheduleAndSuspendMode kullanarak iş oluşturma

Aşağıdaki örnekte, parametresiyle olarak ayarlanarak MatchingModeScheduleAndSuspendMode 3 dakika sonra zamanlanan bir scheduleAt iş oluşturulur. Bu örnekte queueId Callback ile bir kuyruk oluşturduğunuz ve kanalda Voice kullanılabilir kapasiteye sahip kuyruğa kayıtlı etkin bir çalışan olduğu varsayılır.

await client.CreateJobAsync(new CreateJobOptions(jobId: "job1", channelId: "Voice", queueId: "Callback")
{
    MatchingMode = new ScheduleAndSuspendMode(scheduleAt: DateTimeOffset.UtcNow.Add(TimeSpan.FromMinutes(3)))
});
await client.path("/routing/jobs/{jobId}", "job1").patch({
    body: {
        channelId: "Voice",
        queueId: "Callback",
        matchingMode: {
            kind: "scheduleAndSuspend",
            scheduleAt: new Date(Date.now() + 3 * 60000)
        }
    },
    contentType: "application/merge-patch+json"
});
client.upsert_job(
    job_id = "job1",
    channel_id = "Voice",
    queue_id = "Callback",
    matching_mode = ScheduleAndSuspendMode(schedule_at = datetime.utcnow() + timedelta(minutes = 3)))
client.createJob(new CreateJobOptions("job1", "Voice", "Callback")
    .setMatchingMode(new ScheduleAndSuspendMode(OffsetDateTime.now().plusMinutes(3))));

Not

zamanlandıktan sonra işin durumu başlangıçta PendingScheduleolur ve İş Yönlendiricisi işi başarıyla zamanladıktan sonra durumu olarak Scheduledgüncelleştirilir.

Zamanlanan saate ulaşılması için bekleyin, ardından işi sıraya alın

Zamanlanan zamana ulaşıldığında işin durumu olarak güncelleştirilir ve İş Yönlendiricisi Event Grid'e WaitingForActivation bir RouterJobWaitingForActivation olayı yayar. Bu olaya abone olunduysa, işin bir çalışanla eşleşmesi etkinleştirilmeden önce bazı gerekli eylemler gerçekleştirilebilir. Örneğin, iletişim merkezi bağlamında böyle bir eylem giden arama yapıyor ve müşterinin geri aramayı kabul etmesini bekliyor olabilir. Gerekli eylemler tamamlandıktan sonra, uygun bir çalışanı hızla bulmak için olarak ayarlanmış QueueAndMatchMode ve önceliği ayarlanmış yöntemi MatchingMode çağrılarak UpdateJobAsync100 iş kuyruğa alınabilir ve bu da işin durumunu olarak queuedgüncelleştirir.

// Event Grid Event Handler code omitted
if (eventGridEvent.EventType == "Microsoft.Communication.RouterJobWaitingForActivation")
{
    // Perform required actions here

    await client.UpdateJobAsync(new RouterJob(jobId: eventGridEvent.Data.JobId)
    {
        MatchingMode = new QueueAndMatchMode(),
        Priority = 100
    });
}
// Event Grid Event Handler code omitted
if (eventGridEvent.EventType == "Microsoft.Communication.RouterJobWaitingForActivation")
{
    // Perform required actions here

    await client.path("/routing/jobs/{jobId}", eventGridEvent.data.jobId).patch({
      body: {
          matchingMode: { kind: "queueAndMatch" },
          priority: 100
      },
      contentType: "application/merge-patch+json"
    });
}
# Event Grid Event Handler code omitted
if (eventGridEvent.event_type == "Microsoft.Communication.RouterJobWaitingForActivation")
{
    # Perform required actions here

    client.upsert_job(
        job_id = eventGridEvent.data.job_id,
        matching_mode = queue_and_match_mode = {},
        priority = 100)
}
// Event Grid Event Handler code omitted
if (eventGridEvent.EventType == "Microsoft.Communication.RouterJobWaitingForActivation")
{
    // Perform required actions here

    job = client.updateJob(eventGridEvent.getData().toObject(new TypeReference<Map<String, Object>>() {
}).get("JobId").toString(), BinaryData.fromObject(new RouterJob()
        .setMatchingMode(new QueueAndMatchMode())
        .setPriority(100)), null).toObject(RouterJob.class);
}

Sonraki adımlar

ı

  • İş için eşleşen bir çalışan bulunduktan sonra verilen İş Yönlendiricisi teklifini kabul etmeyi öğrenin.