1

Client A make a calls to Client B,C,D,E simultaneously if one of them picks a call we have to end up a call to remaining of them.later we if we want to add Client X we can add them into a conference call.like this i have to do.but the thing is it is adding all clients who picks the call they are come to the call.for example if Client B,C,D,E picks call they all are coming into the call with a Client A.and if i hangup the call it is not hanging up to the all clients. this is my code what id did.this code is making calls to all clients simultaneously but if a Client A Hangup call it is not hanging up to the Client B,C,D,E.how to do that and how to hangup rest of them end up from the call if one of them picks a call.please help me on this

  Roomno='randomname';
 ['B','C','D','E'].forEach(vendorarrayid=>{
    client.calls.create({
      to: "client:"+vendorarrayid,
      from: ,"client:"+'A',
      method: 'GET',
      timeout:30,
      callReason:'i have know that reason',
      url: siteUrl+'/join_conference?id=' + Roomno+'&clientid='+ClientID,
      statusCallbackEvent:['completed','answered'],
      statusCallback:siteUrl+'/handleConfeerence?roomno='+Roomno+'&clientid='+ClientID,
      statusCallbackMethod:'GET'
    }).then(call =>console.log(call.sid));
  });


       dial.conference(Roomno, {
     waitUrl: "http://twimlets.com/holdmusic?Bucket=com.twilio.music.rock",
     statusCallbackEvent:"leave join",
     statusCallback:siteUrl+'/leave?roomno='+Roomno+'&clientid='+ClientID,
     statusCallbackMethod:'GET',
     endConferenceOnExit:'true'
   });
   response.type('text/xml');
   console.log(voiceResponse.toString());
philnash
  • 70,667
  • 10
  • 60
  • 88
  • I suggest a different call flow as could possibly violate TCPA guidelines (based on the relationship in place), https://www.twilio.com/docs/glossary/what-is-telephone-consumer-protection-act-tcpa, calling Client B,C,D,E and hanging up on 3 of the 4 when you noticed one of them picks up (as more than one may have picked up during this time). Also, it is not recommended for a user experience perspective, where the clients phones are all ringing, stop ringing, ringing, stop ringing, ringing, stop ringing. It leads to clients not picking up the phone (human nature). I suggest rearchitecting. – Alan May 12 '20 at 09:57
  • i completed my solution by using with api but now i am getting another problem,if a caller hangs up the call callee not getting cancel call push notification in twilio voice .because of this even after call is hangs up at the caller side call is not disconnect at calle side. – ramakrisna p May 12 '20 at 11:45
  • Hi how did you accomplish this? – N Nem Apr 17 '22 at 10:17
  • There is api in twilio voice docs go with that documentation there you can understand evrything with the flow – ramakrisna p Apr 18 '22 at 11:47

0 Answers0