Abonnieren von Auftragsrouterereignissen

In diesem Leitfaden werden die Schritte zum Einrichten eines Abonnements für Auftragsrouterereignisse und deren Empfang beschrieben.

Weitere Informationen zu Event Grid finden Sie in der Event Grid-Dokumentation.

Voraussetzungen

Erstellen eines Event Grid-Abonnements

Diese Vorlage stellt ein Event Grid-Abonnement in einer Speicherwarteschlange für Auftragsrouterereignisse bereit. Wenn das Speicherkonto, die Warteschlange oder das Systemthema nicht vorhanden ist, werden sie auch erstellt.

In Azure bereitstellen

Parameter

  • Azure Communication Services-Ressourcenname: Der Name Ihrer Azure Communication Services-Ressource. Wenn der Endpunkt Ihrer Ressource beispielsweise https://contoso.communication.azure.net ist, legen Sie ihn auf contoso fest.
  • Name des Speichers: Der Name Ihres Azure Storage-Kontos. Wenn diese Komponente noch nicht vorhanden ist, wird sie erstellt.
  • Ereignisuntername: Der Name des zu erstellenden Ereignisabonnements.
  • Name des Systemthemas: Wenn Ereignisabonnements in Ihrer Azure Communication Services-Ressource vorhanden sind, suchen Sie den System Topic-Namen auf der Registerkarte Events Ihrer Azure Communication Services-Ressource. Geben Sie andernfalls einen eindeutigen Namen an, z. B. den Azure Communication Services-Ressourcennamen selbst.
  • Warteschlangenname: Der Name Ihrer Warteschlange in Ihrem Speicherkonto. Wenn diese Komponente noch nicht vorhanden ist, wird sie erstellt.

Bereitgestellte Ressourcen

Die folgenden Ressourcen werden als Teil der Lösung bereitgestellt.

  • Speicherkonto, wenn der Speicherkontoname nicht vorhanden ist
  • Speicherwarteschlange, wenn die Warteschlange im Speicherkonto nicht vorhanden ist
  • Event Grid-Systemthema, wenn das Thema nicht vorhanden ist
  • Event Grid-Abonnement: Ein Abonnement für alle Auftragsrouterereignisse in der Speicherwarteschlange

Schnellstart: Empfangen von Event Grid-Ereignissen über eine Azure Storage-Warteschlange

Erstellen einer neuen C#-Anwendung

Verwenden Sie in einem Konsolenfenster (z. B. cmd, PowerShell oder Bash) den Befehl dotnet new zum Erstellen einer neuen Konsolen-App mit dem Namen EventReceiver. Dieser Befehl erstellt ein einfaches „Hallo Welt“-C#-Projekt mit einer einzigen Quelldatei: Program.cs.

dotnet new console -o EventReceiver

Wechseln Sie zum neu erstellten App-Ordner, und verwenden Sie den Befehl dotnet build, um Ihre Anwendung zu kompilieren.

cd EventReceiver
dotnet build

Installieren der Pakete

Installieren Sie Azure Storage-Warteschlangen und Event Grid-Pakete.

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

Empfangen von Nachrichten aus der Warteschlange

Kopieren Sie die folgenden Codeausschnitte, und fügen Sie sie in die Quelldatei Program.cs ein.

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);
}

Ausführen des Codes

Führen Sie die Anwendung mit dem Befehl dotnet run aus dem Anwendungsverzeichnis aus.

dotnet run

Ereignissekatalog

Routerereignisse

Ereignisse Unterdomäne BESCHREIBUNG
RouterJobReceived Job Für das Routing wurde ein neuer Auftrag erstellt.
RouterJobClassified Job Die Klassifizierungsrichtlinie wurde auf einen Auftrag angewendet.
RouterJobQueued Job Ein Auftrag wurde erfolgreich in die Warteschlange eingereiht.
RouterJobClassificationFailed Job Der Router konnte den Auftrag nicht mit einer Klassifizierungsrichtlinie klassifizieren.
RouterJobCompleted Job Ein Auftrag wurde abgeschlossen und tritt in die Abschlussphase ein.
RouterJobClosed Job Ein Auftrag wurde geschlossen, und die Abschlussphase wurde abgeschlossen.
RouterJobCancelled Job Ein Auftrag wurde abgebrochen.
RouterJobExceptionTriggered Job Eine Auftragsausnahme wurde ausgelöst.
RouterJobWorkerSelectorsExpired Job Mindestens eine Workerauswahl für einen Auftrag ist abgelaufen.
RouterJobUnassigned Job Die Zuweisung eines bereits zugewiesenen Auftrags zu einem Worker wurde aufgehoben.
RouterJobWaitingForActivation Job Die angeforderte geplante Zeit eines geplanten Auftrag ist erreicht, und der Router wartet darauf, dass Contoso eine Aktion für den Auftrag ausführt.
RouterJobSchedulingFailed Job Ein geplanter Auftrag wurde angefordert, der Router konnte jedoch keinen erstellen.
RouterWorkerOfferIssued Worker Ein Auftrag wurde einem Worker angeboten.
RouterWorkerOfferAccepted Worker Ein Angebot an einen Worker wurde akzeptiert.
RouterWorkerOfferDeclined Worker Ein Angebot an einen Worker wurde abgelehnt.
RouterWorkerOfferRevoked Worker Ein Angebot an einen Worker wurde widerrufen.
RouterWorkerOfferExpired Worker Ein Angebot an einen Worker ist abgelaufen.
RouterWorkerRegistered Worker Ein Worker wurde registriert (Status von „Inaktiv“/„Wird ausgeglichen“ in „Aktiv“ geändert).
RouterWorkerUpdated Worker Eine der folgenden Workereigenschaften wurde aktualisiert: AvailableForOffers, TotalCapacity, QueueAssignments, ChannelConfigurations, Labels, Tags
RouterWorkerDeregistered Worker Die Registrierung eines Workers wurde aufgehoben (Status von „Aktiv“ in „Inaktiv“/„Wird ausgeglichen“ geändert).

Microsoft.Communication.RouterJobReceived

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
jobId string
channelReference string
jobStatus enum Mögliche Werte: PendingClassification, Queued Wenn dieses Ereignis gesendet wird, muss der Klassifizierungsprozess noch ausgeführt oder der Auftrag mit einer zugeordneten „queueId“ erstellt werden.
channelId string
classificationPolicyId string ✔️ null, wenn queueId für einen Auftrag angegeben ist.
queueId string ✔️ null, wenn classificationPolicyId für einen Auftrag angegeben ist.
priority int ✔️ NULL, wenn classificationPolicyId angegeben ist. Ein Wert, der nicht NULL ist, wenn eine direkte Warteschlangenzuweisung verwendet wird.
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
requestedWorkerSelectors List<WorkerSelector> ✔️ Basierend auf Benutzereingaben
scheduledOn DateTimeOffset ✔️ Basierend auf Benutzereingaben
unavailableForMatching bool ✔️ Basierend auf Benutzereingaben

Microsoft.Communication.RouterJobClassified

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
queueDetails QueueDetails
jobId string
channelReference string
channelId string
classificationPolicyId string
queueId string ✔️ null, wenn classificationPolicy nicht für die Warteschlangenauswahl verwendet wird
priority int ✔️ null, wenn classificationPolicy nicht zum Anwenden der Priorität auf den Auftrag verwendet wird
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
attachedWorkerSelectors List<WorkerSelector> ✔️ Liste der von einer Klassifizierungsrichtlinie angefügten Workerauswahlen

Microsoft.Communication.RouterJobQueued

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
jobId string
channelReference string ✔️
channelId string
queueId string
priority int
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
requestedWorkerSelectors List<WorkerSelector> ✔️ Basierend auf Benutzereingaben beim Erstellen eines Auftrags
attachedWorkerSelectors List<WorkerSelector> ✔️ Liste der von einer Klassifizierungsrichtlinie angefügten Workerauswahlen

Microsoft.Communication.RouterJobClassificationFailed

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
errors List<CommunicationError>
jobId string
channelReference string
channelId string
classificationPolicyId string
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben

Microsoft.Communication.RouterJobCompleted

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
jobId string
channelReference string
channelId string
queueId string
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
assignmentId string
workerId string

Microsoft.Communication.RouterJobClosed

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
jobId string
channelReference string
channelId string
queueId string
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
dispositionCode string ✔️ Basierend auf Benutzereingaben
workerId string
assignmentId string

Microsoft.Communication.RouterJobCancelled

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
Hinweis string ✔️ Basierend auf Benutzereingaben
dispositionCode string
jobId string
channelReference string
channelId string
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
queueId string ✔️

Microsoft.Communication.RouterJobExceptionTriggered

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
ruleKey string
exceptionRuleId string
jobId string
channelReference string
channelId string
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben

Microsoft.Communication.RouterJobWorkerSelectorsExpired

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
jobId string
channelReference string ✔️
queueId string
channelId string
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
requestedWorkerSelectorsExpired List<WorkerSelector> ✔️ Basierend auf Benutzereingaben beim Erstellen eines Auftrags
attachedWorkerSelectorsExpired List<WorkerSelector> ✔️ Liste der von einer Klassifizierungsrichtlinie angefügten Workerauswahlen

Microsoft.Communication.RouterJobUnassigned

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
jobId string
assignmentId string
workerId string
channelId string
channelReference string
queueId string ✔️ null, wenn classificationPolicyId für einen Auftrag angegeben ist.
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben

Microsoft.Communication.RouterJobWaitingForActivation

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
jobId string
channelId string
channelReference string
queueId string ✔️ null, wenn classificationPolicyId für einen Auftrag angegeben ist.
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
requestedWorkerSelectorsExpired List<WorkerSelector> ✔️ Basierend auf Benutzereingaben beim Erstellen eines Auftrags
attachedWorkerSelectorsExpired List<WorkerSelector> ✔️ Liste der von einer Klassifizierungsrichtlinie angefügten Workerauswahlen
scheduledOn DateTimeOffset ✔️ Basierend auf Benutzereingaben beim Erstellen eines Auftrags
unavailableForMatching bool ✔️ Basierend auf Benutzereingaben beim Erstellen eines Auftrags
priority int Basierend auf Benutzereingaben beim Erstellen eines Auftrags

Microsoft.Communication.RouterJobSchedulingFailed

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
jobId string
channelId string
channelReference string
queueId string ✔️ null, wenn classificationPolicyId für einen Auftrag angegeben ist.
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
requestedWorkerSelectorsExpired List<WorkerSelector> ✔️ Basierend auf Benutzereingaben beim Erstellen eines Auftrags
attachedWorkerSelectorsExpired List<WorkerSelector> ✔️ Liste der von einer Klassifizierungsrichtlinie angefügten Workerauswahlen
scheduledOn DateTimeOffset ✔️ Basierend auf Benutzereingaben beim Erstellen eines Auftrags
failureReason string ✔️ Vom System bestimmt
priority int Basierend auf Benutzereingaben beim Erstellen eines Auftrags

Workerereignisse

Microsoft.Communication.RouterWorkerOfferIssued

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
workerId string
jobId string
channelReference string
channelId string
queueId string
offerId string
offeredOn DateTimeOffset
expiresOn DateTimeOffset
jobPriority int
jobLabels Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
jobTags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben

Microsoft.Communication.RouterWorkerOfferAccepted

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
workerId string
jobId string
jobPriority int
jobLabels Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
jobTags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
channelReference string
channelId string
queueId string
offerId string
assignmentId string

Microsoft.Communication.RouterWorkerOfferDeclined

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
workerId string
jobId string
channelReference string
channelId string
queueId string
offerId string

Microsoft.Communication.RouterWorkerOfferRevoked

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
offerId string
workerId string
jobId string
channelReference string
channelId string
queueId string

Microsoft.Communication.RouterWorkerOfferExpired

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
workerId string
offerId string
jobId string
channelReference string
channelId string
queueId string

Microsoft.Communication.RouterWorkerRegistered

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
workerId string
totalCapacity int
queueAssignments List<QueueDetails>
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
channelConfigurations List<ChannelConfiguration>
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben

Microsoft.Communication.RouterWorkerUpdated

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
workerId string
totalCapacity int
queueAssignments List<QueueDetails>
Bezeichnungen Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
channelConfigurations List<ChannelConfiguration>
tags Dictionary<string, object> ✔️ Basierend auf Benutzereingaben
updatedWorkerProperties List<UpdateWorkerProperty> Workereigenschaften aktualisiert, einschließlich „AvailableForOffers“, „QueueAssignments“, „ChannelConfigurations“, „TotalCapacity“, „Labels“ und „Tags“

Microsoft.Communication.RouterWorkerDeregistered

Zurück zum Ereigniskatalog

{
  "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"
}

Attributliste

attribute Typ NULL-Werte zulässig BESCHREIBUNG Hinweise
workerId string

Modelldefinitionen

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,
}