@@ -7,7 +7,7 @@ manager: bga
77
88ms.service : azure-communication-services
99ms.subservice : azure-communication-services
10- ms.date : 06/09 /2023
10+ ms.date : 07/20 /2023
1111ms.topic : include
1212ms.custom : include file
1313ms.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
149150Once 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 ));
153154Console .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
158159Once 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});
164165Console .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
169186Run the application using `dotnet run` and observe the results.
170187
171188```console
172189dotnet 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