Bagikan melalui


Berlangganan ke kejadian Job Router

Panduan ini menguraikan langkah-langkah untuk menyiapkan langganan untuk peristiwa Job Router dan cara menerimanya.

Untuk detail selengkapnya tentang Event Grid, lihat dokumentasi Event Grid.

Prasyarat

Buat langganan Event Grid

Templat ini menyebarkan langganan Event Grid pada antrean Penyimpanan untuk peristiwa Job Router. Jika akun penyimpanan, antrean, atau topik sistem tidak ada, akun tersebut juga akan dibuat.

Sebarkan ke Azure

Parameter

  • Nama Sumber Daya Azure Communication Services: Nama sumber daya Azure Communication Services Anda. Misalnya, jika titik akhir ke sumber daya Anda adalah https://contoso.communication.azure.net, maka atur ke contoso.
  • Nama Penyimpanan: Nama Akun Azure Storage Anda. Jika tidak ada, itu akan dibuat.
  • Nama Sub Peristiwa: Nama langganan peristiwa yang akan dibuat.
  • Nama Topik Sistem: Jika Anda memiliki langganan peristiwa yang sudah ada di sumber daya Azure Communication Services Anda, temukan System Topic nama di tab Events sumber daya Azure Communication Services Anda. Jika tidak, tentukan nama unik seperti nama sumber daya Azure Communication Services itu sendiri.
  • Nama Antrean: Nama Antrean Anda dalam Akun Penyimpanan Anda. Jika tidak ada, itu akan dibuat.

Sumber daya yang disebarkan

Sumber daya berikut disebarkan sebagai bagian dari solusi

  • Akun Penyimpanan: Jika nama akun penyimpanan tidak ada.
  • Antrean Penyimpanan: Jika antrean tidak ada di dalam akun penyimpanan.
  • Topik Sistem Event Grid: Jika topik tidak ada.
  • Langganan Event Grid: Langganan untuk semua peristiwa Job Router pada antrean penyimpanan.

Mulai cepat: Menerima peristiwa Event Grid melalui Antrean Azure Storage

Membuat aplikasi C# baru

Di jendela konsol (seperti cmd, PowerShell, atau Bash), gunakan perintah dotnet new untuk membuat aplikasi konsol baru dengan nama EventReceiver. Perintah ini membuat proyek C# "Halo Dunia" sederhana dengan file sumber tunggal: Program.cs.

dotnet new console -o EventReceiver

Ubah direktori Anda ke folder aplikasi yang baru dibuat dan gunakan perintah dotnet build untuk mengompilasi aplikasi Anda.

cd EventReceiver
dotnet build

Menginstal paket

Instal paket Azure Storage Queues dan Event Grid.

dotnet add package Azure.Storage.Queues
dotnet add package Azure.Messaging.EventGrid

Menerima pesan dari antrean

Salin cuplikan kode berikut dan tempelkan ke file sumber: Program.cs

using Azure.Storage.Queues;
using Azure.Messaging.EventGrid;

// For more detailed tutorials on storage queues, see: https://learn.microsoft.com/azure/storage/queues/storage-tutorial-queues

var queueClient = new QueueClient("<Storage Account Connection String>", "router-events");

while (true)
{
    var msg = await queueClient.ReceiveMessageAsync();
    if (msg.Value == null)
    {
        await Task.Delay(TimeSpan.FromSeconds(1));
        continue;
    }
    var json = Convert.FromBase64String(msg.Value.Body.ToString());
    var evt = EventGridEvent.Parse(BinaryData.FromBytes(json));

    Console.WriteLine($"Received event: {evt.EventType} - {evt.Subject} - {evt.Data}");

    await queueClient.DeleteMessageAsync(msg.Value.MessageId, msg.Value.PopReceipt);
}

Menjalankan kode

Menjalankan aplikasi dari direktori aplikasi Anda dengan perintah dotnet run.

dotnet run

Katalog Kejadian

Kejadian Router

Acara Subdomain Deskripsi
RouterJobReceived Job Pekerjaan baru telah dibuat untuk perutean
RouterJobClassified Job Kebijakan klasifikasi telah diterapkan pada pekerjaan
RouterJobQueued Job Pekerjaan telah berhasil diantrekan
RouterJobClassificationFailed Job Router gagal mengklasifikasikan pekerjaan menggunakan kebijakan klasifikasi
RouterJobCompleted Job Sebuah pekerjaan telah selesai dan memasuki tahap penyelesaian
RouterJobClosed Job Pekerjaan telah ditutup dan tahap penyelesaian telah usai
RouterJobCancelled Job Sebuah pekerjaan telah dibatalkan
RouterJobExceptionTriggered Job Pengecualian pekerjaan telah dipicu
RouterJobWorkerSelectorsExpired Job Satu atau beberapa pemilih pekerja pada pekerjaan telah kedaluwarsa
RouterJobUnassigned Job Pekerjaan yang sudah ditetapkan telah tidak ditetapkan dari pekerja
RouterJobWaitingForActivation Job Waktu terjadwal pekerjaan terjadwal yang diminta telah tiba, Router sedang menunggu contoso untuk bertindak pada pekerjaan
RouterJobSchedulingFailed Job Namun, pekerjaan terjadwal diminta, Router gagal membuatnya
RouterWorkerOfferIssued Worker Sebuah pekerjaan telah ditawarkan kepada seorang pekerja
RouterWorkerOfferAccepted Worker Penawaran kepada seorang pekerja diterima
RouterWorkerOfferDeclined Worker Penawaran kepada seorang pekerja ditolak
RouterWorkerOfferRevoked Worker Penawaran kepada seorang pekerja dicabut
RouterWorkerOfferExpired Worker Penawaran kepada seorang pekerja telah kedaluwarsa
RouterWorkerRegistered Worker Pekerja telah terdaftar (status berubah dari tidak aktif/menguras menjadi aktif)
RouterWorkerUpdated Worker Salah satu properti pekerja berikut telah diperbarui: AvailableForOffers, , TotalCapacity, QueueAssignments, ChannelConfigurations, LabelsTags
RouterWorkerDeregistered Worker Pekerja telah dibatalkan pendaftarannya (status berubah dari aktif menjadi tidak aktif/menguras)

Microsoft.Communication.RouterJobDiterima

Kembali ke Katalog Kejadian

{
  "id": "acdf8fa5-8ab4-4a65-874a-c1d2a4a97f2e",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "jobStatus": "PendingClassification",
    "channelId": "FooVoiceChannelId",
    "classificationPolicyId": "test-policy",
    "queueId": "queue-id",
    "priority": 0,
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "requestedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttlSeconds": 50,
        "expirationTime": "2022-02-17T00:58:25.1736293Z"
      }
    ],
    "scheduledOn": "3/28/2007 7:13:50 PM +00:00",
    "unavailableForMatching": false
  },
  "eventType": "Microsoft.Communication.RouterJobReceived",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
jobId string
channelReference string
jobStatus enum Kemungkinan nilai PendingClassification, Diantrekan Ketika peristiwa ini dikirim, proses klasifikasi belum dijalankan atau pekerjaan dibuat dengan queueId terkait.
channelId string
classificationPolicyId string ✔️ null ketika queueId ditentukan untuk suatu pekerjaan
queueId string ✔️ null ketika classificationPolicyId ditentukan untuk suatu pekerjaan
prioritas int ✔️ Null ketika classificationPolicyId ditentukan. Nilai non-null dalam kasus penetapan antrean langsung.
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna
requestedWorkerSelectors List<WorkerSelector> ✔️ Berdasarkan input pengguna
scheduledOn DateTimeOffset ✔️ Berdasarkan input pengguna
tidak tersediaForMatching bool ✔️ Berdasarkan input pengguna

Microsoft.Communication.RouterJobClassified

Kembali ke Katalog Kejadian

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/queue/{queue-id}",
  "data": {
    "queueDetails": {
      "id": "625fec06-ab81-4e60-b780-f364ed96ade1",
      "name": "Queue 1",
      "labels": {
        "Language": "en",
        "Product": "Office",
        "Geo": "NA"
      }
    },
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "classificationPolicyId": "test-policy",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "priority": 5,
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "attachedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ]
  },
  "eventType": "Microsoft.Communication.RouterJobClassified",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
queueDetails QueueDetails
jobId string
channelReference string
channelId string
classificationPolicyId string
queueId string ✔️ null ketika classificationPolicy tidak digunakan untuk pemilihan antrean
prioritas int ✔️ null ketika classificationPolicy tidak digunakan untuk menerapkan prioritas pada pekerjaan
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna
attachedWorkerSelectors List<WorkerSelector> ✔️ Daftar pemilih pekerja yang dilampirkan oleh kebijakan klasifikasi

Microsoft.Communication.RouterJobQueued

Kembali ke Katalog Kejadian

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/queue/{queue-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "priority": 1,
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "requestedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "attachedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ]
  },
  "eventType": "Microsoft.Communication.RouterJobQueued",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
jobId string
channelReference string ✔️
channelId string
queueId string
prioritas int
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna
requestedWorkerSelectors List<WorkerSelector> ✔️ Berdasarkan input pengguna saat membuat pekerjaan
attachedWorkerSelectors List<WorkerSelector> ✔️ Daftar pemilih pekerja yang dilampirkan oleh kebijakan klasifikasi

Microsoft.Communication.RouterJobClassificationFailed

Kembali ke Katalog Kejadian

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/classificationpolicy/{classificationpolicy-id}",
  "data": {
    "errors": [
      {
        "code": null,
        "message": "Classification failed due to <reason>",
        "target": null,
        "innerError": null,
        "details": null
      }
    ],
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "classificationPolicyId": "test-policy",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterJobClassificationFailed",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
errors List<CommunicationError>
jobId string
channelReference string
channelId string
classificationPolicyId string
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna

Microsoft.Communication.RouterJobCompleted

Kembali ke Katalog Kejadian

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/assignment/{assignment-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "queue-id",
    "assignmentId": "6f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "workerId": "e3a3f2f9-3582-4bfe-9c5a-aa57831a0f88"
  },
  "eventType": "Microsoft.Communication.RouterJobCompleted",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
jobId string
channelReference string
channelId string
queueId string
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna
assignmentId string
workerId string

Microsoft.Communication.RouterJobClosed

Kembali ke Katalog Kejadian

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/assignment/{assignment-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "",
    "dispositionCode": "",
    "workerId": "",
    "assignmentId": "",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterJobClosed",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
jobId string
channelReference string
channelId string
queueId string
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna
dispositionCode string ✔️ Berdasarkan input pengguna
workerId string
assignmentId string

Microsoft.Communication.RouterJobCancelled

Kembali ke Katalog Kejadian

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/disposition/{disposition-code}",
  "data": {
    "note": "Cancelled due to <reason>",
    "dispositionCode": "100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "queueId": ""
  },
  "eventType": "Microsoft.Communication.RouterJobCancelled",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
catatan string ✔️ Berdasarkan input pengguna
dispositionCode string
jobId string
channelReference string
channelId string
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna
queueId string ✔️

Microsoft.Communication.RouterJobExceptionTriggered

Kembali ke Katalog Kejadian

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/exceptionrule/{rulekey}",
  "data": {
    "ruleKey": "r100",
    "exceptionRuleId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterJobExceptionTriggered",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
ruleKey string
exceptionRuleId string
jobId string
channelReference string
channelId string
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna

Microsoft.Communication.RouterJobWorkerSelectorsExpired

Kembali ke Katalog Kejadian

{
  "id": "b6d8687a-5a1a-42ae-b8b5-ff7ec338c872",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/queue/{queue-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "requestedWorkerSelectorsExpired": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "attachedWorkerSelectorsExpired": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ]
  },
  "eventType": "Microsoft.Communication.RouterJobWorkerSelectorsExpired",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
jobId string
channelReference string ✔️
queueId string
channelId string
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna
requestedWorkerSelectorsExpired List<WorkerSelector> ✔️ Berdasarkan input pengguna saat membuat pekerjaan
attachedWorkerSelectorsExpired List<WorkerSelector> ✔️ Daftar pemilih pekerja yang dilampirkan oleh kebijakan klasifikasi

Microsoft.Communication.RouterJobUnassigned

Kembali ke Katalog Kejadian

{
  "id": "acdf8fa5-8ab4-4a65-874a-c1d2a4a97f2e",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}/assignment/{assignment-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "assignmentId": "",
    "workerId": "",
    "channelId": "FooVoiceChannelId",
    "channelReference": "test-abc",
    "queueId": "queue-id",    
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterJobUnassigned",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
jobId string
assignmentId string
workerId string
channelId string
channelReference string
queueId string ✔️ null ketika classificationPolicyId ditentukan untuk suatu pekerjaan
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna

Microsoft.Communication.RouterJobWaitingForActivation

Kembali ke Katalog Kejadian

{
  "id": "acdf8fa5-8ab4-4a65-874a-c1d2a4a97f2e",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelId": "FooVoiceChannelId",
    "channelReference": "test-abc",
    "queueId": "queue-id",    
    "priority": 1,
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "requestedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "attachedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "scheduledOn": "2022-02-17T00:55:25.1736293Z",
    "unavailableForMatching": false
  },
  "eventType": "Microsoft.Communication.RouterJobWaitingForActivation",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
jobId string
channelId string
channelReference string
queueId string ✔️ null ketika classificationPolicyId ditentukan untuk suatu pekerjaan
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna
requestedWorkerSelectorsExpired List<WorkerSelector> ✔️ Berdasarkan input pengguna saat membuat pekerjaan
attachedWorkerSelectorsExpired List<WorkerSelector> ✔️ Daftar pemilih pekerja yang dilampirkan oleh kebijakan klasifikasi
scheduledOn DateTimeOffset ✔️ Berdasarkan input pengguna saat membuat pekerjaan
tidak tersediaForMatching bool ✔️ Berdasarkan input pengguna saat membuat pekerjaan
prioritas int Berdasarkan input pengguna saat membuat pekerjaan

Microsoft.Communication.RouterJobSchedulingFailed

Kembali ke Katalog Kejadian

{
  "id": "acdf8fa5-8ab4-4a65-874a-c1d2a4a97f2e",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "job/{job-id}/channel/{channel-id}",
  "data": {
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelId": "FooVoiceChannelId",
    "channelReference": "test-abc",
    "queueId": "queue-id",    
    "priority": 1,
    "labels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "requestedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "attachedWorkerSelectors": [
      {
        "key": "string",
        "labelOperator": "equal",
        "value": 5,
        "ttl": "P3Y6M4DT12H30M5S"
      }
    ],
    "scheduledOn": "2022-02-17T00:55:25.1736293Z",
    "failureReason": "Error"
  },
  "eventType": "Microsoft.Communication.RouterJobSchedulingFailed",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
jobId string
channelId string
channelReference string
queueId string ✔️ null ketika classificationPolicyId ditentukan untuk suatu pekerjaan
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna
requestedWorkerSelectorsExpired List<WorkerSelector> ✔️ Berdasarkan input pengguna saat membuat pekerjaan
attachedWorkerSelectorsExpired List<WorkerSelector> ✔️ Daftar pemilih pekerja yang dilampirkan oleh kebijakan klasifikasi
scheduledOn DateTimeOffset ✔️ Berdasarkan input pengguna saat membuat pekerjaan
failureReason string ✔️ Sistem ditentukan
prioritas int Berdasarkan input pengguna saat membuat pekerjaan

Kejadian Pekerja

Microsoft.Communication.RouterWorkerOfferIssued

Kembali ke Katalog Kejadian

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}/job/{job-id}",
  "data": {
    "workerId": "w100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "offerId": "525fec06-ab81-4e60-b780-f364ed96ade1",
    "offeredOn": "2021-06-23T02:43:30.3847144Z",
    "expiresOn": "2021-06-23T02:44:30.3847674Z",
    "jobPriority": 5,
    "jobLabels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "jobTags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterWorkerOfferIssued",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
workerId string
jobId string
channelReference string
channelId string
queueId string
offerId string
offeredOn DateTimeOffset
kedaluwarsaOn DateTimeOffset
jobPriority int
jobLabels Dictionary<string, object> ✔️ Berdasarkan input pengguna
jobTags Dictionary<string, object> ✔️ Berdasarkan input pengguna

Microsoft.Communication.RouterWorkerOfferAccepted

Kembali ke Katalog Kejadian

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}/job/{job-id}",
  "data": {
    "workerId": "w100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "jobPriority": 5,
    "jobLabels": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "jobTags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "offerId": "565fec06-ab81-4e60-b780-f364ed96ade1",
    "assignmentId": "765fec06-ab81-4e60-b780-f364ed96ade1"
  },
  "eventType": "Microsoft.Communication.RouterWorkerOfferAccepted",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
workerId string
jobId string
jobPriority int
jobLabels Dictionary<string, object> ✔️ Berdasarkan input pengguna
jobTags Dictionary<string, object> ✔️ Berdasarkan input pengguna
channelReference string
channelId string
queueId string
offerId string
assignmentId string

Microsoft.Communication.RouterWorkerOfferDeclined

Kembali ke Katalog Kejadian

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}/job/{job-id}",
  "data": {
    "workerId": "w100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1",
    "offerId": "565fec06-ab81-4e60-b780-f364ed96ade1",
  },
  "eventType": "Microsoft.Communication.RouterWorkerOfferDeclined",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
workerId string
jobId string
channelReference string
channelId string
queueId string
offerId string

Microsoft.Communication.RouterWorkerOfferRevoked

Kembali ke Katalog Kejadian

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}/job/{job-id}",
  "data": {
    "offerId": "565fec06-ab81-4e60-b780-f364ed96ade1",
    "workerId": "w100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1"
  },
  "eventType": "Microsoft.Communication.RouterWorkerOfferRevoked",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
offerId string
workerId string
jobId string
channelReference string
channelId string
queueId string

Microsoft.Communication.RouterWorkerOfferExpired

Kembali ke Katalog Kejadian

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}/job/{job-id}",
  "data": {
    "offerId": "565fec06-ab81-4e60-b780-f364ed96ade1",
    "workerId": "w100",
    "jobId": "7f1df17b-570b-4ae5-9cf5-fe6ff64cc712",
    "channelReference": "test-abc",
    "channelId": "FooVoiceChannelId",
    "queueId": "625fec06-ab81-4e60-b780-f364ed96ade1"
  },
  "eventType": "Microsoft.Communication.RouterWorkerOfferExpired",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
workerId string
offerId string
jobId string
channelReference string
channelId string
queueId string

Microsoft.Communication.RouterWorkerRegistered

Kembali ke Katalog Kejadian

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}",
  "data": {
    "workerId": "worker3",
    "totalCapacity": 100,
    "queueAssignments": [
      {
        "id": "MyQueueId2",
        "name": "Queue 3",
        "labels": {
          "Language": "en",
          "Product": "Office",
          "Geo": "NA"
        }
      }
    ],
    "labels": {
      "x": "111",
      "y": "111"
    },
    "channelConfigurations": [
      {
        "channelId": "FooVoiceChannelId",
        "capacityCostPerJob": 10,
        "maxNumberOfJobs": 5
      }
    ],
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    }
  },
  "eventType": "Microsoft.Communication.RouterWorkerRegistered",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
workerId string
totalCapacity int
queueAssignments List<QueueDetails>
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
channelConfigurations List<ChannelConfiguration>
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna

Microsoft.Communication.RouterWorkerUpdated

Kembali ke Katalog Kejadian

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}",
  "data": {
    "workerId": "worker3",
    "availableForOffers": true,
    "totalCapacity": 100,
    "queueAssignments": [
      {
        "id": "MyQueueId2",
        "name": "Queue 3",
        "labels": {
          "Language": "en",
          "Product": "Office",
          "Geo": "NA"
        }
      }
    ],
    "labels": {
      "x": "111",
      "y": "111"
    },
    "channelConfigurations": [
      {
        "channelId": "FooVoiceChannelId",
        "capacityCostPerJob": 10,
        "maxNumberOfJobs": 5
      }
    ],
    "tags": {
      "Locale": "en-us",
      "Segment": "Enterprise",
      "Token": "FooToken"
    },
    "updatedWorkerProperties": [
      "TotalCapacity",
      "Labels",
      "Tags",
      "ChannelConfigurations",
      "AvailableForOffers",
      "QueueAssignments"
    ]
  },
  "eventType": "Microsoft.Communication.RouterWorkerUpdated",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
workerId string
totalCapacity int
queueAssignments List<QueueDetails>
label Dictionary<string, object> ✔️ Berdasarkan input pengguna
channelConfigurations List<ChannelConfiguration>
tag Dictionary<string, object> ✔️ Berdasarkan input pengguna
updatedWorkerProperties List<UpdateWorkerProperty> Properti Pekerja diperbarui termasuk AvailableForOffers, QueueAssignments, ChannelConfigurations, TotalCapacity, Labels, dan Tags

Microsoft.Communication.RouterWorkerDeregistered

Kembali ke Katalog Kejadian

{
  "id": "1027db4a-17fe-4a7f-ae67-276c3120a29f",
  "topic": "/subscriptions/{subscription-id}/resourceGroups/{group-name}/providers/Microsoft.Communication/communicationServices/{communication-services-resource-name}",
  "subject": "worker/{worker-id}",
  "data": {
    "workerId": "worker3"
  },
  "eventType": "Microsoft.Communication.RouterWorkerDeregistered",
  "dataVersion": "1.0",
  "metadataVersion": "1",
  "eventTime": "2022-02-17T00:55:25.1736293Z"
}

Daftar atribut

Atribut Jenis Dapat diubah ke null Deskripsi Catatan
workerId string

Definisi Model

QueueDetails

public class QueueDetails
{
    public string Id { get; set; }
    public string Name { get; set; }
    public Dictionary<string, object>? Labels { get; set; }
}

CommunicationError

public class CommunicationError
{
    public string? Code { get; init; }
    public string Message { get; init; }
    public string? Target { get; init; }
    public CommunicationError? InnerError { get; init; }
    public IEnumerable<CommunicationError>? Details { get; init; }
}

ChannelConfiguration

public class ChannelConfiguration
{
    public string ChannelId { get; set; }
    public int CapacityCostPerJob { get; set; }
    public int? MaxNumberOfJobs { get; set; }
}

UpdatedWorkerProperty

public enum UpdatedWorkerProperty
{
    AvailableForOffers,
    Capacity,
    QueueAssignments,
    Labels,
    Tags,
    ChannelConfigurations
}

WorkerSelector

public class WorkerSelector
{
    public string Key { get; set; }
    public LabelOperator LabelOperator { get; set; }
    public object Value { get; set; }
    public double? TTLSeconds { get; set; }
    public WorkerSelectorState State { get; set; }
    public DateTimeOffset? ExpireTime { get; set; }
}

public enum WorkerSelectorState
{
    Active = 0,
    Expired = 1
}

public enum LabelOperator
{
    Equal,
    NotEqual,
    LessThan,
    LessThanEqual,
    GreaterThan,
    GreaterThanEqual,
}