2

I have implemented warm transfer in the my application (C#) but I have to extend it. Below is my new use case:

Customer calls to our Twilio number. That Twilio number is assigned to a department in our database. Based on that number I retrieve all agents in that department. So, I want this call to go to all the agents in that department and all agents can see an incoming call on their screen.

How can I make a call to multiple agents on their 'client id' (they have generated their capability token with)?

PS: I can't use dial because dial is used for conference once agent picks up the call, I have to do something in CallResource.Create() function in C#

Raj Gupta
  • 65
  • 8

1 Answers1

1

Twilio developer evangelist here.

If you can't do this via <Dial>, you need to loop through all the numbers you want to call within your C# code, calling CallResource.Create() for each of them.

Note, you will likely want to setup to receive statusCallback webhooks so that you can complete the other calls if someone has answered.

philnash
  • 70,667
  • 10
  • 60
  • 88
  • Hi @philnash, Assume I create a call from X to Y client. ie., CallResource.Create(to: new Twilio.Types.Client("Y"), from: new Twilio.Types.Client("X")); In this case, I do get a incoming call triggered from FCM to client Y. If If accept, call gets dropped. The Problem is client X is not connected to the call. My Question is: In this case, how client X will connect into the call which was created using CallResource.Create()? – Anees Deen Mar 24 '22 at 03:53
  • @AneesDeen You don't create calls from Clients using the REST API. To do so, you need to create the call from the [Twilio Voice SDK](https://www.twilio.com/docs/voice/sdks/javascript). – philnash Mar 24 '22 at 03:57
  • Yes, If I create a call using SDK I need to manage the calls using TwiML Application and redirect the calls using , However, I am trying to initiate and manage the calls from C# Rest Helper Library itself(without dependent on TwiML app) Is this something not achievable? – Anees Deen Mar 24 '22 at 04:06
  • Ah, ok. What you need to do is provide in the REST API call what the call should do when it connects. You can either do this with a URL that points to a `` or you can pass the TwiML directly to the API. – philnash Mar 24 '22 at 04:18
  • That's perfect. I believe the call gets forwarded to . The problem is the call gets connected from X to Y and to Z. The Duration of call is twice(X to Y and X to Z). Is there a way to reject the call and accept. I expect a call from X to Z only. – Anees Deen Mar 24 '22 at 08:31
  • When you connect two people on calls with Twilio, each of those calls is an individual leg. You can’t take Twilio out of the middle, if that is what you’re asking. – philnash Mar 24 '22 at 08:33
  • would you pls join in this chat for few mins. https://chat.stackoverflow.com/rooms/243274/twilio – Anees Deen Mar 24 '22 at 08:48