How to make a call to multiple clients and how to add one of them into conference call in twilio

江枫思渺然 提交于 2020-05-17 05:56:43

问题


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());

来源:https://stackoverflow.com/questions/61691853/how-to-make-a-call-to-multiple-clients-and-how-to-add-one-of-them-into-conferenc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!