Skip to content

Commit 6c85657

Browse files
Merge pull request #245663 from williamzhao87/patch-4
Update router-quickstart-net.md
2 parents 4b381f9 + f39553d commit 6c85657

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

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

Lines changed: 20 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,34 @@ 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+
167177
## Run the code
168178

169179
Run the application using `dotnet run` and observe the results.
170180

171181
```console
172182
dotnet run
173183

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
184+
Azure Communication Services - Job Router Quickstart
185+
Worker worker-1 has an active offer for job job-1
186+
Worker worker-1 is assigned job job-1
187+
Worker worker-1 has completed job job-1
188+
Worker worker-1 has closed job job-1
189+
Deleting job job-1
178190
```
179191

180192
> [!NOTE]

0 commit comments

Comments
 (0)