@@ -7,7 +7,7 @@ manager: bga
7
7
8
8
ms.service : azure-communication-services
9
9
ms.subservice : azure-communication-services
10
- ms.date : 06/09 /2023
10
+ ms.date : 07/20 /2023
11
11
ms.topic : include
12
12
ms.custom : include file
13
13
ms.author : williamzhao
@@ -117,7 +117,8 @@ var worker = await routerClient.CreateWorkerAsync(
117
117
{
118
118
QueueIds = { [queue .Value .Id ] = new RouterQueueAssignment () },
119
119
Labels = { [" Some-Skill" ] = new LabelValue (11 ) },
120
- ChannelConfigurations = { [" voice" ] = new ChannelConfiguration (capacityCostPerJob : 1 ) }
120
+ ChannelConfigurations = { [" voice" ] = new ChannelConfiguration (capacityCostPerJob : 1 ) },
121
+ AvailableForOffers = true
121
122
});
122
123
```
123
124
@@ -149,7 +150,7 @@ Console.WriteLine($"Worker {worker.Value.Id} is assigned job {accept.Value.JobId
149
150
Once the worker has completed the work associated with the job (for example, completed the call), we complete the job.
150
151
151
152
``` csharp
152
- await routerClient .CompleteJobAsync (new CompleteJobOptions (" job-1 " , accept .Value .AssignmentId ));
153
+ await routerClient .CompleteJobAsync (new CompleteJobOptions (accept . Value . JobId , accept .Value .AssignmentId ));
153
154
Console .WriteLine ($" Worker {worker .Value .Id } has completed job {accept .Value .JobId }" );
154
155
```
155
156
@@ -158,23 +159,34 @@ Console.WriteLine($"Worker {worker.Value.Id} has completed job {accept.Value.Job
158
159
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.
159
160
160
161
``` csharp
161
- await routerClient .CloseJobAsync (new CloseJobOptions (" job-1 " , accept .Value .AssignmentId ) {
162
+ await routerClient .CloseJobAsync (new CloseJobOptions (accept . Value . JobId , accept .Value .AssignmentId ) {
162
163
DispositionCode = " Resolved"
163
164
});
164
165
Console .WriteLine ($" Worker {worker .Value .Id } has closed job {accept .Value .JobId }" );
165
166
```
166
167
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
+
167
177
## Run the code
168
178
169
179
Run the application using ` dotnet run ` and observe the results.
170
180
171
181
``` console
172
182
dotnet run
173
183
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
178
190
```
179
191
180
192
> [ !NOTE]
0 commit comments