Twilio 宣布参加会议的与会者的姓名

Twilio 宣布参加会议的与会者的姓名,twilio,Twilio,我正在使用Twilio构建一个简单的会议,其中一个会议由代理使用Twilio客户端启动,一个联系人被调用并添加到此会议中。在将此联系人添加到会议之前,我们想在会议室宣布联系人的姓名(例如:现在加入Sam Carter)。这个人的名字是根据数据库中的电话号码计算出来的 连接呼叫时,将执行以下TwiML,将联系人连接到会议: <Dial callerId="+1415xxxxxxx" record="true" action="/my/action/url"> <Confe

我正在使用Twilio构建一个简单的会议,其中一个会议由代理使用Twilio客户端启动,一个联系人被调用并添加到此会议中。在将此联系人添加到会议之前,我们想在会议室宣布联系人的姓名(例如:
现在加入Sam Carter
)。这个人的名字是根据数据库中的电话号码计算出来的

连接呼叫时,将执行以下TwiML,将联系人连接到会议:

<Dial callerId="+1415xxxxxxx" record="true" action="/my/action/url">
    <Conference endConferenceOnExit="true" >ConferenceRoom1</Conference>
</Dial>

会议室1
在执行动词
之前,是否有办法将消息播放到会议中。如果我在
之前写
动词,那么它会向联系人播放消息,而不是在会议室1中


是否有类似OnConferenceCenter的活动,可用于在参与者进入会议时触发另一TwiML?请建议实现此行为的最佳方法。

这个问题的简短答案是,它不能通过Twiml事件完成,但可以通过使用REST API的某种黑客来完成

已就此提出问题,答案如下:

如果问题/答案被删除/删除,我会将其粘贴到下面:


这里有一些东西应该类似于一个好的端到端解决方案

首先,用户拨入,您通过标准提示获取会议室的PIN码及其名称

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Gather action="/conference/pin" finishOnKey="#">
        <Say>Please the conference pin number followed by the pound key.</Say>
    </Gather>
</Response>

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say>Say your name and then press the pound key.</Say>
    <Record action="/conference/name" finishOnKey="#" />
</Response>
现在,下一点变得令人困惑。Twilio现在将与您的呼叫传入端的回调URL以及您在上面为呼叫传出端指定的URL进行对话。您的来电处理程序将需要检测到会议线路正在回拨,并且行为不同;它首先需要用简单的TwiML进行响应,允许电话的传出端输入会议室的pin

POST /2010-04-01/Accounts/{AccountSid}/Calls
From = {your conference phone number}
To = {your conference phone number}
SendDigits = wwww{conference PIN}#
Url = /conference/announce?name={name ID}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Gather action="/conference/announce-pin" finishOnKey="#" />
</Response>

POST的SendDigits参数将提供TwiML位所期望的数字。然后,应通过在新呼叫中召开会议来响应该操作

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial>
    <Conference>{conference ID}</Conference>
  </Dial>
</Response>

{会议ID}
最后一个难题是您在帖子中指定的URL发出的TwiML。这是将环回调用添加到会议后将运行的标记

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play>/conference/name-recordings/{name ID}</Play>
    <Say>has joined the call.</Say>
    <Hangup />
</Response>

/会议/名称录制/{name ID}
他加入了这一号召。

该标记会运行,在会议室播放调用方的姓名和消息,然后挂断。

这个问题的简短答案是,它不能通过Twiml事件完成,但可以通过使用REST API的某种黑客来完成

已就此提出问题,答案如下:

如果问题/答案被删除/删除,我会将其粘贴到下面:


这里有一些东西应该类似于一个好的端到端解决方案

首先,用户拨入,您通过标准提示获取会议室的PIN码及其名称

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Gather action="/conference/pin" finishOnKey="#">
        <Say>Please the conference pin number followed by the pound key.</Say>
    </Gather>
</Response>

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Say>Say your name and then press the pound key.</Say>
    <Record action="/conference/name" finishOnKey="#" />
</Response>
现在,下一点变得令人困惑。Twilio现在将与您的呼叫传入端的回调URL以及您在上面为呼叫传出端指定的URL进行对话。您的来电处理程序将需要检测到会议线路正在回拨,并且行为不同;它首先需要用简单的TwiML进行响应,允许电话的传出端输入会议室的pin

POST /2010-04-01/Accounts/{AccountSid}/Calls
From = {your conference phone number}
To = {your conference phone number}
SendDigits = wwww{conference PIN}#
Url = /conference/announce?name={name ID}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Gather action="/conference/announce-pin" finishOnKey="#" />
</Response>

POST的SendDigits参数将提供TwiML位所期望的数字。然后,应通过在新呼叫中召开会议来响应该操作

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial>
    <Conference>{conference ID}</Conference>
  </Dial>
</Response>

{会议ID}
最后一个难题是您在帖子中指定的URL发出的TwiML。这是将环回调用添加到会议后将运行的标记

<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Play>/conference/name-recordings/{name ID}</Play>
    <Say>has joined the call.</Say>
    <Hangup />
</Response>

/会议/名称录制/{name ID}
他加入了这一号召。

该标记会运行,在会议室中播放呼叫者的姓名和消息,然后挂断。

为了其他人的利益,我就是这样实施此行为的:

  • 一名代理已使用Twilio客户端启动会议,他已在会议中。一旦参与者即将加入同一会议,使用RESTAPI修改实时会议呼叫的URL

    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
    Map<String, String> filter = new HashMap<String, String>();
    filter.put("From", "client:AGENT1");
    filter.put("Status", "in-progress");
    CallList callList = account.getCalls(filter); 
    Call agentsCall = null;
    for (Call inProgressCall : callList) {
        agentsCall = inProgressCall;
        break; //return the first one only..there shouldn't be more
    }
    Map<String, String> agentsCallParams = new HashMap<String, String>();  
    agentsCallParams.put("Url", "http://myserver.com/twiml/agentmessage.xml");
    agentsCallParams.put("Method", "GET");
    agentsCall.update(agentsCallParams);`
    
    TwilioRestClient客户端=新的TwilioRestClient(帐户SID,身份验证令牌);
    Map filter=newhashmap();
    filter.put(“From”,“client:AGENT1”);
    过滤。输入(“状态”、“进行中”);
    CallList CallList=account.getCalls(过滤器);
    调用代理调用=null;
    for(调用inProgressCall:callList){
    agentCall=inProgressCall;
    break;//只返回第一个..不应该有更多
    }
    Map AgentCallParams=新HashMap();
    agentCallParams.put(“Url”http://myserver.com/twiml/agentmessage.xml");
    agentCallParams.put(“方法”、“获取”);
    agentCall.update(agentCallParams)`
    
  • 上面的代码片段将更新现有调用的twiml,如下所示

    <?xml version="1.0" encoding="UTF-8"?>
    <Response>
        <Say>Now joining {name of the participant}</Say>
        <Dial>
           <Conference>Conference1</Conference>
        </Dial>
    </Response>
    
    
    现在加入{参与者名称}
    会议1
    
  • 上面的Twiml将更新呼叫以播放
    动词中的消息,然后将代理放回会议中

  • <?xml version="1.0" encoding="UTF-8"?>
    <Response>
        <Play>/conference/name-recordings/{name ID}</Play>
        <Say>has joined the call.</Say>
        <Hangup />
    </Response>
    
  • 现在,通过返回以下Twiml,让参与者加入同一个会议:

    <?xml version="1.0" encoding="UTF-8"?>
    <Response>
    <Dial>
        <Conference>Conference1</Conference>
    </Dial>
    
    
    会议1
    

    希望这有帮助


  • 为了其他人的利益,以下是我实施此行为的方式:

  • 一名代理已使用Twilio客户端启动会议,他已在会议中。一旦参与者即将加入同一会议,使用RESTAPI修改实时会议呼叫的URL

    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
    Map<String, String> filter = new HashMap<String, String>();
    filter.put("From", "client:AGENT1");
    filter.put("Status", "in-progress");
    CallList callList = account.getCalls(filter); 
    Call agentsCall = null;
    for (Call inProgressCall : callList) {
        agentsCall = inProgressCall;
        break; //return the first one only..there shouldn't be more
    }
    Map<String, String> agentsCallParams = new HashMap<String, String>();  
    agentsCallParams.put("Url", "http://myserver.com/twiml/agentmessage.xml");
    agentsCallParams.put("Method", "GET");
    agentsCall.update(agentsCallParams);`
    
    TwilioRestClient客户端=新的TwilioRestClient(帐户SID,身份验证令牌);
    Map filter=newhashmap();
    filter.put(“From”,“client: