Skip to content

Commit cce3353

Browse files
Update router-quickstart-net.md
1 parent 6e4174d commit cce3353

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

articles/communication-services/quickstarts/router/includes/router-quickstart-net.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ manager: bga
77

88
ms.service: azure-communication-services
99
ms.subservice: azure-communication-services
10-
ms.date: 06/09/2023
10+
ms.date: 07/20/2023
1111
ms.topic: include
1212
ms.custom: include file
1313
ms.author: williamzhao
@@ -117,7 +117,8 @@ var worker = await routerClient.CreateWorkerAsync(
117117
{
118118
QueueIds = { [queue.Value.Id] = new RouterQueueAssignment() },
119119
Labels = { ["Some-Skill"] = new LabelValue(11) },
120-
ChannelConfigurations = { ["voice"] = new ChannelConfiguration(capacityCostPerJob: 1) }
120+
ChannelConfigurations = { ["voice"] = new ChannelConfiguration(capacityCostPerJob: 1) },
121+
AvailableForOffers = true
121122
});
122123
```
123124

@@ -149,7 +150,7 @@ Console.WriteLine($"Worker {worker.Value.Id} is assigned job {accept.Value.JobId
149150
Once the worker has completed the work associated with the job (for example, completed the call), we complete the job.
150151

151152
```csharp
152-
await routerClient.CompleteJobAsync(new CompleteJobOptions("job-1", accept.Value.AssignmentId));
153+
await routerClient.CompleteJobAsync(new CompleteJobOptions(accept.Value.JobId, accept.Value.AssignmentId));
153154
Console.WriteLine($"Worker {worker.Value.Id} has completed job {accept.Value.JobId}");
154155
```
155156

@@ -158,23 +159,41 @@ Console.WriteLine($"Worker {worker.Value.Id} has completed job {accept.Value.Job
158159
Once the worker is ready to take on new jobs, the worker should close the job. Optionally, the worker can provide a disposition code to indicate the outcome of the job.
159160

160161
```csharp
161-
await routerClient.CloseJobAsync(new CloseJobOptions("job-1", accept.Value.AssignmentId) {
162+
await routerClient.CloseJobAsync(new CloseJobOptions(accept.Value.JobId, accept.Value.AssignmentId) {
162163
DispositionCode = "Resolved"
163164
});
164165
Console.WriteLine($"Worker {worker.Value.Id} has closed job {accept.Value.JobId}");
165166
```
166167

168+
## Delete the job
169+
170+
Once the job has been closed, we can delete the job so that we can re-create the job with the same ID if we run this sample again
171+
172+
```csharp
173+
await routerClient.DeleteJobAsync(accept.Value.JobId);
174+
Console.WriteLine($"Deleting job {accept.Value.JobId}");
175+
```
176+
177+
## Run the code
178+
179+
To run the code, make sure you are on the directory where your `router-quickstart.py` file is.
180+
181+
```console
182+
python router-quickstart.py
183+
167184
## Run the code
168185

169186
Run the application using `dotnet run` and observe the results.
170187

171188
```console
172189
dotnet run
173190

174-
Worker worker-1 has an active offer for job 6b83c5ad-5a92-4aa8-b986-3989c791be91
175-
Worker worker-1 is assigned job 6b83c5ad-5a92-4aa8-b986-3989c791be91
176-
Worker worker-1 has completed job 6b83c5ad-5a92-4aa8-b986-3989c791be91
177-
Worker worker-1 has closed job 6b83c5ad-5a92-4aa8-b986-3989c791be91
191+
Azure Communication Services - Job Router Quickstart
192+
Worker worker-1 has an active offer for job job-1
193+
Worker worker-1 is assigned job job-1
194+
Worker worker-1 has completed job job-1
195+
Worker worker-1 has closed job job-1
196+
Deleting job job-1
178197
```
179198

180199
> [!NOTE]

0 commit comments

Comments
 (0)