0

I've so far been able to capture an incoming call, and add it to a queue with a workflow reference.

After that the Javascript client I have connected with a worker and a device can see the reservation being created, at which point I call reservation.accept()

I can see that Twilio is calling my assignment callback url, where I am returning this from express

res.status(200).json({
  instruction: "dequeue",
  to: res.locals.twilioIdentity,
})

the twilioIdentity here is the same one I've attached to the accessToken that gets generated and used to create both the device and worker on the Javascript app.

I see in the tasks view in the console that the status has moved to accepted and my worker is the one that now has it, but the call remains on hold and nothing happens on the Javascript app

After I get a ready event when creating the worker, I call

readyWorker.setAttributes({
  contact_uri: identity
})

identity here is the same as above that got used to generate the token and is being passed with the dequeue instruction

What am I missing? The docs don't seem to point to a comprehensive example on dequeueing a call and connecting it to a web based Javascript client

Jordan
  • 2,393
  • 4
  • 30
  • 60

1 Answers1

0

I was misunderstanding dequeue and conference. I was able to make this work by using the conference instruction instead and making sure any reference to a client identity I was passing was prefixed with client: for example contact_uri: client:${identity}

Jordan
  • 2,393
  • 4
  • 30
  • 60